Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- ;Decleration ========================================================
- WorkingDir := "C:\Users\VladimirPutin\Desktop\scripts\AntiIdle\Projects"
- Img_wCoin := WorkingDir . "\ImageSearch\Greg\wCoin.png"
- Img_Awesome := WorkingDir . "\ImageSearch\Greg\Awesome.png"
- Img_Greg := WorkingDir . "\ImageSearch\Greg\Greg.png"
- Got := 0 ; LMB Crop margin
- Tog := 1 ; Numpad0 Activation toggle
- SetWinDelay 0
- Return
- ;Notes ========================================================
- /* On-The-Go Coord Switching mechanic ( Improvise on +LMB , Revise coord label / convert to function. )
- Caution, may be a broken version
- */
- ;Basic Hotkeys ========================================================
- UpdateCursor:
- MouseGetPos, X , Y
- Return
- Define:
- ;x := 480 , y := 240
- Return
- +LButton::
- Got := !Got
- Return
- Numpad0::
- Tog := !Tog
- Return
- ;ImgSearch ========================================================
- ; Backup -> ImageSearch, xResult, yResult, startx-200 , starty-200 , startx+200 , starty+200 , *15 %Img_wCoin%
- Stuff:
- searchAgainAfter := 2 ; Default amount of miliseconds to wait between image searches in case of failure
- clickAfter := 200 ; Default amount of miliseconds to wait between mouse move and mouse click
- ; =======================================================================
- ImageSearch, xResult, yResult, startx , starty , endx , endy , *30 %Img_Greg%
- ErrGreg := ErrorLevel
- ;ToolTip, % "X: " startx ", Y: " starty "`nGreg - " ErrGreg " | " xResult ". " yResult
- if (ErrorLevel = 0) {
- QuickGrab(xResult,yResult)
- }
- sleep, % searchAgainAfter
- ImageSearch, xResult, yResult, startx , starty , endx , endy , *30 %Img_wCoin%
- ErrCoin := ErrorLevel
- ;ToolTip, % "X: " startx ", Y: " starty "`nwCoin - " ErrCoin " | " xResult ". " yResult
- if (ErrorLevel = 0) {
- QuickGrab(xResult,yResult)
- }
- sleep, % searchAgainAfter
- ImageSearch, xResult, yResult, startx , starty , endx , endy , *30 %Img_Awesome%
- ErrAwesome := ErrorLevel
- ;ToolTip, % "X: " startx ", Y: " starty "`nAwesome - " ErrAwesome " | " xResult ". " yResult
- if (ErrorLevel = 0) {
- QuickGrab(xResult,yResult)
- }
- sleep, % searchAgainAfter
- Return
- ;Functions ========================================================
- SplashThis(xSplash=0,ySplash=0,String="") {
- If (SplashTextOn) {
- SplashTextOff
- SplashTextOn,xSplash,ySplash,, % String
- setTimer splashOff, 2000
- Return Off
- } Else {
- SplashTextOn,xSplash,ySplash,, % String
- setTimer splashOff, 2000
- Return Off
- }
- splashOff:
- setTimer splashOff, Off
- ; tooltip, You weren't supposed to see this ;Shows up if triggered, debugging
- SplashTextOff
- Return Off
- }
- QuickGrab(TheX,TheY) {
- BLockInput,MouseMove
- OffsetX := TheX + 15
- OffsetY := TheY + 15
- MouseMove, OffsetX , OffsetY, 15
- Sleep, %clickAfter%
- MouseClick
- BlockInput,MouseMoveOff
- }
- ;Control Keys ========================================================
- ESC::
- SplashThis(300,25,Terminating Script)
- sleep 1000
- ExitApp
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement