Jump to content

Autoit Wow Fishing Script


Paranoia
 Share

Recommended Posts

My first real script(almost), I get an error before I start it and I'm wondering if people would help me fix it.

I know this is not genral support, but I think its only a little glitch so I'll post the finished product in this same thread, or just edit it.

USE AT YOUR OWN RISK

It's a WoW fishing bot.

Edit: No more errors, but still doesnt quite work

-----------------------------------------------------------------------------------------------------------------------------

;WorldOfWarcraft Fisher

;Declarations
Global $BobberAppearTime
Global $bobberAppearTime
Global $BobberColor
Global $BobberColorVariation
Global $BobberPos
Global $Bottom
Global $Box
Global $CastingKey
Global $CatchClickDown
Global $CatchClickDownVariation
Global $Constant
Global $Exit
Global $i
Global $Left
Global $MouseSpeed
Global $Right
Global $SearchWait
Global $Splash
Global $SplashColor
Global $SplashColorVariation
Global $Start
Global $Stop
Global $Top
Global $VCatchClickDown
Global $VWaitBeforeCast
Global $Wait
Global $WaitBeforeCast
Global $WaitBeforeCastVariation
Global $WaitForMouse
Global $WindowTitle
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
; It is recomended that you turn down all graphics before starting script;
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
$WindowTitle = "World Of Warcraft"

$CastingKey = "{1}"

;Hot Keys
$Start = "{pgup}" ;Key you hit to start the bot
$Stop = "{pgdn}" ;Key you hit to stop the bot
$Exit = "{esc}" ;Key you hit to Exit the bot

;Color & Variations
$BobberColor = 0x21274E
$BobberColorVariation = 10
$SplashColor = 0xB8C2D4
$SplashColorVariation = 10

;Waits
$Wait = 30 ; in seconds
$WaitBeforeCast = 5000 ;In Miliseconds
$WaitBeforeCastVariation = 1000
$bobberAppearTime = 5000 ;Time it takes for the bobber to appear in miliseconds
$CatchClickDown = 200 ;In Miliseconds
$CatchClickDownVariation = 80
$SearchWait = 50
$MouseSpeed = 1
$WaitForMouse = 100
;Searching Area
    ;Bobber
    $Top = 180
    $Bottom = 540
    $Right = 1159
    $Left = 10
    ;Box Size around bobber for searching for splash
    $Box = 200 ;Far left to far right, top to bottom, measuring from feather

;;;;;;;;;;;;;;;;;;;;Recalculations & Reformating;;;;;;;;;;;;;;;;;;
;Recalc
$Wait = ($Wait * 1000)
$Box = ($Box / 2)
;;;;;;;;;;;;;;;;;;;;End Of Recalculations;;;;;;;;;;;;;;;;;;;;;;;;;

;;;;;;;;;;;;;;;;;;;;Hot Keys;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
HotKeySet( $Start , "FishStart")
HotKeySet( $Stop , "FishStop")
HotKeySet( $Exit , "FishExit")
;;;;;;;;;;;;;;;;;;;;End Of Hot Keys;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;

;;;;;;;;;;;;;;;;;;;;Main;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
$Constant = 0
While 1
    If $Constant = 1 Then
        Call("Fish")
    EndIf
WEnd
;;;;;;;;;;;;;;;;;;;;End Of Main;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;

;;;;;;;;;;;;;;;;;;;;Functions;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
Func Fish()
$Constant = 1
While $Constant = 1
WinWaitActive( $WindowTitle )
$VWaitBeforeCast = $WaitBeforeCast + Random(-1 * $WaitBeforeCastVariation, $WaitBeforeCastVariation)
Sleep($VWaitBeforeCast)
Send( $CastingKey )
Sleep($BobberAppearTime)
$BobberPos = PixelSearch( $Left, $Top, $Right, $Bottom, $BobberColor, $BobberColorVariation)
$i = 0
If @error Then
    While @error & $i < $Wait
        $BobberPos = PixelSearch( $Left, $Top, $Right, $Bottom, $BobberColor, $BobberColorVariation)
        Sleep($SearchWait)
        $i = $i + $SearchWait
    WEnd
EndIf
$Splash = PixelSearch( $BobberPos[0] - $Box, $BobberPos[1] + $Box, $BobberPos[0] + $Box, $BobberPos[1] - $Box, $SplashColor, $SplashColorVariation)
While @error & $i < $Wait
    $Splash = PixelSearch( $BobberPos[0] - $Box, $BobberPos[1] + $Box, $BobberPos[0] + $Box, $BobberPos[1] - $Box, $SplashColor, $SplashColorVariation)
    Sleep($SearchWait)
    $i = $i + $SearchWait
WEnd
If Not @error Then
    Call( "Catch")
EndIf
WEnd
EndFunc


Func Catch()
MouseMove($BobberPos[0] , $BobberPos[1], $MouseSpeed)
Sleep($WaitForMouse)
Send("{SHIFTDOWN}")
MouseDown("right")
$VCatchClickDown = $CatchClickDown + Random( -1 * $CatchClickDownVariation, $CatchClickDownVariation)
Sleep($VCatchClickDown)
MouseUp("right")
Send("{SHIFTUP}")
EndFunc

Func FishStart()
    $Constant = 1
EndFunc

Func FishStop()
    $Constant = 0
EndFunc

Func FishExit()
    Exit
EndFunc

;;;;;;;;;;;;;;;;;;;;End Of Functions;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
Edited by Paranoia
Link to comment
Share on other sites

  • 3 months later...

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
 Share

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...