CLEO Help help auto download

CLEO related

Dheyker

Member
Joined
Mar 17, 2021
Messages
15
Reaction score
0
Location
En tu cora <3
In the browser settings,What browser are you using?
The idea would be that it works with any browser, it is for example if a DLL file is missing to download it automatically, this would be checked by a cleo and it would download it, but I don't know if it's possible
 

Hidend

Expert
Joined
Mar 4, 2013
Messages
656
Reaction score
50
:URLDownloadToFile
0AA2: 10@ = load_library "Urlmon.dll" // IF and SET
0AA4: 11@ = get_proc_address "URLDownloadToFileA" 10@
0AA7: address 11@ params 5 pop 0 /*params*/ 0 0 0@ 1@ 0 /*ret*/ 12@
ret 0

Or if you are using sampfuncs you can use 0C65
 

Dheyker

Member
Joined
Mar 17, 2021
Messages
15
Reaction score
0
Location
En tu cora <3
:URLDownloadToFile
0AA2: 10@ = load_library "Urlmon.dll" // IF and SET
0AA4: 11@ = get_proc_address "URLDownloadToFileA" 10@
0AA7: address 11@ params 5 pop 0 /*params*/ 0 0 0@ 1@ 0 /*ret*/ 12@
ret 0

Or if you are using sampfuncs you can use 0C65
Do you have any example? how to select the location where the file is saved?
 

dphome

Well-known member
Joined
Mar 21, 2020
Messages
475
Solutions
9
Reaction score
168
Location
Poland
https://www.thinkbroadband.com/download - Extra Small File (5MB) <-- this is file used on this script

Working on samp start:
Code:
{$CLEO .cs}

0000: NOP

0AC8: 0@ = allocate_memory_size 1024   
0AD3: 0@ = "cleo\5MB.zip"
0AC8: 1@ = allocate_memory_size 1024
0AD3: 1@ = "http://ipv4.download.thinkbroadband.com/5MB.zip"  
0AB1: @URLDownloadToFile 2 0@ 1@ 
0AD1: "~r~Download" time 1337
004E: end_thread

:URLDownloadToFile
0AA2: 10@ = load_library "Urlmon.dll" // IF and SET
0AA4: 11@ = get_proc_address "URLDownloadToFileA" 10@
0AA7: address 11@ params 5 pop 0 /*params*/ 0 0 0@ 1@ 0 /*ret*/ 12@
0AB2: ret 0

Working when press X:
Code:
{$CLEO .cs}

0000: NOP

WAIT 8500

WHILE TRUE
WAIT 0

IF 0AB0:   key_pressed 88
THEN 
    0AC8: 0@ = allocate_memory_size 1024   
    0AD3: 0@ = "cleo\5MB.zip"
    0AC8: 1@ = allocate_memory_size 1024
    0AD3: 1@ = "http://ipv4.download.thinkbroadband.com/5MB.zip"   
    0AB1: @URLDownloadToFile 2 0@ 1@ 
    0AD1: "~r~Download" time 1337
    WAIT 3000
END

END

:URLDownloadToFile
0AA2: 10@ = load_library "Urlmon.dll" // IF and SET
0AA4: 11@ = get_proc_address "URLDownloadToFileA" 10@
0AA7: address 11@ params 5 pop 0 /*params*/ 0 0 0@ 1@ 0 /*ret*/ 12@
0AB2: ret 0
 
Last edited:
Top