sky_touch Posted November 28, 2006 Posted November 28, 2006 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 ------------------------------------------------------------------------------------------------
MHz Posted November 28, 2006 Posted November 28, 2006 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
Recommended Posts
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 accountSign in
Already have an account? Sign in here.
Sign In Now