View previous topic :: View next topic |
Author |
Message |
Greenhouse Cheater Reputation: 0
Joined: 20 Aug 2016 Posts: 44
|
Posted: Tue Jan 24, 2017 2:34 pm Post subject: Checkbox timer(?) |
|
|
It's possible to make a timer stop when a checkbox is active?
I've been trying for a couple of days and I can't make it work, the timer it's always active.
Code: | tmer.OnTimer = function(tmer)
local value=readFloat("[[[[HelloNeighborReborn-Win64-Shipping.exe+02650AC0]+358]+0]+E8]+140")
control_setCaption(CETrainer2_ZAxis, value)
local value=readFloat("[[[[[HelloNeighborReborn-Win64-Shipping.exe+02650AC0]+70]+160]+F0]+0]+144")
control_setCaption(CETrainer2_XAxis, value)
local value=readFloat("[[[[[HelloNeighborReborn-Win64-Shipping.exe+02650AC0]+7B8]+20]+70]+3E0]+148")
control_setCaption(CETrainer2_YAxis, value)
end
tmer = createTimer(nil, false)
tmer.OnTimer = function(tmer)
if checkbox_getState(EditAxis)== 0 then
tmer.Enabled = false
else
tmer.Interval = 100
tmer.Enabled = true
end
end |
|
|
Back to top |
|
|
Dark Byte Site Admin Reputation: 457
Joined: 09 May 2003 Posts: 25262 Location: The netherlands
|
Posted: Tue Jan 24, 2017 3:41 pm Post subject: |
|
|
Code: |
othertmer = createTimer(nil, false)
othertmer.OnTimer = function(t)
if EditAxis.Checked then
tmer.Enabled = false
else
tmer.Interval = 100
tmer.Enabled = true
end
end
|
or just
Code: |
tmer.OnTimer = function(tmer)
if not EditAxis.Checked then
CETrainer2.ZAxis.Caption=readFloat("[[[[HelloNeighborReborn-Win64-Shipping.exe+02650AC0]+358]+0]+E8]+140")
CETrainer2.XAxis.Caption=readFloat("[[[[[HelloNeighborReborn-Win64-Shipping.exe+02650AC0]+70]+160]+F0]+0]+144")
CETrainer2.YAxis.Caption=readFloat("[[[[[HelloNeighborReborn-Win64-Shipping.exe+02650AC0]+7B8]+20]+70]+3E0]+148")
end
end
tmer.Interval = 100
tmer.Enabled = true
|
_________________
Do not ask me about online cheats. I don't know any and wont help finding them.
Like my help? Join me on Patreon so i can keep helping |
|
Back to top |
|
|
Greenhouse Cheater Reputation: 0
Joined: 20 Aug 2016 Posts: 44
|
Posted: Tue Jan 24, 2017 3:49 pm Post subject: |
|
|
It just gives me an error, the same happened with my code:
Code: | Error:[string "function FormKeyPress(sender, key)
..."]:200: attempt to index a nil value (global 'EditAxis')
|
Line 200 is:
Code: | if not EditAxis.Checked then |
By the way. The EditAxis checkbox is in another form. Not in the main one.
|
|
Back to top |
|
|
Dark Byte Site Admin Reputation: 457
Joined: 09 May 2003 Posts: 25262 Location: The netherlands
|
Posted: Tue Jan 24, 2017 3:51 pm Post subject: |
|
|
then do formname.EditAxis.Checked
_________________
Do not ask me about online cheats. I don't know any and wont help finding them.
Like my help? Join me on Patreon so i can keep helping |
|
Back to top |
|
|
Greenhouse Cheater Reputation: 0
Joined: 20 Aug 2016 Posts: 44
|
Posted: Tue Jan 24, 2017 3:56 pm Post subject: |
|
|
But the timer is still enabled. It makes no sense...
I can send you the .CT in a private message If you want to see the entire code,etc.
|
|
Back to top |
|
|
Zanzer I post too much Reputation: 126
Joined: 09 Jun 2013 Posts: 3278
|
Posted: Tue Jan 24, 2017 5:11 pm Post subject: |
|
|
Be aware that every time you click execute, it is creating a new timer while the old one continues running.
Try closing and opening your trainer again. Prevent it from creating multiple timers: Code: | if tmer == nil then
tmer = createTimer(nil, false)
end |
|
|
Back to top |
|
|
Greenhouse Cheater Reputation: 0
Joined: 20 Aug 2016 Posts: 44
|
Posted: Tue Jan 24, 2017 5:18 pm Post subject: |
|
|
Zanzer wrote: | Be aware that every time you click execute, it is creating a new timer while the old one continues running.
Try closing and opening your trainer again. Prevent it from creating multiple timers: Code: | if tmer == nil then
tmer = createTimer(nil, false)
end |
|
Now it just doesn't change. My script is fucked up.
|
|
Back to top |
|
|
Zanzer I post too much Reputation: 126
Joined: 09 Jun 2013 Posts: 3278
|
Posted: Tue Jan 24, 2017 5:24 pm Post subject: |
|
|
You can attach your table to your post.
|
|
Back to top |
|
|
Greenhouse Cheater Reputation: 0
Joined: 20 Aug 2016 Posts: 44
|
Posted: Tue Jan 24, 2017 5:38 pm Post subject: |
|
|
I'll PM you the table.
|
|
Back to top |
|
|
Zanzer I post too much Reputation: 126
Joined: 09 Jun 2013 Posts: 3278
|
Posted: Tue Jan 24, 2017 5:59 pm Post subject: |
|
|
Textboxes have the .Text property.
Code: | if tmer == nil then
tmer = createTimer(nil, false)
end
tmer.OnTimer = function(tmer)
CETrainer2.ZAxis.Text=readFloat("[[[[HelloNeighborReborn-Win64-Shipping.exe+02650AC0]+358]+0]+E8]+140")
CETrainer2.XAxis.Text=readFloat("[[[[[HelloNeighborReborn-Win64-Shipping.exe+02650AC0]+70]+160]+F0]+0]+144")
CETrainer2.YAxis.Text=readFloat("[[[[[HelloNeighborReborn-Win64-Shipping.exe+02650AC0]+7B8]+20]+70]+3E0]+148")
end
tmer.Interval = 100
tmer.Enabled = true
function EditAxisClick(sender)
if sender.Checked then
tmer.Enabled = false
else
tmer.Enabled = true
end
end |
|
|
Back to top |
|
|
Greenhouse Cheater Reputation: 0
Joined: 20 Aug 2016 Posts: 44
|
Posted: Tue Jan 24, 2017 7:15 pm Post subject: |
|
|
Now it works. Thank you soo much!
|
|
Back to top |
|
|
|