Advertisement
Guest User

Untitled

a guest
Aug 17th, 2019
73
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C++ 1.20 KB | None | 0 0
  1. ;Compare to current pixel after 15 seconds, restarts function if match
  2. DetectCrash(StartLabel, crashcontrol)
  3. {
  4.     global
  5.     PixelGetColor, FII, 1278, 306, RGB
  6.     if (crashcontrol == FII)
  7.     {
  8.         if IsLabel(StartLabel)
  9.             return True                                     ; Restart parent function by going to label at its start
  10.     }
  11.     Fn := Func("DetectCrashControl").Bind(StartLabel)       ; Reference function and bind parameters for SetTimer
  12.     SetTimer, % Fn, -15000
  13.     return
  14. }
  15.  
  16.  
  17. ;Get a pixel as control for crash testing
  18. DetectCrashControl(StartLabel)
  19. {
  20.     global
  21.     PixelGetColor, FOO, 1278, 306, RGB
  22.     if IsLabel(StartLabel)
  23.     {
  24.         Fn := Func("DetectCrash").Bind(StartLabel, FOO)     ; Reference function and bind parameters for SetTimer
  25.         if (SetTimer, % Fn, -15000 == True)
  26.             return True
  27.     }
  28.     return
  29. }
  30.  
  31.  
  32. ;Kill Timers
  33. TimerKill(StartLabel)
  34. {
  35.     global
  36.     Fn := Func("DetectCrash").Bind(StartLabel, FOO)         ;Probably something wrong in this part
  37.     SetTimer, % Fn, Off
  38.     Fn := Func("DetectCrashControl").Bind(StartLabel)
  39.     SetTimer, % Fn, Off
  40.     return
  41. }
  42.  
  43.  
  44. Ads()                                                       ;Sample function
  45. {
  46.     global
  47.     AdsStart:
  48.     if (DetectCrashControl("AdsStart") = True)
  49.         goto AdsStart
  50.     (...)                                                   ;Function stuff
  51.     TimerKill(AdsStart)
  52.     return
  53. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement