Advertisement
Guest User

Untitled

a guest
Jun 24th, 2019
105
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. #SingleInstance, Force
  2. #KeyHistory, 0
  3. SetBatchLines, -1
  4. ListLines, Off
  5. SendMode Input ; Forces Send and SendRaw to use SendInput buffering for speed.
  6. SetTitleMatchMode, 3 ; A window's title must exactly match WinTitle to be a match.
  7. SetWorkingDir, %A_ScriptDir%
  8. SplitPath, A_ScriptName, , , , thisscriptname
  9. #MaxThreadsPerHotkey, 1 ; no re-entrant hotkey handling
  10. ; DetectHiddenWindows, On
  11. ; SetWinDelay, -1 ; Remove short delay done automatically after every windowing command except IfWinActive and IfWinExist
  12. ; SetKeyDelay, -1, -1 ; Remove short delay done automatically after every keystroke sent by Send or ControlSend
  13. ; SetMouseDelay, -1 ; Remove short delay done automatically after Click and MouseMove/Click/Drag
  14.  
  15.  
  16.  
  17. toggleCheck(checkFnName) {
  18.  
  19.     %checkFnName%active := !%checkFnName%active
  20.     if (%checkFnName%active) {
  21.         SetTimer, % checkFnName, 50
  22.     } else {
  23.         MsgBox Stopping checking of %checkFnName%
  24.         SetTimer, % checkFnName, Off
  25.     }
  26.  
  27. }
  28.  
  29.  
  30. checkFlask(activeX, activeY, activeColor, fullX, fullY, fullColor, key, checkFnName) {
  31.     Random, rand, 0, 50
  32.     SetTimer, % checkFnName, Off
  33.     PixelGetColor, flaskIsActive, activeX, activeY
  34.     if (flaskIsActive = activeColor) {
  35.         PixelGetColor, flaskIsFull, fullX, fullY
  36.         if (flaskIsFull == fullColor) {
  37.             ; MsgBox f3 is ready!
  38.             SendInput, % key
  39.             SetTimer, % checkFnName, % 2000 + (rand*10)
  40.         } else {
  41.             ; MsgBox f3 is not full! - %flaskIsFull%
  42.             SetTimer, % checkFnName, % 75 + rand
  43.         }
  44.     } else {
  45.         ; MsgBox f3 is active! - %flaskIsActive%
  46.         SetTimer, % checkFnName, % 25 + rand
  47.     }
  48. }
  49.  
  50. CheckF3active := false
  51. CheckF3() {
  52.     checkFlask(809, 2148, 0x2C3B5C, 844, 2037, 0x691B50, 3, "CheckF3")
  53. }
  54.  
  55. CheckF4active := false
  56. CheckF4() {
  57.     checkFlask(901, 2148, 0x283551, 941, 2026, 0x366B32, 4, "CheckF4")
  58. }
  59.  
  60. CheckF5active := false
  61. CheckF5() {
  62.     checkFlask(993, 2148, 0x1A2438, 1033, 2026, 0x356A32, 5, "CheckF5")
  63. }
  64.  
  65.  
  66.  
  67. F3::
  68.    toggleCheck("CheckF3")
  69. return
  70.  
  71. F4::
  72.    toggleCheck("CheckF4")
  73. return
  74.  
  75. F5::
  76.    toggleCheck("CheckF5")
  77. return
  78.  
  79.  
  80.  
  81.  
  82. F7:: ; press control+r to reload
  83.   Msgbox reloading script
  84.   Reload
  85. return
  86.  
  87. F8::  ; Control+Alt+Z hotkey.
  88. MouseGetPos, MouseX, MouseY
  89. PixelGetColor, color, %MouseX%, %MouseY%
  90. MsgBox posx %MouseX%, posy %MouseY%, color: %color%
  91. return
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement