Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- ;Compare to current pixel after 15 seconds, restarts function if match
- DetectCrash(StartLabel, crashcontrol)
- {
- global
- PixelGetColor, FII, 1278, 306, RGB
- if (crashcontrol == FII)
- {
- if IsLabel(StartLabel)
- return True ; Restart parent function by going to label at its start
- }
- Fn := Func("DetectCrashControl").Bind(StartLabel) ; Reference function and bind parameters for SetTimer
- SetTimer, % Fn, -15000
- return
- }
- ;Get a pixel as control for crash testing
- DetectCrashControl(StartLabel)
- {
- global
- PixelGetColor, FOO, 1278, 306, RGB
- if IsLabel(StartLabel)
- {
- Fn := Func("DetectCrash").Bind(StartLabel, FOO) ; Reference function and bind parameters for SetTimer
- if (SetTimer, % Fn, -15000 == True)
- return True
- }
- return
- }
- ;Kill Timers
- TimerKill(StartLabel)
- {
- global
- Fn := Func("DetectCrash").Bind(StartLabel, FOO) ;Probably something wrong in this part
- SetTimer, % Fn, Off
- Fn := Func("DetectCrashControl").Bind(StartLabel)
- SetTimer, % Fn, Off
- return
- }
- Ads() ;Sample function
- {
- global
- AdsStart:
- if (DetectCrashControl("AdsStart") = True)
- goto AdsStart
- (...) ;Function stuff
- TimerKill(AdsStart)
- return
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement