CLEO Help Cleo open internet page

CLEO related
Status
Not open for further replies.

hahahafuccoff

Member
Joined
Jun 6, 2018
Messages
16
Reaction score
0
Hello (again :iknowwhatyoudidthere: )

I wanted to create a cleo mod that will open a page in a browser but i am dumb as always and i failed  :shy: 

Code:
{$CLEO}

0000: NOP

repeat
    wait 0
until 0AFA:  is_samp_available  

0B34: samp register_client_command "google" to_label @google

while true
wait 0
end

:google
SAMP.IsCommandTyped(0@)
0A9A: 0@ = openfile "google.html" mode "r"
samp.CmdRet()

In google.html i have this:


Code:
<html>
<head>
<meta http-equiv="refresh" content="0; URL=https://www.google.com/">
<meta name="keywords" content="automatic redirection">
</head>
</html>

I know that i am using wrong opcode [font=Monaco, Consolas, Courier, monospace]0A9A:[/font] but i really don't know another method to do that, that's why i created google.html
Any suggestions ?
 

Opcode.eXe

Expert
Joined
Feb 18, 2013
Messages
1,486
Reaction score
227
Location
( ͡° ͜ʖ ͡°)
You need to use callfunc and then the correct windows function for it.
0AA2: 1@ = load_library "shell32.dll"
0AA4: 2@ = get_proc_address "ShellExecuteA" library 1@
0AA7: call_function
 

monday

Expert
Joined
Jun 23, 2014
Messages
1,127
Solutions
1
Reaction score
158
springfield posted an example for using this function, here's a short testing code

Code:
{$CLEO}
0000:

repeat
wait 50
until 0AFA:  is_samp_available
    
0AA2: 0@ = "shell32.dll"
if 0AA4: 0@ = "ShellExecuteA" 0@
then
  0AA7: 0@ push 6 pop 0 params 1 0 0 "http:\/\/google.com" "open" 0 error_code 1@  
  if 1@ <= 32
  then
  printf "FAILURE: %d" 10000 1@
  end
end

0A93: end_custom_thread
 
Status
Not open for further replies.
Top