Jump to content
Sign in to follow this  
sky_touch

I have a script - which i wanna put a 1hr timer on

Recommended Posts

sky_touch

Hi there,

I am trying to add a 1hr timer for this script to run max - Right now it runs forever, but i would like for it to only run for 1 hour then close. Any help would be much appreciated!!

------------------------------------------------------------------------------------------------

$answer = MsgBox(1, "Confirm", "This script will push Space for 1 hour")

If $answer = 2 Then

Exit

EndIf

While 1

ControlSend ("APPLICATION", "", "", "{SPACE}")

Sleep(Random(30000,180000))

WEnd

------------------------------------------------------------------------------------------------

Share this post


Link to post
Share on other sites
MHz

Hi,

Here is a 10 second script to learn from

; start time count
$time = TimerInit()

; use adlib to check if time is exceeded
AdlibEnable('_adlib', 1000)

; keep the script running
While 1
    Sleep(1000)
    TrayTip('Time', Int(TimerDiff($time)/1000), 20)
WEnd

Exit

Func _adlib()
    ; check if time is exceeded
    If TimerDiff($time) > 10000 Then
        Exit
    EndIf
EndFunc

;)

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
Sign in to follow this  

×

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.