Code:
; ----------------------------------------------------------------------------
;
; AutoIt Version: 3.1.0
; Script Version: 1.1.2
; Author: Xythe <[email protected]>
;
; Script Function:
; Fishing in wow;)
; ----------------------------------------------------------------------------
#include <GUIConstants.au3>
Global $Fishing
Global $FishingState
Global $Step
Global $SettingsBobberPart
Global $SettingsBobberType
Global $ColorToFind
Global $LineCasted
Global $Looted
Global $SplashCoords
HotKeySet ("{ESC}", "Terminate")
Func Terminate()
$Fishing = 0
EndFunc
$WinTitle = Random(10,100)
GUICreate($WinTitle, 200, 100) ; will create a dialog box that when displayed is centered
$tab=GUICtrlCreateTab (0,0, 200,100)
$Main=GUICtrlCreateTabitem ("Main")
GUICtrlCreateLabel ("Status:", 5,27,50,20)
$MainStart=GUICtrlCreateButton ("Start Fishing", 5,75,90,20)
$MainStop=GUICtrlCreateButton ("Stop Fishing", 100,75,90,20)
$MainStatus=GUICtrlCreateLabel ("Idle", 55,27,170,20)
$Settings=GUICtrlCreateTabitem ( "Settings")
GUICtrlCreateLabel ("Bobber Type:", 5,27,75,20)
GUICtrlCreateLabel ("Bobber Part:", 5,50,75,20)
GUICtrlCreateLabel ("Keybinding:", 5,73,75,20)
$BobberType=GUICtrlCreateCombo ("Day", 80,25,115,20)
GUICtrlSetData(-1,"Night|Very dark")
$BobberPart=GUICtrlCreateCombo ("Red Feather", 80,47,115,20)
GUICtrlSetData(-1,"Blue Feather|Metal Part")
$SettingsBobberBound = GUICtrlCreateInput ("1", 80,73,115,20)
$Help=GUICtrlCreateTabitem ("Help")
GUICtrlCreateLabel ("The author of this bot does not take any responsibility of its usage. Use -> Caught -> Ban -> Your problem.", 5,27,190,40)
GUICtrlCreateLabel ("Please report bugs to [email protected]", 5,65,170,40)
$HelpHowTo=GUICtrlCreateButton ("?", 175,75,20,20)
GUICtrlCreateTabitem ("")
GUISetState ()
; Run the GUI until the dialog is closed
While 1
$msg = GUIGetMsg()
Select
Case $msg = $HelpHowTo
MsgBox (0, "How to use?", "1. Disable all shader effects")
MsgBox (0, "How to use?", "2. Go to 1024 x 768 Windowed mode")
MsgBox (0, "How to use?", "3. Find a place to fish")
MsgBox (0, "How to use?", "4. Aim away from sun or moon")
MsgBox (0, "How to use?", "5. Adjust bot's settings accordingly")
MsgBox (0, "How to use?", "5. Press 'Start Fishing' from the bot")
MsgBox (0, "How to use?", "6. Gain rapid skill and lots of money")
MsgBox (0, "How to use?", "7. Esc stops the bot.")
Case $msg = $MainStart
GUICtrlSetData ( $MainStatus, "Casting Line" )
$Fishing = 1
Case $msg = $MainStop
GUICtrlSetData ( $MainStatus, "Idle" )
$Fishing = 0
EndSelect
If $msg = $GUI_EVENT_CLOSE Then ExitLoop
;---------------
If $Fishing = 1 Then
If Not WinExists("World of Warcraft") Then
MsgBox(0, "ERROR", "Open World of Warcraft first.")
ExitLoop
EndIf
;Cast line
Send (GUICtrlRead ( $SettingsBobberBound ))
$LineCasted = 1
$Looted = 0
GetColorToFind()
$Timer = TimerInit()
Do
;Check Bobber -> Cant find -> Find bobber (quick) -> Cant find -> Find bobber (slow)
CheckBobber()
;check for splash -> loot
CheckSplash()
$TimerDif = TimerDiff($Timer)
If $TimerDif >= 25000 + Random(0,1000) Then
$LineCasted = 0
EndIf
Until $LineCasted = 0
EndIf
WEnd
Func GetColorToFind()
Select
Case GUICtrlRead ( $BobberPart ) = "Red Feather"
If GUICtrlRead ( $BobberType ) = "Day" Then $ColorToFind = 0xB83113
If GUICtrlRead ( $BobberType ) = "Night" Then $ColorToFind = 0x782512
If GUICtrlRead ( $BobberType ) = "Very dark" Then $ColorToFind = 0x481A10
Case GUICtrlRead ( $BobberPart ) = "Blue Feather"
If GUICtrlRead ( $BobberType ) = "Day" Then $ColorToFind = 0x726170
If GUICtrlRead ( $BobberType ) = "Night" Then $ColorToFind = 0x4A3D4D
If GUICtrlRead ( $BobberType ) = "Very dark" Then $ColorToFind = 0x382938
Case GUICtrlRead ( $BobberPart ) = "Metal Part"
If GUICtrlRead ( $BobberType ) = "Day" Then $ColorToFind = 0xD8CFD3
If GUICtrlRead ( $BobberType ) = "Night" Then $ColorToFind = 0x7A7577
If GUICtrlRead ( $BobberType ) = "Very dark" Then $ColorToFind = 0x5A5557
EndSelect
EndFunc
Func CheckBobber()
GUICtrlSetData ( $MainStatus, "Checking Bobber" )
$Position = MouseGetPos ()
$Top = $Position[1] - 10
$Left = $Position[0] - 10
$Bottom = $Position[1] + 10
$Right = $Position[0] + 10
$BobberCoords = PixelSearch ( $Left, $Top, $Right, $Bottom, 0xB83113 , 10 , 1 )
If @error Then
FindBobber(4)
EndIf
EndFunc
Func FindBobber($Step)
GUICtrlSetData ( $MainStatus, "Finding Bobber" )
$Position = WinGetPos ( "World of Warcraft")
;0x6C1A10
$Top = $Position[1] + 200
$Left = $Position[0] + 300
$Bottom = $Position[1] + $Position[3] - 200
$Right = $Position[0] + $Position[2] - 300
$BobberCoords = PixelSearch ( $Left, $Top, $Right, $Bottom, $ColorToFind , 30 , $Step )
If @error Then
FindBobber(2)
Else
MouseMove ( $BobberCoords[0], $BobberCoords[1] )
EndIf
EndFunc
Func CheckSplash()
GUICtrlSetData ( $MainStatus, "Waiting for Splash" )
$Position = MouseGetPos()
$Left = $Position[0] - 40
$Top = $Position[1] - 30
$Right = $Position[0]
$Bottom = $Position[1] + 10
$SplashCoords = PixelSearch ( $Left, $Top, $Right, $Bottom, 0xFFFFFF, 35, 2 )
If Not @error Then
If Not $Looted Then
GUICtrlSetData ( $MainStatus, "Looting" )
Send("{SHIFTDOWN}")
MouseClick ( "right" )
Sleep(Random(0,200))
Send("{SHIFTUP}")
$LineCasted = 0
$Looted = 1
EndIf
EndIf
EndFunc