View previous topic :: View next topic |
Author |
Message |
.lua Expert Cheater
Reputation: 1
Joined: 13 Sep 2018 Posts: 197
|
Posted: Sat Mar 08, 2025 2:31 am Post subject: Some issues with creating Hotkey |
|
|
Is there no opposite release function for creating Hotkey
|
|
Back to top |
|
 |
Dark Byte Site Admin
Reputation: 467
Joined: 09 May 2003 Posts: 25673 Location: The netherlands
|
Posted: Sat Mar 08, 2025 4:58 am Post subject: |
|
|
destroy the hotkey
_________________
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 |
|
 |
.lua Expert Cheater
Reputation: 1
Joined: 13 Sep 2018 Posts: 197
|
Posted: Thu Mar 13, 2025 1:27 am Post subject: |
|
|
Dark Byte wrote: | destroy the hotkey | Indeed, I have already tried. But I always feel that this hotkey seems a bit delayed, even if DelayBetweenActivate=0, it feels slow, and if I keep holding down the hotkey, it will keep triggering. Is there a type that only listens and presses without popping up?
|
|
Back to top |
|
 |
Dark Byte Site Admin
Reputation: 467
Joined: 09 May 2003 Posts: 25673 Location: The netherlands
|
Posted: Thu Mar 13, 2025 3:42 am Post subject: |
|
|
call setGlobalKeyPollInterval with a value like 10
and DelayBetweenActivate=0 means it takes the default repeat delay interval , which you can set with setGlobalDelayBetweenHotkeyActivation
_________________
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 |
|
 |
AylinCE Grandmaster Cheater Supreme
Reputation: 34
Joined: 16 Feb 2017 Posts: 1465
|
Posted: Thu Mar 13, 2025 8:41 am Post subject: |
|
|
Make all the shortcut key functions the same in your code (do not use Delay or sleep()), add the following code to your script and only write the keys you want to control in the "keys" table.
Test the code with its current state, press "F4, F8, F9" keys, hold them down and release them.
This way you will understand the main idea of the code.
(Edit this table in the code and replace it with your own keys that you use in the script.
keys = {VK_F4, VK_F8, VK_F9} )
Code: | local keys = {VK_F4, VK_F8, VK_F9} -- List of keys to monitor
local key_states = {} -- Table to track the states of the keys
for _, key in ipairs(keys) do
key_states[key] = 1 -- Initially set all keys to state 1 (up)
end
function timer_func()
for _, key in ipairs(keys) do
if key_states[key] == 1 then
if isKeyPressed(key) then
key_states[key] = 2
print("Key pressed: " .. key)
end
elseif key_states[key] == 2 then
if not isKeyPressed(key) then
key_states[key] = 1
print("Key released: " .. key)
end
end
end
-- Trigger garbage collection to manage memory usage
collectgarbage("step")
end
-- Start the timer
if timer then timer.destroy() timer = nil end
timer = createTimer(nil, false) -- Create the timer
timer.setInterval(50) -- Execute every 50 milliseconds
timer.onTimer = timer_func -- Assign the timer function
timer.enabled = true -- Enable the timer |
_________________
|
|
Back to top |
|
 |
.lua Expert Cheater
Reputation: 1
Joined: 13 Sep 2018 Posts: 197
|
Posted: Thu Mar 13, 2025 11:07 am Post subject: |
|
|
AylinCE wrote: | Make all the shortcut key functions the same in your code (do not use Delay or sleep()), add the following code to your script and only write the keys you want to control in the "keys" table.
Test the code with its current state, press "F4, F8, F9" keys, hold them down and release them.
This way you will understand the main idea of the code.
| The code you provided is very useful, thank you very much, but it seems that F9 or F10 is not ideal
|
|
Back to top |
|
 |
AylinCE Grandmaster Cheater Supreme
Reputation: 34
Joined: 16 Feb 2017 Posts: 1465
|
Posted: Thu Mar 13, 2025 2:20 pm Post subject: |
|
|
.lua wrote: | The code you provided is very useful, thank you very much, but it seems that F9 or F10 is not ideal |
You type the key you want there to test it.
As a result, you need to replace the keys in the script and update the keypad with your own keys.
_________________
|
|
Back to top |
|
 |
|