CLEO Help Swapping between keys

CLEO related
Status
Not open for further replies.

habinabi

Active member
Joined
Nov 10, 2019
Messages
51
Reaction score
2
Location
Czech Republic
hi, i need a script to switch between the W and S keys. My plan is to bind IF ELSE to the numerucal 5 button which will hold W until I press numerical 5, at which point I will release W and start holding S, and so on and on to infinity.

Here is the code but I'm not concerned, please fix or feel free to write your own, thank you very much for your effort.
PHP:
{$CLEO .cs}

0000: NOP

WAIT 10000

WHILE TRUE
WAIT 0

IF 0AB0:   key_pressed 101 {num 5}
THEN 
    if
    0AB1: @Set_Virtual_Key 2 KeyOffSet 0x57 state 255
    else
    0AB1: @Set_Virtual_Key 2 KeyOffSet 0x53 state 255
END

END

: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
 
Status
Not open for further replies.
Top