He meant a Cleo script, not an autohotkey script, also you need to insert a small delay so that gta sa keyboard hook can intercept itx::send {space 2}
#persistent
setkeydelay,300,300
return
~x::
send {space 2}
return
Hello, is cleo possible to make player/user automated pressing the specific key when pressing 1 key?
For example: When i pressed "X" it will be automatically pressing "SPACE" twice.
{$CLEO .cs}
0000: press space twice when x was pressed by ajom
while true
wait 0
if 0AB0: key_pressed 88 // X
then
0AB1: @Set_Virtual_Key 2 KeyOffSet 0x20 time 250
0AB1: @Set_Virtual_Key 2 KeyOffSet 0x20 time 250
while 0AB0: key_pressed 88 // anti-key spam X
wait 0
end
end
end
:Set_Virtual_Key // ripped from Parazitas (http://ugbase.eu/index.php?threads/snippet-set-virtual-or-game-key.19933/)
// 0AB1: @Set_Virtual_Key 2 KeyOffSet 0x125 time 800
2@ = 0xB72CC8
0@ *= 2
005A: 2@ += 0@ // (int)
0A8C: write_memory 2@ size 1 value 255 virtual_protect 0
wait 1@
0A8C: write_memory 2@ size 1 value 0 virtual_protect 0
0AB2: ret 0
thanks! i'll try laterHe meant a Cleo script, not an autohotkey script, also you need to insert a small delay so that gta sa keyboard hook can intercept it
Code:#persistent setkeydelay,300,300 return ~x:: send {space 2} return
Code:{$CLEO .cs} 0000: press space twice when x was pressed by ajom while true wait 0 if 0AB0: key_pressed 88 // X then 0AB1: @Set_Virtual_Key 2 KeyOffSet 0x20 time 250 0AB1: @Set_Virtual_Key 2 KeyOffSet 0x20 time 250 while 0AB0: key_pressed 88 // anti-key spam X wait 0 end end end :Set_Virtual_Key // ripped from Parazitas (http://ugbase.eu/index.php?threads/snippet-set-virtual-or-game-key.19933/) // 0AB1: @Set_Virtual_Key 2 KeyOffSet 0x125 time 800 2@ = 0xB72CC8 0@ *= 2 005A: 2@ += 0@ // (int) 0A8C: write_memory 2@ size 1 value 255 virtual_protect 0 wait 1@ 0A8C: write_memory 2@ size 1 value 0 virtual_protect 0 0AB2: ret 0