| View previous topic :: View next topic |
| Author |
Message |
rakion99 How do I cheat?
Reputation: 0
Joined: 31 Oct 2016 Posts: 1 Location: Mexico
|
Posted: Mon Oct 31, 2016 2:21 am Post subject: Need help with createHotkey |
|
|
why when i call a function with a hotkey and in the function i have a createhotkey cheat engine stop responding? if i call the function with a button is fine but if i use a hotkey this happen, im doing something wrong?
| Code: |
print ("Loaded")
function CEButton1Click()
print("Start")--Here Cheat Engine Stop Responding
createHotkey(setFlyOn, VK_SPACE)
print("End")
end
createHotkey(CEButton1Click,VK_NUMPAD9)
|
Thanks :3 |
|
| Back to top |
|
 |
Dark Byte Site Admin
Reputation: 470
Joined: 09 May 2003 Posts: 25807 Location: The netherlands
|
Posted: Mon Oct 31, 2016 2:55 am Post subject: |
|
|
the hotkey handler has a critical section while it's handling the hotkeys. (it runs in a separate thread but sends of the hotkey functions to the main thread and wait for them to return)
createHotkey will acquire that critical section, when it adds a new entry to that list.
Therefore, calling createHotkey will wait till the hotkeyhandler has finished an interation, and the hotkley handler is waiting for the current hotkey to finish, so, deadlock
What you can do instead is spawn a timer which you disable as soon as it runs (or spawn a thread that does this) _________________
Do not ask me about online cheats. I don't know any and wont help finding them.
Like my help? Join me on Patreon so i can keep helping |
|
| Back to top |
|
 |
mgr.inz.Player I post too much
Reputation: 222
Joined: 07 Nov 2008 Posts: 4438 Location: W kraju nad Wisla. UTC+01:00
|
Posted: Mon Oct 31, 2016 5:12 am Post subject: |
|
|
Interesting. Are there more things like createHotkey and OnHotkey? _________________
|
|
| Back to top |
|
 |
Dark Byte Site Admin
Reputation: 470
Joined: 09 May 2003 Posts: 25807 Location: The netherlands
|
Posted: Mon Oct 31, 2016 2:38 pm Post subject: |
|
|
Not sure what you mean with this. Issues with critical sections ?
As for this case, I think it's easier to just create the hotkeys beforehand, and in the hotkey handler check if it should act or not _________________
Do not ask me about online cheats. I don't know any and wont help finding them.
Like my help? Join me on Patreon so i can keep helping |
|
| Back to top |
|
 |
mgr.inz.Player I post too much
Reputation: 222
Joined: 07 Nov 2008 Posts: 4438 Location: W kraju nad Wisla. UTC+01:00
|
Posted: Mon Oct 31, 2016 2:55 pm Post subject: |
|
|
Yes, issues with critical sections. _________________
|
|
| Back to top |
|
 |
|