Page 1 of 1

Activating the script with the key [help]

Posted: Tue Mar 03, 2020 1:45 pm
by krul
I would like to activate the script in-game with a single key.
Default one is Ctrl. How can I change to load it with Q key?
How does CE recognize keyboard keys?

I have found this [Link]
How do I create hold Q key instead of Ctrl?
Virtual key code of Q is 81. But if I change the line push 81 / /Q nothing happens in the game.

Code: Select all

pushad
push 11 //Ctrl
call GetAsyncKeyState
shr ax,#15
cmp ax,1
popad
jne originalcode
fstp st(0)
fldz

Re: Activating the script with the key [help]

Posted: Wed Mar 04, 2020 10:33 am
by TimFun13
krul wrote:
Tue Mar 03, 2020 1:45 pm
I would like to activate the script in-game with a single key.
Default one is Ctrl. How can I change to load it with Q key?
How does CE recognize keyboard keys?

I have found this [Link]
How do I create hold Q key instead of Ctrl?
Virtual key code of Q is 81. But if I change the line push 81 / /Q nothing happens in the game.

Code: Select all

pushad
push 11 //Ctrl
call GetAsyncKeyState
shr ax,#15
cmp ax,1
popad
jne originalcode
fstp st(0)
fldz
This isn't Lua it's ASM, so it needs to be injected into the game's code somewhere.
Topic moved to appropriate area.