| View previous topic :: View next topic |
| Author |
Message |
Mac99 Newbie cheater
Reputation: 0
Joined: 13 Sep 2022 Posts: 14
|
Posted: Fri Oct 14, 2022 5:30 pm Post subject: createHotkey inconsistent behaviour |
|
|
I've tried to define for my buttons a hotkey, which when pressed calls the button's Click function.
I've now run into the problem that some hotkeys work when I try to develop the trainer (the normal Cheat Engine environment),
but when I use the Trainer as an EXE the hotkeys don't work anymore.
Also, I don't know if Cheat Engine has some issues with the game reserving so many hotkeys because there are only a handful of keys that work when developing the trainer.
In my case, only the F1-F5 work during development and Numpad+. As an EXE only the key "Home" and "Insert" work. All the other keys don't work.
This is my code
| Code: | --GhostMode
createHotkey(CETrainer_1_CEToggleBox4Click,VK_SUBTRACT)
--Change Class
createHotkey(CETrainer_CEButton3Click,VK_HOME)
--Change Team
createHotkey(CETrainer_CECheckbox1Click,VK_INSERT)
--Instant Interaction
createHotkey(CETrainer_1_CEToggleBox3Click,VK_DELETE)
--Deactivate Ability Cooldown
createHotkey(CETrainer_1_CEToggleBox3Click,VK_F3)
--Unlimited Placements
createHotkey(CETrainer_1_CEToggleBox1Click,VK_F4)
--Change Weapon1
createHotkey(CETrainer_1_CEButton1Click,VK_F2)
--UnlimitedAmmo
createHotkey(CETrainer_1_CEToggleBox6Click,VK_ADD)
|
Any idea why some keys work when developing and testing the Trainer and don't work in the final EXE?
|
|
| Back to top |
|
 |
cooleko Grandmaster Cheater
Reputation: 11
Joined: 04 May 2016 Posts: 717
|
Posted: Fri Oct 14, 2022 10:57 pm Post subject: |
|
|
| You have an _1 in all the hot keys you say dont work, is it possible that the naming is off or whatever element it refers to doesnt exist once compiled to exe?
|
|
| Back to top |
|
 |
Dark Byte Site Admin
Reputation: 473
Joined: 09 May 2003 Posts: 25916 Location: The netherlands
|
Posted: Sat Oct 15, 2022 12:52 am Post subject: |
|
|
the createHotkey lines must be executed after the functions have been defined. So if you put this codenat the top, it'll fail
_________________
Tools give you results. Knowledge gives you control.
Like my help? Join me on Patreon so i can keep helping |
|
| Back to top |
|
 |
AylinCE Grandmaster Cheater Supreme
Reputation: 39
Joined: 16 Feb 2017 Posts: 1572
|
Posted: Sat Oct 15, 2022 11:00 am Post subject: Re: createHotkey inconsistent behaviour |
|
|
| Mac99 wrote: | | Any idea why some keys work when developing and testing the Trainer and don't work in the final EXE? |
İdea ..
| Code: | --GhostMode
function GhostMode()
sleep(200)
--your code
end
-- Avoid re-creating it at edit time! (KillHotkey)
if GhostM then GhostM.Destroy() GhostM=nil end
GhostM = createHotkey(GhostMode, VK_SUBTRACT)
-- Edit ToggleBox name ..
CETrainer1.CEToggleBox4.OnClick = GhostMode |
_________________
|
|
| Back to top |
|
 |
|