CLEO Help Help, auto press key didn't work when the dialog is opened.

CLEO related
Status
Not open for further replies.

ha.sh

Active member
Joined
Nov 14, 2018
Messages
66
Reaction score
0
I'm trying to make a cleo for Auto /fish and pick the Fishing Rod and Bait.
But the snippet code from Parazitas didn't work at this code, idk why. Anyone can help me please?


Code:
// This file was decompiled using SASCM.ini published by GTAG (http://gtag.gtagaming.com/opcode-database) on 14.6.2013
{$CLEO .cs}

//-------------MAIN---------------
0000: NOP
wait 8500
alloc 2@ 260
format 2@ "You have"

:Noname_39
wait 0
if and
key_down 18
key_down 50
jf @Noname_219

:Noname_62
wait 0
if and
key_down 18
key_down 50
jf @Noname_62
if
  16@ == 1
jf @Noname_117
16@ = 0
goto @Noname_124

:Noname_117
16@ = 1

:Noname_124
printf "~r~Auto /fish mode: ~w~%d" 2000 16@
wait 500
printf "~r~DRL-AutoFishing.cs" 3000

:Noname_219
wait 0
if and
  16@ == 1
   Player.Defined($PLAYER_CHAR)
jf @Noname_521
30@ = 99

:Noname_253
alloc 0@ 260
call @Noname_582 1 30@ 0@
alloc 1@ 260
call @Noname_1025 4 0@ 123 125 1@
if
call @Noname_674 2 1@ 2@ 3@
jf @Noname_500
alloc 19@ 260
alloc 20@ 260
alloc 4@ 260
0AF4: 20@ = read_string_from_ini_file "cleo\DRL-AutoFishing.ini" section "Settings" key "AutoRoleplay"
// format 19@ "/me %s" 20@
format 4@ "/fish" 
wait 250
// call @Noname_528 1 19@
wait 1000
call @Noname_528 1 4@   
wait 1500         
0AB1: @Set_Virtual_Key 2 KeyOffSet 0x28 state 255
wait 30
0AB1: @Set_Virtual_Key 2 KeyOffSet 0x28 state 0
wait 30                                     
0AB1: @Set_Virtual_Key 2 KeyOffSet 0x28 state 255
wait 30
0AB1: @Set_Virtual_Key 2 KeyOffSet 0x28 state 0
wait 30
0AB1: @Set_Virtual_Key 2 KeyOffSet 0x28 state 255
wait 30
0AB1: @Set_Virtual_Key 2 KeyOffSet 0x28 state 0
wait 30
0AB1: @Set_Virtual_Key 2 KeyOffSet 0x28 state 255
wait 30
0AB1: @Set_Virtual_Key 2 KeyOffSet 0x28 state 0
wait 30
0AB1: @Set_Virtual_Key 2 KeyOffSet 0x0D state 255
wait 30
0AB1: @Set_Virtual_Key 2 KeyOffSet 0x0D state 0
wait 30
0AB1: @Set_Virtual_Key 2 KeyOffSet 0x28 state 255
wait 30
0AB1: @Set_Virtual_Key 2 KeyOffSet 0x28 state 0
wait 30
0AB1: @Set_Virtual_Key 2 KeyOffSet 0x28 state 255
wait 30
0AB1: @Set_Virtual_Key 2 KeyOffSet 0x28 state 0
wait 30
0AB1: @Set_Virtual_Key 2 KeyOffSet 0x28 state 255
wait 30
0AB1: @Set_Virtual_Key 2 KeyOffSet 0x28 state 0
wait 30
0AB1: @Set_Virtual_Key 2 KeyOffSet 0x28 state 255
wait 30
0AB1: @Set_Virtual_Key 2 KeyOffSet 0x28 state 0
wait 30
0AB1: @Set_Virtual_Key 2 KeyOffSet 0x28 state 255
wait 30
0AB1: @Set_Virtual_Key 2 KeyOffSet 0x28 state 0
wait 30
0AB1: @Set_Virtual_Key 2 KeyOffSet 0x28 state 255
wait 30
0AB1: @Set_Virtual_Key 2 KeyOffSet 0x28 state 0
wait 30
0AB1: @Set_Virtual_Key 2 KeyOffSet 0x28 state 255
wait 30
0AB1: @Set_Virtual_Key 2 KeyOffSet 0x28 state 0
wait 30
0AB1: @Set_Virtual_Key 2 KeyOffSet 0x28 state 255
wait 30
0AB1: @Set_Virtual_Key 2 KeyOffSet 0x28 state 0
wait 30                               
0AB1: @Set_Virtual_Key 2 KeyOffSet 0x0D state 255
wait 30
0AB1: @Set_Virtual_Key 2 KeyOffSet 0x0D state 0
wait 30
wait 2000           
free 4@
free 19@
free 20@

:Noname_500
30@ += 1
  30@ > 99
jf @Noname_253

:Noname_521
goto @Noname_39

:Noname_528
if
0AA2: 1@ = load_library "samp.dll" // IF and SET
jf @Noname_577
1@ += 430912
0AA5: call 1@ num_params 1 pop 0 0@

:Noname_577
ret 0

:Noname_582
if
0AA2: 1@ = load_library "samp.dll" // IF and SET
jf @Noname_666
1@ += 2804240
0A8D: 1@ = read_memory 1@ size 4 virtual_protect 0
1@ += 306
0@ *= 252
005A: 1@ += 0@ // (int)
1@ += 32
0AA3: free_library 1@

:Noname_666
ret 1 1@

:Noname_674
call @Noname_951 1 0@ 31@
call @Noname_951 1 1@ 30@
if
001D:   30@ > 31@ // (int)
jf @Noname_734
return_false
ret 1 0

:Noname_734
31@ -= 1
26@ = 0
29@ = 0

:Noname_755
0085: 24@ = 0@ // (int)
005A: 24@ += 29@ // (int)
0A8D: 28@ = read_memory 24@ size 1 virtual_protect 0
0085: 23@ = 1@ // (int)
005A: 23@ += 26@ // (int)
0A8D: 27@ = read_memory 23@ size 1 virtual_protect 0
if
003B:   28@ == 27@ // (int)
jf @Noname_888
26@ += 1
if
002D:   26@ >= 30@ // (int)
jf @Noname_881
return_true
0062: 24@ -= 30@ // (int)
24@ += 1
ret 1 24@

:Noname_881
goto @Noname_920

:Noname_888
if
  26@ > 0
jf @Noname_913
29@ -= 1

:Noname_913
26@ = 0

:Noname_920
29@ += 1
001D:   29@ > 31@ // (int)
jf @Noname_755
return_false
ret 1 0

:Noname_951
1@ = 0

:Noname_958
0A8D: 2@ = read_memory 0@ size 1 virtual_protect 0
if
   not 2@ == 0
jf @Noname_1017
0@ += 1
1@ += 1
  1@ > 1024
jf @Noname_958

:Noname_1017
ret 1 1@

:Noname_1025
5@ = 0
call @Noname_951 1 0@ 31@
30@ = 0

:Noname_1055
0085: 29@ = 0@ // (int)
005A: 29@ += 30@ // (int)
0A8D: 28@ = read_memory 29@ size 1 virtual_protect 1
if
003B:   28@ == 1@ // (int)
jf @Noname_1109
5@ = 1

:Noname_1109
if
  5@ == 0
jf @Noname_1146
0A8C: write_memory 3@ size 1 value 28@ virtual_protect 1
3@ += 1

:Noname_1146
if
003B:   28@ == 2@ // (int)
jf @Noname_1172
5@ = 0

:Noname_1172
30@ += 1
001D:   30@ > 31@ // (int)
jf @Noname_1055
0A8C: write_memory 3@ size 1 value 0 virtual_protect 1
ret 0
if
0AA2: 2@ = load_library "samp.dll" // IF and SET
jf @Noname_1309
0085: 3@ = 2@ // (int)
3@ += 2804240
0A8D: 3@ = read_memory 3@ size 4 virtual_protect 1
0085: 4@ = 2@ // (int)
4@ += 423504
0AA6: call_method 4@ struct 3@ num_params 5 pop 0 0 0@ 0 1@ 8

:Noname_1309
ret 0

:Set_Virtual_Key
{
    255 = true
    0 = false
    0AB1: @Set_Virtual_Key 2 KeyOffSet 0x57 state 255
}
2@ = 0xB72CC8
0@ *= 2
005A: 2@ += 0@  // (int)
0A8C: write_memory 2@ size 1 value 1@ virtual_protect 0
0AB2: ret 0
 

Parazitas

God
Joined
Jan 2, 2017
Messages
3,103
Solutions
5
Reaction score
882
Location
Lithuania
Someone else maybe can, I'm to busy
PHP:
:CloseCurrentDialogWithButton
{
    0.3.7 - R1
    0AB1: @CloseCurrentDialogWithButton 1 Button 0 // 1 = Left , 0 = Right
}
IF 0AA2: 10@ = "samp.dll"
THEN  
    0A8E: 11@ = 10@ + 0x21A0B8 // SAMP_DIALOG_INFO_OFFSET
    0A8D: 12@ = readMem 11@ sz 4 vp 0
    0A8E: 11@ = 10@ +  0x6C040 //SAMP_DIALOG_CLOSE
    0AA8: call_function_method 11@ struct 12@ num_params 1 pop 0 Button 0@ _retVal 6@
END
0AB2: 0
 
Last edited:

ha.sh

Active member
Joined
Nov 14, 2018
Messages
66
Reaction score
0
Someone else maybe can, I'm to busy
PHP:
:CloseCurrentDialogWithButton
{
    0.3.7 - R1
    0AB1: @CloseCurrentDialogWithButton 1 Button 0 // 1 = Left , 0 = Right
}
IF 0AA2: 10@ = "samp.dll"
THEN 
    0A8E: 11@ = 10@ + 0x21A0B8 // SAMP_DIALOG_INFO_OFFSET
    0A8D: 12@ = readMem 11@ sz 4 vp 0
    0A8E: 11@ = 10@ +  0x6C040 //SAMP_DIALOG_CLOSE
    0AA8: call_function_method 11@ struct 12@ num_params 1 pop 0 Button 0@ _retVal 6@
END
0AB2: 0
yes, but i need the set_current_dialog_list snippet for 0.3dl
i've trying using your snippet for 0.3.7 - R3 but crashes.


Code:
{$CLEO .cs}

0000:

wait 10000

while true

if and
wait 0
key_down 18
then
printf "ON" 1337
repeat
0AB1: @Set_current_dialog_list_item 1 ItemNumber 5
wait 100
until key_down 16
printf "OFF" 1337
end
end



:Set_current_dialog_list_item
{
    0.3.7 - R3
    0AB1: @Set_current_dialog_list_item 1 ItemNumber 1
}
0AA2: 1@ = "samp.dll"
1@ += 0x26E898
0A8D: 1@ = readMem 1@ sz 1 vp 0
1@ += 20
0A8D: 1@ = readMem 1@ sz 1 vp 0
1@ += 143
0A8C: write_memory 1@ size 1 value 0@ virtual_protect 0
0AB2: 0
 

ha.sh

Active member
Joined
Nov 14, 2018
Messages
66
Reaction score
0
Someone else maybe can, I'm to busy
PHP:
:CloseCurrentDialogWithButton
{
    0.3.7 - R1
    0AB1: @CloseCurrentDialogWithButton 1 Button 0 // 1 = Left , 0 = Right
}
IF 0AA2: 10@ = "samp.dll"
THEN 
    0A8E: 11@ = 10@ + 0x21A0B8 // SAMP_DIALOG_INFO_OFFSET
    0A8D: 12@ = readMem 11@ sz 4 vp 0
    0A8E: 11@ = 10@ +  0x6C040 //SAMP_DIALOG_CLOSE
    0AA8: call_function_method 11@ struct 12@ num_params 1 pop 0 Button 0@ _retVal 6@
END
0AB2: 0
i've try this too, and crashes at 0.3dl
 

Parazitas

God
Joined
Jan 2, 2017
Messages
3,103
Solutions
5
Reaction score
882
Location
Lithuania
1. My bad, i'm sorry.
2. I can't understand at this point, how can i change the pointet to dl?

PHP:
:CLOSE_DIALOG
{
    0.3.DL
    0AB1: @CLOSE_DIALOG 1 Button 0 // 0 = Left , 1 = Right
}
IF 0AA2: 10@ = "samp.dll"
THEN     
    0A8E: 11@ = 10@ + 0x2AC9E0 // SAMP_DIALOG_INFO_OFFSET
    0A8D: 12@ = readMem 11@ sz 4 vp 0
    0A8E: 11@ = 10@ + 0x700D0 //SAMP_DIALOG_CLOSE
    0AA8: call_function_method 11@ struct 12@ num_params 1 pop 0 0@ $NOT_USED
END
0AB2: 0

PHP:
0x2AC9E0 // SAMP_DIALOG_INFO_OFFSET
 

ha.sh

Active member
Joined
Nov 14, 2018
Messages
66
Reaction score
0
PHP:
:CLOSE_DIALOG
{
    0.3.DL
    0AB1: @CLOSE_DIALOG 1 Button 0 // 0 = Left , 1 = Right
}
IF 0AA2: 10@ = "samp.dll"
THEN   
    0A8E: 11@ = 10@ + 0x2AC9E0 // SAMP_DIALOG_INFO_OFFSET
    0A8D: 12@ = readMem 11@ sz 4 vp 0
    0A8E: 11@ = 10@ + 0x700D0 //SAMP_DIALOG_CLOSE
    0AA8: call_function_method 11@ struct 12@ num_params 1 pop 0 0@ $NOT_USED
END
0AB2: 0

PHP:
0x2AC9E0 // SAMP_DIALOG_INFO_OFFSET
like i said before, close dialog snippet work fine. i need the snippet for set_current_dialog_list 0.3dl. sorry, i'm asking too much.
 
Last edited:

Parazitas

God
Joined
Jan 2, 2017
Messages
3,103
Solutions
5
Reaction score
882
Location
Lithuania
...
PHP:
:Set_current_dialog_list_item
{
    0.3.DL
    0AB1: @Set_current_dialog_list_item 1 ItemNumber 1
}
0AA2: 1@ = "samp.dll"
1@ += 0x2AC9E0
0A8D: 1@ = readMem 1@ sz 1 vp 0
1@ += 20
0A8D: 1@ = readMem 1@ sz 1 vp 0
1@ += 143
0A8C: write_memory 1@ size 1 value 0@ virtual_protect 0
0AB2: 0
 

ha.sh

Active member
Joined
Nov 14, 2018
Messages
66
Reaction score
0
...
PHP:
:Set_current_dialog_list_item
{
    0.3.DL
    0AB1: @Set_current_dialog_list_item 1 ItemNumber 1
}
0AA2: 1@ = "samp.dll"
1@ += 0x2AC9E0
0A8D: 1@ = readMem 1@ sz 1 vp 0
1@ += 20
0A8D: 1@ = readMem 1@ sz 1 vp 0
1@ += 143
0A8C: write_memory 1@ size 1 value 0@ virtual_protect 0
0AB2: 0
Code:
[03:58:50] Warning(s007): Exception 0xC0000005 at 0x735B78F8

[03:58:50] Warning(s007): Exception 0xC0000005 at 0x486DDF

[03:58:51] Warning(s007): Exception 0xC0000005 at 0x487167

[03:58:51] Warning(s007): Exception 0xC0000005 at 0x0

[03:58:51] Warning(s007): Exception 0xC0000005 at 0x0

[03:58:51] Warning(s007): Exception 0xC0000005 at 0x0

[03:58:51] Warning(s007): Exception 0xC0000005 at 0x0

[03:58:51] Warning(s007): Exception 0xC0000005 at 0x0

[03:58:51] Warning(s007): Exception 0xC0000005 at 0x0

[03:58:51] Warning(s007): Exception 0xC0000005 at 0x0

[03:58:51] Warning(s007): Exception 0xC0000005 at 0x0

still crash.
 
Status
Not open for further replies.
Top