CLEO Help how to do http requests in cleo?

CLEO related
Status
Not open for further replies.

downloadstuff

Active member
Joined
Apr 4, 2015
Messages
82
Reaction score
0
hey how do i make http get requests ? for example lets say theres a txt file on http://server.com/file.txt and i want to check if the file contains the string "lastversion=ok"

how would i do that in cleo? thanks.
 

Opcode.eXe

Expert
Joined
Feb 18, 2013
Messages
1,486
Reaction score
226
Location
( ͡° ͜ʖ ͡°)
SAMPFUNCS:

0C65: 3@ = download_url "http://server.com/file.txt" to_file "file.txt"
wait 1234 whatever
0AF0: 0@ = get_int_from_ini_file "file.txt" section "Update" key "lastversion"
if
0@ == 1
then
last version
end
 

Zin

Expert
Joined
Aug 1, 2013
Messages
1,690
Reaction score
103
Can this be used for like if a cleo is outdatted and you can get the cleo to tell you a new version is out?
 

downloadstuff

Active member
Joined
Apr 4, 2015
Messages
82
Reaction score
0
got errors tried correcting the url with
Opcode.eXe link said:
SAMPFUNCS:

0C65: 3@ = download_url "http:" 2f 2f "server.com" 2f "file.txt" to_file "file.txt"
wait 1234 whatever
0AF0: 0@ = get_int_from_ini_file "file.txt" section "Update" key "lastversion"
if
0@ == 1
then
  0ACD: show_text_highpriority "testok" time 15000
end

but when i load the game it just keeps blinking.. also is it possible to store the result to a string? instead of a file?.. thanks
 

WaTTi

Well-known member
Joined
Jan 4, 2015
Messages
260
Reaction score
8
I'm trying do something using this, but I have this error when I compile  :sadpepe:
332d52663de6140c15318ad3c00c44d9.png
 
Status
Not open for further replies.
Top