Advertisement
Guest User

Untitled

a guest
Aug 17th, 2019
98
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C++ 1.04 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.     msgbox, comparison pixel retrieved
  7.     if (crashcontrol == FII)
  8.     {
  9.         if IsLabel(StartLabel)
  10.             goto %StartLabel%
  11.     }
  12.     Fn := Func("DetectCrashControl").Bind(StartLabel)
  13.     SetTimer, % Fn, -15000
  14.     return
  15. }
  16.  
  17.  
  18. ;Get a pixel as control for crash testing
  19. DetectCrashControl(StartLabel)
  20. {
  21.     global
  22.     PixelGetColor, FOO, 1278, 306, RGB
  23.     if IsLabel(StartLabel)
  24.     {
  25.         Fn := Func("DetectCrash").Bind(StartLabel, FOO)
  26.         SetTimer, % Fn, -15000
  27.         msgbox, control pixel obtained
  28.     }
  29.     return
  30. }
  31.  
  32.  
  33. ;Kill Timers
  34. TimerKill(StartLabel)
  35. {
  36.     global
  37.     Fn := Func("DetectCrash").Bind(StartLabel, FOO)         ;Probably something wrong in this part
  38.     SetTimer, % Fn, Off
  39.     Fn := Func("DetectCrashControl").Bind(StartLabel)
  40.     SetTimer, % Fn, Off
  41.     return
  42. }
  43.  
  44. Ads()                                                       ;Sample function
  45. {
  46.     global
  47.     AdsStart:
  48.     DetectCrashControl("AdsStart")
  49.     (...)                                                   ;Function stuff
  50.     TimerKill(AdsStart)
  51.     return
  52. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement