|
Cheat Engine The Official Site of Cheat Engine
|
View previous topic :: View next topic |
Author |
Message |
mgr.inz.Player I post too much Reputation: 218
Joined: 07 Nov 2008 Posts: 4438 Location: W kraju nad Wisla. UTC+01:00
|
Posted: Tue Jan 24, 2017 6:22 pm Post subject: |
|
|
ner0 wrote: | mgr.inz.Player wrote: | I think you can keep the switch. It won't break anything. |
Ok, yeah it shouldn't be a problem.
Although this doesn't seem to be as consistent as expected... if I spam the hot key several times and stop, then the next time I press the hotkey it'll execute the function 3 times in a row. I have the hotkey delay set at 500ms and yet this will happen nonetheless. Not if I don't spam the hotkey though, weird...
EDIT: Nevermind, it's cheat engine that behaves weirdly after a few... closing CE and reopening goes away with the weirdness. |
If you execute this line few times:
Code: | myHotkey = createHotkey(runMe, VK_END) |
It will create few hotkeys.
If you are debugging your code and you click "execute" few times, this will prevent creating new ones.
Code: | if myHotkey==nil then myHotkey = createHotkey(runMe, VK_END) end
myHotkey.OnHotkey = runMe
myHotkey.setKeys(VK_END) |
_________________
|
|
Back to top |
|
|
ner0 Cheater Reputation: 0
Joined: 10 Dec 2011 Posts: 32
|
Posted: Tue Jan 24, 2017 6:30 pm Post subject: |
|
|
mgr.inz.Player wrote: |
If you execute this line few times:
Code: | myHotkey = createHotkey(runMe, VK_END) |
It will create few hotkeys.
If you are debugging your code and you click "execute" few times, this will prevent creating new ones.
Code: | if myHotkey==nil then myHotkey = createHotkey(runMe, VK_END) end
myHotkey.OnHotkey = runMe
myHotkey.setKeys(VK_END) |
|
The createHotkey is outside any function, which I would think would only run once at runtime, beside the problem only seems to appear if I spam the function more than 4 or 5 times in a row.
In any case, thanks for the hint, I'll make sure that it does not spawn more than one hotkey from the same line. By the way, do you think that this approach would work as well as your suggestion:
Code: | if not myHotkey then myHotkey = createHotkey(runMe, VK_END) end |
Thanks again for all the help!
|
|
Back to top |
|
|
|
|
You cannot post new topics in this forum You cannot reply to topics in this forum You cannot edit your posts in this forum You cannot delete your posts in this forum You cannot vote in polls in this forum You cannot attach files in this forum You can download files in this forum
|
|