CLEO Help dialog list select

CLEO related
Status
Not open for further replies.

davidel

Well-known member
Joined
Jan 17, 2020
Messages
207
Reaction score
7
Location
Germania
{$CLEO .cs}
0000:


REPEAT
WAIT 0
UNTIL 0AFA: SAMP_IS_READY

alloc 2@ 32
format 2@ "Obtain" //dialog title to detect Romania language

while true
wait 0
if
0B4C: samp is_dialog_active -1
then
alloc 3@ 256
0BD8: samp get_dialog_caption 3@
if 0C14: strcmp string1 2@ string2 3@ //comparing
then
free 3@
wait 100
0AB1: @FAKE_KEYPRESS 1 _OFFSET_KEY_ 0x59 {Enter}
wait 1000
0B4B: samp set_current_dialog_editbox_text "1"
0B47: samp close_current_dialog_with_button 1
0A93: end_custom_thread
end
end
wait 500
END


/////////////////////// Snipppet ///////////////////////
/////////// Snippet for Press key
:FAKE_KEYPRESS
if 0AA2: 2@ = load_library "User32.dll"
then
if 0AA4: 2@ = get_proc_address "keybd_event" library 2@
then
0AA5: call 2@ num_params 4 pop 0 0 0 0 0@
wait 1@
0AA5: call 2@ num_params 4 pop 0 0 0x02 0 0@
end
end
0AB2: ret 0
I want when I type "/ dialog" to press the Y key, after 1 second to press the ENTERkey and after pressing ENTER, set "samp set_current_dialog_editbox_text" 1 "" and "samp close_current_dialog_with_button 1", but I want the mode to run only when I type "/dialog"..after closing the dialog, stop the script. I tried something, but the way i write, it runs continuously..
 

davidel

Well-known member
Joined
Jan 17, 2020
Messages
207
Reaction score
7
Location
Germania
{$CLEO .cs}

0000: NOP

REPEAT
WAIT 0
UNTIL 0AFA:
:MAIN
wait 0
if
key_down 114
then
wait 100
0AB1: @FAKE_KEYPRESS 1 _OFFSET_KEY_ 0x59 {A}
wait 100
end
jump @MAIN


/// Snippet
:FAKE_KEYPRESS
if 0AA2: 2@ = load_library "User32.dll"
then
if 0AA4: 2@ = get_proc_address "keybd_event" library 2@
then
0AA5: call 2@ num_params 4 pop 0 0 0 0 0@
wait 1@
0AA5: call 2@ num_params 4 pop 0 0 0x02 0 0@
end
end
0AB2: ret 0
why it s not sending key "Y" when i press F3? i have to spam F3 a lot to go.. or hold f3
@Zin @Parazitas
 

Parazitas

God
Staff member
Joined
Jan 2, 2017
Messages
3,315
Solutions
7
Reaction score
935
Location
Lithuania
{$CLEO .cs}

0000: NOP

REPEAT
WAIT 0
UNTIL 0AFA:
:MAIN
wait 0
if
key_down 114
then
wait 100
0AB1: @FAKE_KEYPRESS 1 _OFFSET_KEY_ 0x59 {A}
wait 100
end
jump @MAIN


/// Snippet
:FAKE_KEYPRESS
if 0AA2: 2@ = load_library "User32.dll"
then
if 0AA4: 2@ = get_proc_address "keybd_event" library 2@
then
0AA5: call 2@ num_params 4 pop 0 0 0 0 0@
wait 1@
0AA5: call 2@ num_params 4 pop 0 0 0x02 0 0@
end
end
0AB2: ret 0
why it s not sending key "Y" when i press F3? i have to spam F3 a lot to go.. or hold f3
@Zin @Parazitas
Use Virtual key...
http://ugbase.eu/index.php?threads/snippet-set-virtual-or-game-key.19933/
 
Status
Not open for further replies.
Top