Advertisement
Guest User

GregWacker

a guest
Jul 2nd, 2015
204
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 2.96 KB | None | 0 0
  1. ;Decleration ========================================================
  2. WorkingDir := "C:\Users\VladimirPutin\Desktop\scripts\AntiIdle\Projects"
  3. Img_wCoin := WorkingDir . "\ImageSearch\Greg\wCoin.png"
  4. Img_Awesome := WorkingDir . "\ImageSearch\Greg\Awesome.png"
  5. Img_Greg := WorkingDir . "\ImageSearch\Greg\Greg.png"
  6. Got := 0 ; LMB Crop margin
  7. Tog := 1 ; Numpad0 Activation toggle
  8. SetWinDelay 0
  9. Return
  10. ;Notes ========================================================
  11. /* On-The-Go Coord Switching mechanic ( Improvise on +LMB , Revise coord label / convert to function. )
  12. Caution, may be a broken version
  13. */
  14. ;Basic Hotkeys ========================================================
  15. UpdateCursor:
  16. MouseGetPos, X , Y
  17. Return
  18.  
  19.  
  20. Define:
  21. ;x := 480 , y := 240
  22. Return
  23.  
  24. +LButton::
  25. Got := !Got
  26. Return
  27.  
  28.  
  29. Numpad0::
  30. Tog := !Tog
  31. Return
  32.  
  33. ;ImgSearch ========================================================
  34. ; Backup -> ImageSearch, xResult, yResult, startx-200 , starty-200 , startx+200 , starty+200 , *15 %Img_wCoin%
  35.  
  36. Stuff:
  37. searchAgainAfter := 2 ; Default amount of miliseconds to wait between image searches in case of failure
  38. clickAfter := 200 ; Default amount of miliseconds to wait between mouse move and mouse click
  39. ; =======================================================================
  40. ImageSearch, xResult, yResult, startx , starty , endx , endy , *30 %Img_Greg%
  41. ErrGreg := ErrorLevel
  42. ;ToolTip, % "X: " startx ", Y: " starty "`nGreg - " ErrGreg " | " xResult ". " yResult
  43. if (ErrorLevel = 0) {
  44. QuickGrab(xResult,yResult)
  45. }
  46. sleep, % searchAgainAfter
  47. ImageSearch, xResult, yResult, startx , starty , endx , endy , *30 %Img_wCoin%
  48. ErrCoin := ErrorLevel
  49. ;ToolTip, % "X: " startx ", Y: " starty "`nwCoin - " ErrCoin " | " xResult ". " yResult
  50. if (ErrorLevel = 0) {
  51. QuickGrab(xResult,yResult)
  52. }
  53. sleep, % searchAgainAfter
  54. ImageSearch, xResult, yResult, startx , starty , endx , endy , *30 %Img_Awesome%
  55. ErrAwesome := ErrorLevel
  56. ;ToolTip, % "X: " startx ", Y: " starty "`nAwesome - " ErrAwesome " | " xResult ". " yResult
  57. if (ErrorLevel = 0) {
  58. QuickGrab(xResult,yResult)
  59. }
  60. sleep, % searchAgainAfter
  61. Return
  62.  
  63.  
  64. ;Functions ========================================================
  65. SplashThis(xSplash=0,ySplash=0,String="") {
  66. If (SplashTextOn) {
  67. SplashTextOff
  68. SplashTextOn,xSplash,ySplash,, % String
  69. setTimer splashOff, 2000
  70. Return Off
  71. } Else {
  72. SplashTextOn,xSplash,ySplash,, % String
  73. setTimer splashOff, 2000
  74. Return Off
  75. }
  76. splashOff:
  77. setTimer splashOff, Off
  78. ; tooltip, You weren't supposed to see this ;Shows up if triggered, debugging
  79. SplashTextOff
  80. Return Off
  81. }
  82.  
  83. QuickGrab(TheX,TheY) {
  84. BLockInput,MouseMove
  85. OffsetX := TheX + 15
  86. OffsetY := TheY + 15
  87. MouseMove, OffsetX , OffsetY, 15
  88. Sleep, %clickAfter%
  89. MouseClick
  90. BlockInput,MouseMoveOff
  91. }
  92.  
  93. ;Control Keys ========================================================
  94.  
  95. ESC::
  96. SplashThis(300,25,Terminating Script)
  97. sleep 1000
  98. ExitApp
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement