View previous topic :: View next topic |
Author |
Message |
gamegamer01 How do I cheat?
Reputation: 0
Joined: 11 Jun 2023 Posts: 3
|
Posted: Sun Jun 11, 2023 5:21 am Post subject: Help me add hotkey to trainer for speedhack |
|
|
i am working on a generic trainer. i already have a cheat table with scripts forspaghetti monstermode, etc. setup with hotkeys. i only have to add speedhack to it.
tutorials i saw on youtube and other platforms guide how to do it using a clickable button on trainer. i am looking to use a hotkey to toggle speedhack.
until now, on this forum i have got an idea that it is possible by creating function in lua script and then assigning a function to hotkey.
what i dont know is where do i put that code? i only know that on trainer design window, we click button and double click it to open lua script for it.
but i want a hotkey not a button. i hope i am clear and not confusing.
also, i wonder if someone can help me find a list of hotkey codes for keyboard, like vk_a, vk_b. i want to assign speed hack to middle mouse button.
the script would be something like this i wonder:
Code: |
[ENABLE]
function speedhacked(sender)
speedhack_setSpeed(0.35)
return true
end
hkey=createHotkey("speedhacked",VK_middlemousebutton)
generichotkey_onHotkey(hkey,speedhacked)
[DISABLE]
speedhack_setSpeed(1)
|
sorry if my code and logic is horribly wrong. i just started few hours ago. please help me
TL;DR
generic trainer > hotkey bind speedhack in lua > dont know where to create script and add to trainer > also dont know keycodes for hotkeys.
|
|
Back to top |
|
 |
AylinCE Grandmaster Cheater Supreme
Reputation: 37
Joined: 16 Feb 2017 Posts: 1516
|
Posted: Sun Jun 11, 2023 3:06 pm Post subject: |
|
|
Code: | [ENABLE]
{$lua}
state1 = 0
if speedKey then speedKey.Destroy() speedKey=nil end
speedKey = createHotkey((function()
sleep(200)
if state1==0 then
speedhack_setSpeed(0.35)
state1=1
else
speedhack_setSpeed(1)
state1=0
end
end), VK_F8)
{$asm}
[DISABLE]
{$lua}
if speedKey then speedKey.Destroy() speedKey=nil end
speedhack_setSpeed(1) |
Virtual-Key Codes[/url]
_________________
|
|
Back to top |
|
 |
gamegamer01 How do I cheat?
Reputation: 0
Joined: 11 Jun 2023 Posts: 3
|
Posted: Mon Jun 26, 2023 1:00 pm Post subject: Thanks It Worked Smooth! |
|
|
cant thank you enough, the code is simple understandable and thanks for keycodes list! i got confidence now
|
|
Back to top |
|
 |
|