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 


how to write a lua to use combination key?

 
Post new topic   Reply to topic    Cheat Engine Forum Index -> Cheat Engine Lua Scripting
View previous topic :: View next topic  
Author Message
cancandodo
Newbie cheater
Reputation: 0

Joined: 09 Mar 2012
Posts: 14

PostPosted: Thu Mar 01, 2018 6:48 pm    Post subject: how to write a lua to use combination key? Reply with quote

i know use just only one hotkey need write lua like this
===============
function main()
if isKeyPressed(VK_U) then
writeInteger(Address, Value)
else
writeInteger(Address, Value)
end
if isKeyPressed(VK_J) then
writeInteger(Address, Value)
else
writeInteger(Address, Value)
end
end

t = createTimer(nil, false) -- create a Timer object and assign it to variable t
timer_onTimer(t, main) -- When the timer ticks, call the function main
timer_setInterval(t, 50) -- Sets the tickrate of the timer in milliseconds
timer_setEnabled(t, true) -- Turns the timer on
=================
but if i need use ctrl+F1 to run script,i have no idea
Back to top
View user's profile Send private message
Dark Byte
Site Admin
Reputation: 353

Joined: 09 May 2003
Posts: 20599
Location: The netherlands

PostPosted: Fri Mar 02, 2018 1:39 am    Post subject: Reply with quote

why don't you use createHotkey?

anyhow, VK_CONTROL is the ctrl key code, so just check for control and f1 at the same time

_________________
Do not ask me about online cheats. I don't know any and wont help finding them.
Back to top
View user's profile Send private message MSN Messenger
cancandodo
Newbie cheater
Reputation: 0

Joined: 09 Mar 2012
Posts: 14

PostPosted: Mon Apr 02, 2018 7:45 am    Post subject: Reply with quote

Dark Byte wrote:
why don't you use createHotkey?

anyhow, VK_CONTROL is the ctrl key code, so just check for control and f1 at the same time


thanks!
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