Coding

 Reply to this postStart new topic

Testing scripts from [Goldfish]

Fish
post Oct 5 2015, 05:32 PM
Post #1


The New Guy!

Posts: 8
Joined: 5-October 15



Hello dear friends!
I scripter, writing cleo scripts
cool.gif

After writing the script, i was very worried about the quality of the scripts,
because of this i am in need of people who wish to participate in testing scripts.
I'll be very grateful if you pay attention to it.
thanks in advance!

My contacts
VK:
Home page
Official group


Twitter:
goldfish_akk

==========================================

Now I want ask to help test the script:
- Coord Manager 1.1

This script contains several of my scripts

its meaning only by writing other scripts Cleo.
I wrote it for myself, but then I decided to do it for other Scripters .

it is desirable to have to test the update for this in the INI - file to change the version 1.0 and run the script.
then tell me about the Results. write me about all the questions, perhaps I will have to clarify some of the details
p.s. the script translated into English does not fully

>> download the script << COORD MANAGER_v1.1.zip


Sorry for my English biggrin.gif

I will be glad to all who will test my scripts wink.gif

This post has been edited by Fish: Oct 5 2015, 06:04 PM
Go to the top of the page
 
+Quote Post
Fish
post Oct 12 2015, 12:40 PM
Post #2


The New Guy!

Posts: 8
Joined: 5-October 15



Dear friends!

I'd like to inform you about what my script is all about.
I was very surprised when I heard that almost nobody knows about the auto-update feature. blink.gif

I will not descrbe what function that is, but I'll show you how my auto-update code works, so you wouldn't think the script is dangerous.

This script steals no information!
It uploads the file from Dropbox server.

Auto-update code looks like this:

CODE
0AC8: 0@ = allocate_memory_size 62          
0AC8: 1@ = allocate_memory_size 192
0AD3: 0@ = format "CLEO\temp\CM_UPD.INFO"  // file name
0AD3: 1@ = format "https:%c/...." 47   // download link
0AB1: call_scm_func @URLDownloadToFileA 2 0@ 1@  //  function download file
0AB1: call_scm_func @DeleteUrlCacheEntryA 1 1@ // cleaning function of the cache links
0AC9: free_allocated_memory 0@
0AC9: free_allocated_memory 1@


:URLDownloadToFileA //  function download file
0AA2: 25@ = load_library "Urlmon.DLL"
0AA4: 26@ = get_proc_address "URLDownloadToFileA" library 25@
0AA7: call_function 26@ num_params 5 pop 0 0 0 0@ 1@ 0 20@
0AA3: free_library 25@
0AB2: ret 0

:DeleteUrlCacheEntryA // cleaning function of the cache links
0AA2: 25@ = load_library "Wininet.DLL"
0AA4: 26@ = get_proc_address "DeleteUrlCacheEntryA" library 25@
0AA7: call_function 26@ num_params 1 pop 0 0@ 20@
0AA3: free_library 25@
0AB2: ret 0


As a result file is downloaded to temporary "TEMP" folder, then it replaces old script files.

===================

NEWS upload function looks alike:

CODE
:NEWS
0AAB:  file_exists "CLEO\cm_news.tmp"    
jf @LOAD_NEWS

:OPEN_NEWS
fade 1 1000
wait 1500
01B4: set_player $PLAYER_CHAR can_move 0
0A92: create_custom_thread "cm_news.tmp"  
0AB3: var 100 = 1    
:THREAD_NEWS_STATE
wait 0
0AB4: 0@ = var 100    // флаг завершения скрипта  0- завершен, 1- работает
0@ == 0
jf @THREAD_NEWS_STATE
:NEWS_RET
0B00: delete_file "CLEO\cm_news.tmp"
0B01: delete_directory "CLEO\temp" with_all_files_and_subdirectories 1
01B4: set_player $PLAYER_CHAR can_move 1
return

:LOAD_NEWS  
   8AAB: not file_exists "CLEO\temp\CM_UPD.INFO"
jf @READ_NEWS
0AE5: create_directory "CLEO\temp" //IF and SET
0AC8: 0@ = allocate_memory_size 62          
0AC8: 1@ = allocate_memory_size 192
0AD3: 0@ = format "CLEO\temp\CM_UPD.INFO"
0AD3: 1@ = format "https:%c/www.dropbox.com/s/jqa4o3vdj08npy8/CM_UPD.INFO?dl=1" 47    // ссылка на временный файл инфо версийй
0AB1: call_scm_func @URLDownloadToFileA 2 0@ 1@  // загрузка
0AB1: call_scm_func @DeleteUrlCacheEntryA 1 1@ // очистка кэша
0AC9: free_allocated_memory 0@
0AC9: free_allocated_memory 1@

:READ_NEWS                                                 // СРАВНЕНИЕ ВЕРСИЙ НОВОСТЕЙ
0AF2: 0@ = get_float_from_ini_file "data\Paths\cm_ini.dat" section "DATA" key "news_version"
jf @LOAD_NEWS_REAL // если версия еще не записана, то новость грузится полюбому
0AF2: 1@ = get_float_from_ini_file "CLEO\temp\CM_UPD.INFO" section "UPDATE" key "news"
0025: 1@ > 0@
jf @NEWS_RET
:LOAD_NEWS_REAL
0AC8: 0@ = allocate_memory_size 62          
0AC8: 1@ = allocate_memory_size 192
0AD3: 0@ = format "CLEO\cm_news.tmp"  
0AD3: 1@ = format "https:%c/dropbox.com/s/yv8917310g9iknd/cm_news.tmp?dl=1" 47     // ссылка на новости
0AB1: call_scm_func @URLDownloadToFileA 2 0@ 1@  // загрузка
0AB1: call_scm_func @DeleteUrlCacheEntryA 1 1@ // очистка кэша
0AC9: free_allocated_memory 0@
0AC9: free_allocated_memory 1@
0B01: delete_directory "CLEO\temp" with_all_files_and_subdirectories 1
jump @OPEN_NEWS


It downloads "CLEO / cm_news.tmp" file and launches it. The file is NOT a stealer! It's just a CLEO code!

I'll repeat once more. There are no stealers in my script, there can't be any because I have never scripted anything for SAMP.
If you doubt this you can check how the update process works. The script is open-source!

If there are any questions remaining, contact me and I'll answer them.

P.S.
I'm unpatiently waiting for comments regarding auto-update function since I need to know whether I should use it in any further scripts or not. :turn:

Thanks for the attention!

With due respect, Goldfish. smile.gif
Go to the top of the page
 
+Quote Post
Deji
post Oct 13 2015, 07:36 AM
Post #3


Coding like a Rockstar!

Group Icon

Posts: 1,468
From: ???
Joined: 28-May 09



That's pretty funny though. Generally I'd say auto updaters in CLEO this way is a bit naive, especially for minor scripts with no supportive UI.


--------------------
Go to the top of the page
 
+Quote Post
Fish
post Oct 15 2015, 01:12 AM
Post #4


The New Guy!

Posts: 8
Joined: 5-October 15



I would like to see someone tested confused.gif
Go to the top of the page
 
+Quote Post
Junior_Djjr
post Nov 19 2015, 03:42 PM
Post #5


Ameteur Member

Posts: 32
From: Brazil
Joined: 12-January 14



It is possible to download in the background?
The script makes the game freezes for seconds (apparently to finish downloading), it ruins everything, the only thing that bothers me :/

Or there is some other "information from the web" method without a file? I want to implement it in my mods to give an update warning.
Perhaps, at least open the browser in such a link? I already created the entire script, but I had to give the link to the person paste in the browser (Deji's ClipboardCommands.cleo was useful again tongue.gif )
Also, find out if the person is or is not with the Internet connection? Also help

This can make the firewall blocks, right? At least here not blocked


There are many cool things that can be done mixing the internet connection with the GTA. Imagine using the current climate of your city in the game? If in your city it is raining, the game also will rain, it would be fun.

This post has been edited by Junior_Djjr: Nov 19 2015, 03:45 PM


--------------------
Go to the top of the page
 
+Quote Post
Opcode.eXe
post Dec 30 2015, 09:23 AM
Post #6


The New Guy!

Posts: 9
Joined: 14-April 13



QUOTE (Junior_Djjr @ Nov 19 2015, 04:42 PM) *
It is possible to download in the background?
The script makes the game freezes for seconds (apparently to finish downloading), it ruins everything, the only thing that bothers me :/

Or there is some other "information from the web" method without a file? I want to implement it in my mods to give an update warning.
Perhaps, at least open the browser in such a link? I already created the entire script, but I had to give the link to the person paste in the browser (Deji's ClipboardCommands.cleo was useful again tongue.gif )
Also, find out if the person is or is not with the Internet connection? Also help

This can make the firewall blocks, right? At least here not blocked


There are many cool things that can be done mixing the internet connection with the GTA. Imagine using the current climate of your city in the game? If in your city it is raining, the game also will rain, it would be fun.



Yes it's possible to download in the background, but it's really hard to make for someone who has never done it.
( You have to attach the pointer of the IBindStatusCallback to the UrlDownloadFile function ).
I recommend making something like FileDownloader.cleo. It's easier to do it in c++ than in scm.
If you call an function with CLEO, gta sa will freeze until the function returns true or false.

Go to the top of the page
 
+Quote Post
Reply to this postStart new topic

3 User(s) are reading this topic (3 Guests and 0 Anonymous Users)
0 Members: