View previous topic :: View next topic |
Author |
Message |
Corroder Grandmaster Cheater Supreme Reputation: 75
Joined: 10 Apr 2015 Posts: 1667
|
Posted: Thu Apr 30, 2015 1:51 am Post subject: Help to fix interval timer value |
|
|
Hi, guys
I try to make a speed hack trainer with timer.
The idea is user allow to input how long count down timer he/she want
and speed hack automatic return value 1 while count down time complete.
Speed hack work when click the button (its set to 0), but not return automatic to 1 when interval time over.
Does anyone can help to fix this script below ?
Code: |
--- control_setCaption(CEEdit1, "0")
function CEButton1Click(sender)
speedhack_setSpeed(0)
t.Enabled=true
end
function resetSpeed()
if (t) then
t.Enabled=false
-- t.Destroy()
-- t=nil
end
speedhack_setSpeed(1)
end
t=createTimer(nil, false)
t.onTimer=resetSpeed
---tmr = tonumber(control_getCaption(UDF1.CEEdit1))
t.Interval=tonumber(control_getCaption(UDF1.CEEdit1))
|
Thanks
Description: |
|
Filesize: |
30.61 KB |
Viewed: |
4876 Time(s) |
|
|
|
Back to top |
|
|
Dark Byte Site Admin Reputation: 457
Joined: 09 May 2003 Posts: 25262 Location: The netherlands
|
Posted: Thu Apr 30, 2015 4:28 am Post subject: |
|
|
when the script launches the editbox contains the value 0
an interval of 0 will prevent the timer from functioning
what you want to do is set the interval in the button click before enabling it instead of when the script gets loaded
_________________
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 |
|
|
Corroder Grandmaster Cheater Supreme Reputation: 75
Joined: 10 Apr 2015 Posts: 1667
|
Posted: Thu Apr 30, 2015 7:59 am Post subject: |
|
|
Thank you Dark Byte,
By follow your instruction, now the script work properly.
Edit script
Code: |
function CEButton1Click(sender)
tmr = tonumber(control_getCaption(UDF1.CEEdit1))
t.Interval=tmr
speedhack_setSpeed(0)
t.Enabled=true
end
function resetSpeed()
if (t) then
t.Enabled=false
-- t.Destroy()
-- t=nil
end
speedhack_setSpeed(1)
end
t=createTimer(nil, false)
t.onTimer=resetSpeed
|
Be regards
Description: |
|
Filesize: |
32.86 KB |
Viewed: |
4833 Time(s) |
|
|
|
Back to top |
|
|
|