Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #NoEnv ; Recommended for performance and compatibility with future AutoHotkey releases.
- #Warn ; Enable warnings to assist with detecting common errors.
- SendMode Input ; Recommended for new scripts due to its superior speed and reliability.
- SetWorkingDir %A_ScriptDir% ; Ensures a consistent starting directory.
- SetWorkingDir, %A_ScriptDir%
- CoordMode, Mouse, Screen
- CoordMode, Pixel, Screen
- Gui, 2: +AlwaysOnTop
- Gui, 2: Add, Button, x10 y10 w200 h20 gFind_Image, Find Image
- Gui, 2: Add, Button, x10 w200 h20 gGui_1, Load / Reload Image
- Gui, 2: Add, Text, x10, Press Numpad 1 to stop.
- Gui, 2: Show, x1000 y200
- return
- 2GuiClose:
- ExitApp
- Find_Image:
- Stop := 0
- While !Stop
- {
- ImageSearch, Loc_X, Loc_Y, 0, 0, A_ScreenWidth, A_ScreenHeight, attack1.png
- if(ErrorLevel = 2)
- {
- MsgBox, ErrorLevel = 2`nSomething is wrong.
- }
- /* Else if(ErrorLevel = 1)
- {
- MsgBox, Image not found.
- ;TrayTip,, Image Not Found., 2
- }
- */
- Else if(ErrorLevel = 0)
- {
- ;TrayTip,, ********`n We found the image`n********
- ;'MouseMove, Loc_X+(posw//2), Loc_Y+(posh//2)
- tx := Loc_X ;+(posw//2)
- ty := Loc_Y ;+(posh//2)
- click, %tx% %ty%
- }
- ImageSearch, Loc_X, Loc_Y, 0, 0, A_ScreenWidth, A_ScreenHeight, attack2.png
- if(ErrorLevel = 2)
- {
- MsgBox, ErrorLevel = 2`nSomething is wrong.
- }
- /* Else if(ErrorLevel = 1)
- {
- MsgBox, Image not found.
- ;TrayTip,, Image Not Found., 2
- }
- */
- Else if(ErrorLevel = 0)
- {
- ;TrayTip,, ********`n We found the image`n********
- ;'MouseMove, Loc_X+(posw//2), Loc_Y+(posh//2)
- tx := Loc_X ;+(posw//2)
- ty := Loc_Y ;+(posh//2)
- click, %tx% %ty%
- }
- ImageSearch, Loc_X, Loc_Y, 0, 0, A_ScreenWidth, A_ScreenHeight, next1.png
- if(ErrorLevel = 2)
- {
- MsgBox, ErrorLevel = 2`nSomething is wrong.
- }
- /* Else if(ErrorLevel = 1)
- {
- MsgBox, Image not found.
- ;TrayTip,, Image Not Found., 2
- }
- */
- Else if(ErrorLevel = 0)
- {
- ;TrayTip,, ********`n We found the image`n********
- ;'MouseMove, Loc_X+(posw//2), Loc_Y+(posh//2)
- tx := Loc_X ;+(posw//2)
- ty := Loc_Y ;+(posh//2)
- click, %tx% %ty%
- }
- ImageSearch, Loc_X, Loc_Y, 0, 0, A_ScreenWidth, A_ScreenHeight, next2.png
- if(ErrorLevel = 2)
- {
- MsgBox, ErrorLevel = 2`nSomething is wrong.
- }
- /* Else if(ErrorLevel = 1)
- {
- MsgBox, Image not found.
- ;TrayTip,, Image Not Found., 2
- }
- */
- Else if(ErrorLevel = 0)
- {
- ;TrayTip,, ********`n We found the image`n********
- ;'MouseMove, Loc_X+(posw//2), Loc_Y+(posh//2)
- tx := Loc_X ;+(posw//2)
- ty := Loc_Y ;+(posh//2)
- click, %tx% %ty%
- }
- ImageSearch, Loc_X, Loc_Y, 0, 0, A_ScreenWidth, A_ScreenHeight, 135.png
- if(ErrorLevel = 2)
- {
- MsgBox, ErrorLevel = 2`nSomething is wrong.
- }
- /* Else if(ErrorLevel = 1)
- {
- MsgBox, Image not found.
- ;TrayTip,, Image Not Found., 2
- }
- */
- Else if(ErrorLevel = 0)
- {
- Stop = 1
- }
- ImageSearch, Loc_X, Loc_Y, 0, 0, A_ScreenWidth, A_ScreenHeight, 150.png
- if(ErrorLevel = 2)
- {
- MsgBox, ErrorLevel = 2`nSomething is wrong.
- }
- /* Else if(ErrorLevel = 1)
- {
- MsgBox, Image not found.
- ;TrayTip,, Image Not Found., 2
- }
- */
- Else if(ErrorLevel = 0)
- {
- Stop = 1
- }
- ImageSearch, Loc_X, Loc_Y, 0, 0, A_ScreenWidth, A_ScreenHeight, tobattle1.png
- if(ErrorLevel = 2)
- {
- MsgBox, ErrorLevel = 2`nSomething is wrong.
- }
- Else if(ErrorLevel = 1)
- {
- ;MsgBox, Image not found.
- ;TrayTip,, Image Not Found., 2
- }
- Else if(ErrorLevel = 0)
- {
- ;TrayTip,, ********`n We found the image`n********
- ;'MouseMove, Loc_X+(posw//2), Loc_Y+(posh//2)
- tx := Loc_X ;+(posw//2)
- ty := Loc_Y ;+(posh//2)
- click, %tx% %ty%
- }
- ImageSearch, Loc_X, Loc_Y, 0, 0, A_ScreenWidth, A_ScreenHeight, tobattle2.png
- if(ErrorLevel = 2)
- {
- MsgBox, ErrorLevel = 2`nSomething is wrong.
- }
- /* Else if(ErrorLevel = 1)
- {
- MsgBox, Image not found.
- ;TrayTip,, Image Not Found., 2
- }
- */
- Else if(ErrorLevel = 0)
- {
- ;TrayTip,, ********`n We found the image`n********
- ;'MouseMove, Loc_X+(posw//2), Loc_Y+(posh//2)
- tx := Loc_X ;+(posw//2)
- ty := Loc_Y ;+(posh//2)
- click, %tx% %ty%
- }
- ImageSearch, Loc_X, Loc_Y, 0, 0, A_ScreenWidth, A_ScreenHeight, fightaswar1.png
- if(ErrorLevel = 2)
- {
- MsgBox, ErrorLevel = 2`nSomething is wrong.
- }
- /* Else if(ErrorLevel = 1)
- {
- MsgBox, Image not found.
- ;TrayTip,, Image Not Found., 2
- }
- */
- Else if(ErrorLevel = 0)
- {
- ;TrayTip,, ********`n We found the image`n********
- ;'MouseMove, Loc_X+(posw//2), Loc_Y+(posh//2)
- tx := Loc_X ;+(posw//2)
- ty := Loc_Y ;+(posh//2)
- click, %tx% %ty%
- }
- ImageSearch, Loc_X, Loc_Y, 0, 0, A_ScreenWidth, A_ScreenHeight, fightaswar2.png
- if(ErrorLevel = 2)
- {
- MsgBox, ErrorLevel = 2`nSomething is wrong.
- }
- /* Else if(ErrorLevel = 1)
- {
- MsgBox, Image not found.
- ;TrayTip,, Image Not Found., 2
- }
- */
- Else if(ErrorLevel = 0)
- {
- ;TrayTip,, ********`n We found the image`n********
- ;'MouseMove, Loc_X+(posw//2), Loc_Y+(posh//2)
- tx := Loc_X ;+(posw//2)
- ty := Loc_Y ;+(posh//2)
- click, %tx% %ty%
- }
- ImageSearch, Loc_X, Loc_Y, 0, 0, A_ScreenWidth, A_ScreenHeight, endless1.png
- if(ErrorLevel = 2)
- {
- MsgBox, ErrorLevel = 2`nSomething is wrong.
- }
- /* Else if(ErrorLevel = 1)
- {
- MsgBox, Image not found.
- ;TrayTip,, Image Not Found., 2
- }
- */
- Else if(ErrorLevel = 0)
- {
- ;TrayTip,, ********`n We found the image`n********
- ;'MouseMove, Loc_X+(posw//2), Loc_Y+(posh//2)
- tx := Loc_X ;+(posw//2)
- ty := Loc_Y ;+(posh//2)
- click, %tx% %ty%
- }
- ImageSearch, Loc_X, Loc_Y, 0, 0, A_ScreenWidth, A_ScreenHeight, endless2.png
- if(ErrorLevel = 2)
- {
- MsgBox, ErrorLevel = 2`nSomething is wrong.
- }
- /* Else if(ErrorLevel = 1)
- {
- MsgBox, Image not found.
- ;TrayTip,, Image Not Found., 2
- }
- */
- Else if(ErrorLevel = 0)
- {
- ;TrayTip,, ********`n We found the image`n********
- ;'MouseMove, Loc_X+(posw//2), Loc_Y+(posh//2)
- tx := Loc_X ;+(posw//2)
- ty := Loc_Y ;+(posh//2)
- click, %tx% %ty%
- }
- }
- return
- GuiContextMenu:
- Gui, 1: Destroy
- return
- Move_Window:
- Random, new_x, 0, A_ScreenWidth -posw
- Random, new_y, 0, A_ScreenHeight -posh
- Gui, 1: Show, x%new_x%, y%new_y%
- return
- Gui_1()
- {
- global
- Gui, 1: Destroy
- Gui, 1: Margin,0,0
- Gui, 1: +AlwaysOnTop -Caption +Owner2
- Gui, 1: Add, Picture, x0 y0 vClip_Picture gMove_Window, capture.png
- GuiControlGet, Pos, 1: Pos, Clip_Picture
- Gui, 1: Show, AutoSize
- }
- Numpad1::
- Stop := 1
- return
- *ESC::ExitApp
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement