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 


Help! Lua script creation instructions

 
Post new topic   Reply to topic    Cheat Engine Forum Index -> Cheat Engine Lua Scripting
View previous topic :: View next topic  
Author Message
Vortaka
Advanced Cheater
Reputation: 0

Joined: 18 Nov 2009
Posts: 74

PostPosted: Thu Aug 08, 2019 7:34 am    Post subject: Help! Lua script creation instructions Reply with quote

Hi all! Ok, first, even if I know a lot about PC's, I'm not really that great with programming and dunno much about LUA scripting...

So...

What I want:
A lua script (hotkey) that speaks a the value number... So, I press a specific hotkey and it tells me the Tales of Symphonia "grade" value... Dark Byte wrote to another person to CreateHotKey in lua and in the hotkeycode have speak(memrec.Description..' is '..memrec.Value)
and that he'll add MRvalue to next version (thanks!)

The thing is, I dunno where to start! I already have some lua coding (for auto attack) and, well, I'd like to know what to do next... Where to place the CreateHotKey, what to write itself... Anyway, if anyone as a minute or two to spare, thanks! My code is just below!
Code:
-- getAutoAttachList().add("BloodstainedRotN-Win64-Shipping.exe")
PROCESS_NAME = 'TOS.exe'
--------
-------- Auto Attach
--------
local autoAttachTimer = nil ---- variable to hold timer object
local autoAttachTimerInterval = 1000 ---- Timer intervals are in milliseconds
local autoAttachTimerTicks = 0 ---- variable to count number of times the timer has run
local autoAttachTimerTickMax = 5000 ---- Set to zero to disable ticks max
local function autoAttachTimer_tick(timer) ---- Timer tick call back
        ---- Destroy timer if max ticks is reached
   if autoAttachTimerTickMax > 0 and autoAttachTimerTicks >= autoAttachTimerTickMax then
      timer.destroy()
   end
        ---- Check if process is running
   if getProcessIDFromProcessName(PROCESS_NAME) ~= nil then
      timer.destroy() ---- Destroy timer
      openProcess(PROCESS_NAME) ---- Open the process
   end
   autoAttachTimerTicks = autoAttachTimerTicks + 1 ---- Increase ticks
end
autoAttachTimer = createTimer(getMainForm()) ---- Create timer with the main form as it's parent
autoAttachTimer.Interval = autoAttachTimerInterval ---- Set timer interval
autoAttachTimer.OnTimer = autoAttachTimer_tick ---- Set timer tick call back



Vortaka
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