View previous topic :: View next topic |
Author |
Message |
ramaphobia How do I cheat? Reputation: 0
Joined: 17 Mar 2017 Posts: 3
|
Posted: Fri Mar 17, 2017 11:27 am Post subject: Changes Multiple Value in 1 Address |
|
|
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 |
|
|
ParkourPenguin I post too much Reputation: 138
Joined: 06 Jul 2014 Posts: 4275
|
Posted: Fri Mar 17, 2017 11:41 am Post subject: |
|
|
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 |
|
|
ramaphobia How do I cheat? Reputation: 0
Joined: 17 Mar 2017 Posts: 3
|
Posted: Fri Mar 17, 2017 12:39 pm Post subject: |
|
|
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 |
|
|
ParkourPenguin I post too much Reputation: 138
Joined: 06 Jul 2014 Posts: 4275
|
Posted: Fri Mar 17, 2017 12:45 pm Post subject: |
|
|
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 |
|
|
ramaphobia How do I cheat? Reputation: 0
Joined: 17 Mar 2017 Posts: 3
|
Posted: Fri Mar 17, 2017 12:58 pm Post subject: |
|
|
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
|
|
Back to top |
|
|
|