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 


A Simple hotkey script

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

Joined: 26 Jul 2015
Posts: 6

PostPosted: Sun Jul 26, 2015 5:06 pm    Post subject: A Simple hotkey script Reply with quote

I want to make a simple hotkey script, can you help me?


pseudo code:

Code:
check keystate of "U"
   if "U" key is pressed, write this value to the adress
   if "U" key is up, write this value to the adress
check keystate of "J"
   if "J" key is pressed write this value to the adress
   if "J" key is up write this value to the adress
re-check keystates without waiting (go to top)
Back to top
View user's profile Send private message
ciglipaf
How do I cheat?
Reputation: 0

Joined: 26 Jul 2015
Posts: 6

PostPosted: Mon Aug 03, 2015 8:34 pm    Post subject: Reply with quote

bump
Back to top
View user's profile Send private message
Smellyhobo101
Newbie cheater
Reputation: 0

Joined: 21 Sep 2014
Posts: 23

PostPosted: Sun Aug 30, 2015 11:39 pm    Post subject: Reply with quote

I guess I'll reply

Code:

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


You may have to use writeFloat() or writeBytes() depending on what you're changing. Check the LUA page on the CE wiki to read about those. I'd link it but I don't have the permissions. Also read main.LUA, its in the cheat engine program folder.
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