Cheat Engine Forum Index Cheat Engine
The Official Site of Cheat Engine
 
 FAQFAQ   SearchSearch   MemberlistMemberlist   UsergroupsUsergroups   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 


Create Hotkey Bug

 
Post new topic   Reply to topic    Cheat Engine Forum Index -> Cheat Engine Lua Scripting
View previous topic :: View next topic  
Author Message
tortellio
How do I cheat?
Reputation: 0

Joined: 06 Dec 2020
Posts: 5

PostPosted: Thu Mar 11, 2021 10:59 pm    Post subject: Create Hotkey Bug Reply with quote

I have a code like this

Code:

function doSomething()
 --do something
end

function EnableHotkey()
    createHotkey(doSomething, VK_1)
end

createHotkey(EnableHotkey, VK_E)


after pressing the VK_E key, cheat engine will be not responding
Back to top
View user's profile Send private message
ByTransient
Expert Cheater
Reputation: 5

Joined: 05 Sep 2020
Posts: 240

PostPosted: Fri Mar 12, 2021 2:34 am    Post subject: Reply with quote

The agent (E) accepts a pressure, sees (1).
But it doesn't run "hotkey". (key1)
You can use the following, or it can be the other code below.

Code:
keyDown(VK_1)
sleep(1000)
keyUp(VK_1)


Code:
function doSomething()
sleep(200)
 print("pressed key 1")
end

function EnableHotkey()
sleep(300)
 print("pressed key E")

doKeyPress(VK_1)
if isKeyPressed(VK_1) then
doSomething()
end
end

if key1 then key1.destroy() key1=nil end
if keyE then keyE.destroy() keyE=nil end

keyE = createHotkey(EnableHotkey, VK_E)
key1 = createHotkey(doSomething, VK_1)
Back to top
View user's profile Send private message
tortellio
How do I cheat?
Reputation: 0

Joined: 06 Dec 2020
Posts: 5

PostPosted: Sun Mar 14, 2021 4:35 am    Post subject: Reply with quote

ByTransient wrote:
~snip

thank you so much Very Happy
Back to top
View user's profile Send private message
Display posts from previous:   
Post new topic   Reply to topic    Cheat Engine Forum Index -> Cheat Engine Lua Scripting All times are GMT - 6 Hours
Page 1 of 1

 
Jump to:  
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


Powered by phpBB © 2001, 2005 phpBB Group

CE Wiki   IRC (#CEF)   Twitter
Third party websites