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 Scrip

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

Joined: 27 Jul 2016
Posts: 124

PostPosted: Wed Mar 22, 2017 8:22 am    Post subject: Help Lua Scrip Reply with quote

Hello . Please take some time to watch this code for me.
Code:
local recordId = 4
local elapsed = 20000
local duration = 1000
local original = 1
local changeTo = 0

myrecord = getAddressList().getMemoryRecordByID(recordId)
if mytimer == nil then
  mytimer = createTimer(nil, false)
end
mytimer.OnTimer = function(timer)
  if mytimer.Interval == elapsed then
    mytimer.Interval = duration
    myrecord.Value = changeTo
  else
    mytimer.Interval = elapsed
    myrecord.Value = original
  end
end
mytimer.Interval = elapsed
MYTIMER_INTERVAL = 50000
mytimer.OnTimer = function(timer)
  if mytimer.Interval == MYTIMER_INTERVAL then
    mytimer.Interval = duration
    myrecord.Value = changeTo
  else
    mytimer.Interval = MYTIMER_INTERVAL
    myrecord.Value = original
  end
end
function CECheckbox3Change(sender)
function CETrackBar1Change(sender)
  MYTIMER_INTERVAL = sender.Position * 1000
end
  mytimer.Enabled = sender.Checked
end

I think it does not work. Or was acting wrong.
If it's wrong then edit it for me.
Min if dragging out the trackbar it will return to 0. I want it to work is 10 and Max is 50

Very Happy Very Happy Very Happy Very Happy
Back to top
View user's profile Send private message
Filipe_Br
Master Cheater
Reputation: 3

Joined: 07 Jan 2016
Posts: 272
Location: My house

PostPosted: Wed Mar 22, 2017 9:18 am    Post subject: Re: Help Lua Scrip Reply with quote

Although it has little information, perhaps the error is in the end.
Code:
function CECheckbox3Change(sender)
function CETrackBar1Change(sender)
  MYTIMER_INTERVAL = sender.Position * 1000
end
  mytimer.Enabled = sender.Checked
end

for:
Code:
function CECheckbox3Change(sender)
  mytimer.Enabled = sender.Checked
end
function CETrackBar1Change(sender)
  MYTIMER_INTERVAL = sender.Position * 1000
end

And if you want to limit the track bar between 10 and 50. Go to the properties of the trackbar that has options to change this.

_________________
...
Back to top
View user's profile Send private message
Corroder
Grandmaster Cheater Supreme
Reputation: 75

Joined: 10 Apr 2015
Posts: 1667

PostPosted: Wed Mar 22, 2017 8:23 pm    Post subject: Reply with quote

So, Sting9x has not finish his home work.. Smile
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