CLEO Help Can someone help me turn this AHK into Cleo mod?

CLEO related

ciceuc

Member
Joined
Mar 4, 2020
Messages
17
Reaction score
1
Location
Baia Mare
#MaxThreadsPerHotkey 2
F12::
toggle:=!toggle
While toggle{
Send {ESC}
Sleep 20000
}
Return
 

dphome

Well-known member
Joined
Mar 21, 2020
Messages
456
Solutions
9
Reaction score
165
Location
Poland
When is esc cleo not working... idk
Code:
{$CLEO .cs}

0000: NOP

wait 8500

32@ = 0

while true
wait 0
    if
    0AB0:   key_pressed 123 {F12}
    then
        if
        30@ == false
        then
            30@ = true
            32@ = 0        
            0AD1: "~w~AutoESC ~g~Enable" 1337
        else
            30@ = false
            0AD1: "~w~AutoESC ~r~Disable" 1337            
        end
        wait 500
    end

    if and
    30@ == true
    0256:   player $PLAYER_CHAR defined
    then
        if
        32@ > 20000
        then
            0AB1: @PressON 1 _OFFSET_KEY_ 27 {ESC}
            wait 500
            0AB1: @PressOFF 1 _OFFSET_KEY_ 27 {ESC}            
            32@ = 0
        end
    end
end

:PressON
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@
   end
end
0AB2: ret 0

:PressOFF
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 0x02 0 0@
   end
end
0AB2: ret 0
 

ciceuc

Member
Joined
Mar 4, 2020
Messages
17
Reaction score
1
Location
Baia Mare
When is esc cleo not working... idk
Code:
{$CLEO .cs}

0000: NOP

wait 8500

32@ = 0

while true
wait 0
    if
    0AB0:   key_pressed 123 {F12}
    then
        if
        30@ == false
        then
            30@ = true
            32@ = 0       
            0AD1: "~w~AutoESC ~g~Enable" 1337
        else
            30@ = false
            0AD1: "~w~AutoESC ~r~Disable" 1337           
        end
        wait 500
    end

    if and
    30@ == true
    0256:   player $PLAYER_CHAR defined
    then
        if
        32@ > 20000
        then
            0AB1: @PressON 1 _OFFSET_KEY_ 27 {ESC}
            wait 500
            0AB1: @PressOFF 1 _OFFSET_KEY_ 27 {ESC}           
            32@ = 0
        end
    end
end

:PressON
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@
   end
end
0AB2: ret 0

:PressOFF
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 0x02 0 0@
   end
end
0AB2: ret 0
 

Attachments

  • 1626597351110.png
    1626597351110.png
    9.5 KB · Views: 13

batonkal

Active member
Joined
May 6, 2017
Messages
100
Reaction score
16
Location
Bosnia and Herzegovina
I think that you can't use libraries to press keys because CLEO doesn't work when the ESC menu is active. You need to edit the memory like Parazitas said. Try this:
PHP:
:Go_ESC
// 0AB1: Go_ESC@ 1 time 10000
2@ = 0xBA67A4
3@ = 0xBA68A4

    0A8C: write_memory 2@ size 1 value 1 virtual_protect 0
    0A8C: write_memory 3@ size 1 value 1 virtual_protect 0
    wait 0@
    0A8C: write_memory 2@ size 1 value 0 virtual_protect 0
    0A8C: write_memory 3@ size 1 value 0 virtual_protect 0

0AB2: ret 0
 
Top