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 


Changes Multiple Value in 1 Address

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

Joined: 17 Mar 2017
Posts: 3

PostPosted: Fri Mar 17, 2017 11:27 am    Post subject: Changes Multiple Value in 1 Address Reply with quote

First, sorry for my bad english
I want to create a script that can change a lot of value in one address :

Code:
t = createTimer(CETrainer.CECheckbox2, true)
t.Interval = 1000
t.OnTimer = function(sender)
  writeInteger("[007e1ebc]+1CFC",1)
  writeInteger("[007e1ebc]+1CFC",2)
  writeInteger("[007e1ebc]+1CFC",3)
  writeInteger("[007e1ebc]+1CFC",4)
  writeInteger("[007e1ebc]+1CFC",5)
  writeInteger("[007e1ebc]+1CFC",6) 
end

function ChangeValue(sender)
  t.Enabled = CETrainer.CECheckbox2.Checked
  t.Disabled = CETrainer.CECheckbox2.Unchecked
end


the problem is that script only change to last value (6), i want make script that could changes value every 1000ms..
anyone can solve it ???
Back to top
View user's profile Send private message
ParkourPenguin
I post too much
Reputation: 138

Joined: 06 Jul 2014
Posts: 4275

PostPosted: Fri Mar 17, 2017 11:41 am    Post subject: Reply with quote

Code:
local values = {1,2,3,4,5,6}
local i = 1

t = createTimer(CETrainer.CECheckbox2, true)
t.Interval = 1000
t.OnTimer = function(sender)
  writeInteger("[007e1ebc]+1CFC", values[i])
  i = (i % #values) + 1
end

function ChangeValue(sender)
  t.Enabled = CETrainer.CECheckbox2.Checked
end

_________________
I don't know where I'm going, but I'll figure it out when I get there.
Back to top
View user's profile Send private message
ramaphobia
How do I cheat?
Reputation: 0

Joined: 17 Mar 2017
Posts: 3

PostPosted: Fri Mar 17, 2017 12:39 pm    Post subject: Reply with quote

ParkourPenguin wrote:
Code:
local values = {1,2,3,4,5,6}
local i = 1

t = createTimer(CETrainer.CECheckbox2, true)
t.Interval = 1000
t.OnTimer = function(sender)
  writeInteger("[007e1ebc]+1CFC", values[i])
  i = (i % #values) + 1
end

function ChangeValue(sender)
  t.Enabled = CETrainer.CECheckbox2.Checked
end


Wow its work, but when i uncheck the checkbox it wouldnt stop...
please help me
Back to top
View user's profile Send private message
ParkourPenguin
I post too much
Reputation: 138

Joined: 06 Jul 2014
Posts: 4275

PostPosted: Fri Mar 17, 2017 12:45 pm    Post subject: Reply with quote

You probably didn't set the OnChange event of the checkbox to the ChangeValue function. Click on the checkbox in the form designer, go to the "Events" tab in the object inspector, and set the OnChange event there.
_________________
I don't know where I'm going, but I'll figure it out when I get there.
Back to top
View user's profile Send private message
ramaphobia
How do I cheat?
Reputation: 0

Joined: 17 Mar 2017
Posts: 3

PostPosted: Fri Mar 17, 2017 12:58 pm    Post subject: Reply with quote

ParkourPenguin wrote:
You probably didn't set the OnChange event of the checkbox to the ChangeValue function. Click on the checkbox in the form designer, go to the "Events" tab in the object inspector, and set the OnChange event there.


sorry its worked, i forgot change the true timer... thanks 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