Code:
; AutoIt Version: 3.0
; Name: Xfish
; Language: English
; Platform: WinXP
; Author: xeonz16
;
; Script Function:
; WoW Xfish
; Some hints and tips...Deviate fish and Oily Blackmouth are really the only kind that sell
;in my experience...I'm only 150 fishing though. If you leave bot on all night, it will fill your
;inventory up with 2-3 stacks of 'rare' fish and zillions of stacks of common crappy ones that
;you either destroy or sell for 20c a stack. I've found if you SPIKE your inventory before
;turning the bot on you can catch a way more rare fish. However, this will take longer.
;I've guessed the bot fills up a medium-low sized inventory in about 3-4 hours. For me,
;I have to go to work for periods of about 12 hours anyway, so I spike my inventory, by
;taking a stack of 20 oily blackmouth and splitting them into 20 stacks of 1. After 12 hours
;when I get home I've got 20 stacks of oily blackmouth instead of 2-3 stacks and 20 stacks of
;cheapo fish. You can catch oily blackmouth in the water near ratchet, and deviate fish
; + deviate scales I think in the oasis's scattered around the barrens. If you are gonna
;fish the oasis you need to pick a spot VERY carefully so the wandering centaurs don't
;kill you. When you catch these, you need to sell them to PLAYERS, namely alchemists...they won't
;get you crap from merchants.
;COMMON TROUBLESHOOTING--
;for troubleshooting the first thing you should do is set $splash to 1
; remember to turn it back to zero after you have the bot working...as leaving it on
;will limit the bot's lifespan to about 3-4 hours.
;this allows you to see which stage of the script the bot is in then
;if the mouse moves to a wrong location, then lower $colorvariance
;if the mouse doesn't move and the bot gets hung up on 'searching for feather' raise $colorvariance
;if the mouse moves to the feather, and then the bot says 'FISH!' without a splash, lower $splashvariance
; the bobber splashes and the bot does not do anything, raise $splashvariance
;move the variances in increments of 5 for best result...
;SLIGHTLY MORE ADVANCED TROUBLESHOOTING--
;for trouble FINDING THE BOBBER--
;notice there are several definitions of $feather commented out
;comment out the current one and use another, and then retry adjusting variances
;for trouble WITH SPLASHES--
;there are two pixelsearchs for splash, one uses $day and nother uses $night, you can
;remark one or the other out depending. You can also adjust the $s_offset. This determines
;how many pixels in each direction from the feather the bot 'searches' for the splash.
;if you tighten this down you will have less missfires.
;if you are getting lots of 'moonglare' you might have to move to another side of the lake
;too much moonglare will cause missfires, changing your location might be the only solution.
hotkeyset("{ESC}", "Term")
;these are the colorcodes obtained by pantless crab for different splashes
; Colour of splash -
; 0xA2A67D
; 0xC1AD7A
; 0xD0C08D
;this is the box definitions that decide how large of an area to scan for the feather
$left = 75
$top = 200
$right = 748
$bottom = 421
;these are various variables for the operation of fish bot
$day = 0xF6F6F6;splash color day
$night = 0xEEEEEE;splash color night
;$feather = 0x31314E;day --blue feather
;$feather = 0x1A130F;night --dark dark red
;$feather = 0x501C0D;day --bright red
$feather = 0xC54819;night --bright red
$colourVariance =15;range of accepted values differing from original code for feather
$splashVariance =34;range of accepted values differing from original code for splash
$step =2;1 = search every pixel, 2 = search every other pixel...etc don't put higher then like 5
$s_offset =25;search offset, basically how large an area to search around the feather for splash
$splash =0;set this to 1 to view GUI messages, so you can tell where the bot gets hung up
;but turn it to zero once the bot is working, and the bot will 'last' for DAYS
;as compared to maybe 4-5 hours with GUI on.
$width = 100; width of GUI box
$height = 60; Height of GUI box--note these two are changed periodically through the script
dim $feather_cord, $time, $sp;various definitions
while 1;main loop
sleep(1000)
WinActivate("World of Warcraft")
send("0")
sleep(4000)
$start2 = Timerinit();start timer
;this loop searches for feather
while 1
$dif = TimerDiff($start2)
if $dif > 35000 then;if timer > then 35 seconds then restart bot IE can't find feather
exitloop
endif
sleep(1000)
$message = "Searching for feather..."
$height = 60
update_splash()
;find where the feather is located
$feather_cord = PixelSearch ($left, $top, $right, $bottom, $feather, $colourVariance, $step)
if NOT @error = 1 then
seterror(2);resets @error macro so it doesn't fire next loop
$message = "Found Something."
update_splash()
;setting arrayed cords to variables to allow easier manipulation
$featherx = $feather_cord[0]
$feathery = $feather_cord[1]
mousemove($featherx, $feathery);move mouse to feather
exitloop
endif
WEnd
$start = Timerinit()
;this loop waits for the splash once feather is found
While 1
sleep(400)
$message = "Waiting for bite..."
$height = 100
update_splash()
;calc area of probable splash
$s_left = ($featherx - $s_offset)
$s_top = ($feathery - $s_offset)
$s_right = ($featherx + $s_offset)
$s_bottom = ($feathery + $s_offset)
;these switch between day and night splash...I've been just commenting one of them out
$sp = Pixelsearch($s_left, $s_top, $s_right, $s_bottom, $day, $splashvariance)
;$sp = Pixelsearch($s_left, $s_top, $s_right, $s_bottom, $night, $splashvariance)
$dif = TimerDiff($start)
if $dif > 35000 then;resets bot if no bite within 35 seconds
exitloop
endif
if ubound($sp) > 1 then;if $sp returns cords then shift + rightclick, discards $sp cords
seterror(2)
$message = "Fish!"
$height = 60
update_splash()
send("{shiftdown}")
sleep(100)
mouseclick("right", $featherx, $feathery, 1, 1)
sleep(300)
send("{shiftup}")
exitloop
endif
WEnd
WEnd
;this func just updates splash message if the variable $splash is set to '1' in the beginning
func update_splash ()
if $splash = 1 then
SplashTextOn( "", $message , $width , $height ,1 ,1 , 17)
endif
endfunc
func Term ()
exit
endfunc