Code:
; __ __ .__ .___ _____
;/ \ / \___________| | __| _/ _____/ ____\
;\ \/\/ / _ \_ __ \ | / __ | / _ \ __\
; \ ( <_> ) | \/ |__/ /_/ | ( <_> ) |
; \__/\ / \____/|__| |____/\____ | \____/|__|
; \/ \/
; __ __ _____ __
;/ \ / \_____ _______ ________________ _/ ____\/ |_
;\ \/\/ /\__ \\_ __ \_/ ___\_ __ \__ \\ __\\ __\
; \ / / __ \| | \/\ \___| | \// __ \| | | |
; \__/\ / (____ /__| \___ >__| (____ /__| |__|
; \/ \/ \/ \/
;/###########################################################\
; Fishing Bot Created by: =Z= #
;************************************************************#
; #
;************* #
; Description #
;************* #
; This bot will fish using a user-specified search area as #
; well as a user-specified bobber color, this mean the macro #
; will ALWAYS detect the fish as it is not static. #
; #
;************* #
; Features #
;************* #
; • Adjustable fishing area #
; • User-selected colors, never static, always up to date! #
; • Uses randomized wait times as anti-detection method #
; • NO injection, this bot is as safe as botting can get! #
;\###########################################################/
;DO NOT TOUCH - ALTERING THESE WILL BREAK THE MACRO
#include <WINAPI.au3>
#Include <Misc.au3>
Global $wow = 'World of Warcraft'
Global $searchL, $searchT, $searchR, $searchB, $color
;FishKey - Change this to the key you use to fish
Global $FishKey = '1'
;MAIN MACRO
WinActivate("World of Warcraft") ; activate window
ToolTip("Opening WoW window...", 0, 0); displays tooltip in top left corner
WinWaitActive("World of Warcraft") ; wait untill the window is active
While 1
WinWaitActive("World of Warcraft")
ToolTip("Executing script...", 0, 0) ; displays tooltip in top left corner
Sleep (2000)
Prep()
Wend
;Prep functions - sets up macro
Func Prep()
ToolTip("Setting up coordinates, prepare for further instructions...", 0, 0) ; displays tooltip in top left corner
Sleep (2000)
;Prompts user to select the upper left of the search area
ToolTip('Click in the top left corner of the search area',0,0,"",2)
While 1
If WinActive("World of Warcraft") = 0 Then WinActivate("World of Warcraft") ; Make sure WoW stays active while user is selecting position
If _IsPressed("01") Then ExitLoop ; Exit loop when user left clicks
WEnd
$mouse = MouseGetPos()
$searchL = $mouse[0]
$searchT = $mouse[1]
Sleep(1000)
;Prompts user to select the lower right of the search area
ToolTip('Click in the bottom right corner of the search area',0,0,"",2)
While 1
If WinActive("World of Warcraft") = 0 Then WinActivate("World of Warcraft") ; Make sure Wow stays active while user is selecting position
If _IsPressed("01") Then ExitLoop ; Exit loop when user left clicks
WEnd
$mouse = MouseGetPos()
$searchR = $mouse[0]
$searchB = $mouse[1]
Sleep(3000)
Send($FishKey)
While 1
If WinActive("World of Warcraft") = 0 Then WinActivate("World of Warcraft") ; Make sure Wow stays active while user is selecting color
$mouse = MouseGetPos()
$color = PixelGetColor($mouse[0],$mouse[1])
ToolTip("Find the red part of the feather on the bobber and click it, if fishing timer runs out press your fishing key and try again.",0,0) ; displays tooltip in top left corner
If _IsPressed("01") Then ExitLoop; Exit loop when user left clicks
WEnd
;Msgbox(0,"Status", "Bobber color: "&$color) ;Debug, DONT TOUCH
ToolTip("Starting macro in 15 secs", 0, 0) ; displays tooltip in top left corner
Sleep (15000)
Cast()
EndFunc
;Cast Function
func Cast()
ToolTip("Casting...", 0, 0) ; displays tooltip in top left corner
Sleep(2000)
Send($FishKey)
ToolTip("Searching for bobber...", 0, 0) ; displays tooltip in top left corner
Sleep (3000)
Global $current = timerinit() ; Set a timeout for finding splash
$bobber = PixelSearch($searchL,$searchT,$searchR,$searchB, $color, 60) ; Look for user selected color
If @error = 1 Then
ToolTip("Could not locate bobber, recasting...", 0, 0) ; displays tooltip in top left corner
Sleep(Random(1175,2125))
Cast()
EndIf
If TimerDiff($current) > 10000 Then ;If the bobber is not seen in 10 sec. Then cast again
Cast()
EndIf
sleep (1000)
MouseMove($bobber[0], $bobber[1]) ; Move the mouse to the bobber
ToolTip("Found bobber, waiting for fish to be hooked...", 0, 0) ; displays tooltip in top left corner
Sleep (500)
while 1
Global $current = timerinit() ; Set a timeout for finding splash
$splash = PixelSearch($bobber[0]-10,$bobber[1]-10,$bobber[0]+10,$bobber[1]+10, $color, 15) ; Search a tiny 20x20 square for the bobber color
If @error = 1 Then ExitLoop ; When the color isn't found, the bobber has bobbed
Sleep(100)
if Round(timerdiff($current)/1000,0) >= 30 Then;If the splash is not seen in 30 sec. Then cast again
Cast()
EndIf
wend
;the bobber color has changed (a fish is hooked), loot bobber and repeat.
ToolTip("Splash detected, looting fish...", 0, 0) ; displays tooltip in top left corner
Sleep(Random(75,175))
MouseClick("Right", $bobber[0], $bobber[1], 1, 0) ; Even if the user moves the mouse, this instantly moves it to the bobber and right-clicks
Sleep(3000)
ToolTip("Recasting...", 0, 0) ; displays tooltip in top left corner
Sleep (2500)
Cast()
EndFunc
As always I hope everyone gets some use out of this bot, please post any features / additions / praise or criticism as I will do my best to respond in time.