Jump to content

Sky Slate Blueberry Blackcurrant Watermelon Strawberry Orange Banana Apple Emerald Chocolate

A little fishing script....


  • Please log in to reply
66 replies to this topic
The Alien
  • Guests
  • Last active:
  • Joined: --
Well here is my updated script, it keeps the color picker showing and has a menu to save/load/test color, reload the script, and exit...

You'll need to comment out the 4 images if you don't use them... but saving colors has been a treat. When I go to other places I just test out colors I already have saved before trying to select a new one. So far I've only had to save 3 different colors, 1 reddish 2 blues

; World of Warcraft Simple Fishing Script
; By: The Alien
; Out of 100 Casts, 6 were lost, and 2 clicked premature.
; Modified script originally by Mike the Fishmonger http://www.autohotkey.com/forum/topic81808.html
; v1.1
; Instructions:
; When you first start the script there will be a box in the top center of your screen with a white background.
; This is your base color window. Your fishing rod, if it is hotkeyed to #1, will be cast out.
; Place your cursor over the bobber with the hook close to the red feather.
; Press and hold Ctrl+Alt+Z, the box in the top will show you the color you've captured. Most likely it will be wrong.
; Move around the red arrow while holding Ctrl+Alt+Z until you decide on a color to test
; If your bobber disappears, just recast it out. Once you think you have a good color,
; press Ctrl+Alt+X to test or in the Options menu choose to test the color.
; If the mouse moves to anywhere except to near the bobber, then repeat the process.
; Once you find a working color, go to the options menu and choose to start fishing.
; You should be able to sit back and let it do its dirty work.
; In some instances the color may need to be changed, like for when it is more daylight, or if it is darker.
; Or maybe you move to a different location and the scenery is a little different. In any case, if you need to rechoose
; your color, you can do so just by using Ctrl+Alt+Z. If you're done fishing for the time being, select exit in the drop down.
; Notes: I have only tested this script in one location that the time of this writing. Commented out
; lines that will load images if you don't want to use them or don't have the images.
; if you put the images in the same folder of this script. The 4 dot.GIF lines will show
; you the 4 corners of the scan box.
; You can save colors by selecting the Save Color option in the menu, and reload the script.

#NoEnv  ; Recommended for performance and compatibility with future AutoHotkey releases.

SetWorkingDir %A_ScriptDir%

;Get window position of WoW
WinGetPos, wowX, wowY, wowW, wowH, World of Warcraft

;Create the color box
Gui, 2:Show, xCenter y0 w200 h100, ColorWin
Gui, 2:Color, 0xFFFFFF
Gui 2:+AlwaysOnTop

;Menu, LoadMenu, Add, Default, loadcolor
Loop, read, %A_ScriptDir%\mycolors.INI
{
	if A_Index > 1
	{
		Menu, LoadMenu, Add, %A_LoopReadLine%, loadcolor
	}
}


Menu, SubMenu, Add, Load Color, :LoadMenu
Menu, SubMenu, Add, Start Fishing, start
Menu, SubMenu, Add, Test Color, ^!x
Menu, SubMenu, Add, Save Color, save
Menu, SubMenu, Add, Reload Script, F9
Menu, SubMenu, Add, Exit, exit
Menu, MyMenu, Add, Options, :SubMenu


Gui, 2:Menu, MyMenu

;Create the scan box
Gui, Show, xCenter y200 w900 h300, FishWin

; Set the scan box to the same size and position of your WoW window
WinMove, FishWin,, 0, 0, wowW, wowH

; Get new position of scan window
WinGetPos, fishX, fishY, fishW, fishH, FishWin

;Attempt to automatically size the scan area based on your window size
TopLx := fishX + (fishW/4)
TopLy := fishY + (fishH/4)
TopRx := fishW - (fishW/4)
TopRy := fishY + (fishH/4)
BotLx := fishX + (fishW/4)
BotLy := fishH - (fishH/2.5)
BotRx := fishW - (fishW/4)
BotRy := fishH - (fishH/2.5)

; Uncomment the following 4 lines if you want to show graphics at the corners of your scan box. You will need an image
; dot.GIF in the same folder at this script. The image sizes I used were 15x15 pure green dots.
Gui, Add, Picture, x%TopLx% y%TopLy% w15 h-1, %A_ScriptDir%\dot.GIF
Gui, Add, Picture, x%TopRx% y%TopRy% w15 h-1, %A_ScriptDir%\dot.GIF
Gui, Add, Picture, x%BotLx% y%BotLy% w15 h-1, %A_ScriptDir%\dot.GIF
Gui, Add, Picture, x%BotRx% y%BotRy% w15 h-1, %A_ScriptDir%\dot.GIF

; Creates the scan area and makes the window transparent, only needed if you use the graphic corners
Gui, Color, White
Gui, Show, NA, FishWin
Gui +AlwaysOnTop
WinSet, TransColor, White, FishWin
Gui -Caption +ToolWindow

SetKeyDelay, 60

WinActivate, World of Warcraft

thecolor = 0xFFFFFF

Sleep, 1500
send, 1

Options:
return

save:
InputBox, UserInput, Save Color?, If you would like to save this color, type a name for it below.
if UserInput
{
	IniWrite, %thecolor%, %A_ScriptDir%\mycolors.ini, Saved Colors, %UserInput%
}
return

loadcolor:
Loop, parse, A_ThisMenuItem, =,
	if A_Index > 1
	{
	thecolor = %A_LoopField%
	}
	Gui, 2:Color,%thecolor%
return

; Hotkey for the Ctrl+Alt+Z
^!z::
MouseGetPos, MouseX, MouseY
PixelGetColor, color, %MouseX%, %MouseY%
thecolor = %color%
Gui, 2:Color, %thecolor%
return

; Hotkey for the Ctrl+Alt+X
^!x::
WinActivate, World of Warcraft
PixelSearch, Px, Py, %TopLx%, %TopLy%, %BotRx%, %BotRy%, %thecolor%, 60, fast
Mousemove, %Px%,%Py%,50
return

; Hotkey to reload and restart script
F9::
Reload
Sleep 4000 ; If successful, the reload will close this instance during the Sleep, so the line below will never be reached.
MsgBox, 4,, The script could not be reloaded. Would you like to open it for editing?
IfMsgBox, Yes, Edit
return

; Command to close the script and windows
exit:
Gui, Destroy
Gui, 2:Destroy
ExitApp
return

; Uses help item for the fishing hat, needs some reworking to auto reuse it after 10 minutes, but it's 6Am and am tired lol
start:
sleep, 100

SetTimer, dohat, 600000

; starts fishing
gosub next
return

; activates the WoW window, casts your fishing rod [send, 1] and goes to the fishing subroutine
next:
WinActivate, World of Warcraft
send, 1
sleep, 2000
gosub fish
return

; the fishing subroutine that finds the bobber, checks the bobber pixel location, determines to retrieve bobber
fish:
sleep, 500
PixelSearch, Px, Py, %TopLx%, %TopLy%, %BotRx%, %BotRy%, %thecolor%, 60, fast
Mousemove, %Px%,%Py%,50
sleep, 3000
loop, 50 {
	PixelSearch, PxC, PyC, %TopLx%, %TopLy%, %BotRx%, %BotRy%, %thecolor%, 60, fast
	if ErrorLevel = 0
	{
		A := PyC - Py
;		MsgBox, %A%
		if A > 5
		{
			mouseclick, right
			break
		}
		else if A < -5
		{
			mouseclick, right
			break
		}
		else
		{
			sleep, 200
		}
	}
}
; just in case we missed a catch, might as well try right before we recast
mouseclick, right
sleep, 2000

; calls next routine to start a new cast
gosub next

return

dohat:
send, {enter}
sleep, 500
send , /use 1
send {enter}
return


The Alien
  • Guests
  • Last active:
  • Joined: --
Oh, and I also added a timer that readds the hat buff.

guest666
  • Guests
  • Last active:
  • Joined: --
how do i use this?

guest666
  • Guests
  • Last active:
  • Joined: --
with python? sry im new to this

Mike the Fishmonger
  • Guests
  • Last active:
  • Joined: --
Wow... I had a nice detailed report typed in when I accidently closed Firefox.... :( I'll attempt to remember everything I typed but I'll keep this brief.

Alien - I really like your work! Nice additions with the GUI interface and the bobber color detection, along with being able to 'calibrate' the script without having to manually change the code within. I learned a couple valuable things from your programming, along with functions that Doctor Who had previously mentioned.

I had this running while I was at work with good success.
Algaefin Rockfish: 61
Murglesnout: 207
Deepsea Sagefish: 138

When I came home the AHK window has reported it forced a close. Not sure why.

A couple of suggestions..
1: Add an 'alive' subroutine that uses a similar style color picker to the bobber to verify if your character is alive or not. I realized that If I had got ganked today while at work, I would have spawned at the GY and just stood there because my toon would have just tried to keep fishing. That might raise the suspicions of other players / GM's for potential botting.

2. Add an opening window that asks how many casts you would like to perform, maybe for people who want to fish for an hour then have the toon logoff to prevent fishing for an indefinite amount of time.


I'd mod your code with these suggestions but honestly I feel you would be implement them in a more streamlined manner... plus, I wouldn't feel comfortable meddling with your code since your obviously a more experiences programmer than myself.
I will however take some of your work and try to meld it with mine.
:D

As always, happy fishing!!
-Mike the Fishmonger

NewGuest
  • Guests
  • Last active:
  • Joined: --

Wow... I had a nice detailed report typed in when I accidently closed Firefox.... :( I'll attempt to remember everything I typed but I'll keep this brief.

Alien - I really like your work! Nice additions with the GUI interface and the bobber color detection, along with being able to 'calibrate' the script without having to manually change the code within. I learned a couple valuable things from your programming, along with functions that Doctor Who had previously mentioned.

I had this running while I was at work with good success.
Algaefin Rockfish: 61
Murglesnout: 207
Deepsea Sagefish: 138

When I came home the AHK window has reported it forced a close. Not sure why.

A couple of suggestions..
1: Add an 'alive' subroutine that uses a similar style color picker to the bobber to verify if your character is alive or not. I realized that If I had got ganked today while at work, I would have spawned at the GY and just stood there because my toon would have just tried to keep fishing. That might raise the suspicions of other players / GM's for potential botting.

2. Add an opening window that asks how many casts you would like to perform, maybe for people who want to fish for an hour then have the toon logoff to prevent fishing for an indefinite amount of time.


I'd mod your code with these suggestions but honestly I feel you would be implement them in a more streamlined manner... plus, I wouldn't feel comfortable meddling with your code since your obviously a more experiences programmer than myself.
I will however take some of your work and try to meld it with mine.
:D

As always, happy fishing!!
-Mike the Fishmonger


I have not been able to duplicate any of the code with any success - can you define what your monitor and WoW graphics settings are?

NewGuest
  • Guests
  • Last active:
  • Joined: --
Menu, SubMenu, Add, Load Color, :LoadMenu

I receive an error msg with this code, can you provide updated version?
Line 48 submenu does not exist

NewGuest
  • Guests
  • Last active:
  • Joined: --

Menu, SubMenu, Add, Load Color, :LoadMenu

I receive an error msg with this code, can you provide updated version?
Line 48 submenu does not exist


Screenshot of error:
http://screencast.com/t/rjx0UyJ5eei

Doctor_Who
  • Guests
  • Last active:
  • Joined: --
@The Alien Didnt tryed your v1.1 script since i am pretty ok with v1.0 eddited by me. I have been partialy watching fishing it for about 3 hours in hyjal when i was reading a book and as far as i know it never missed the bobber and never missed splash like before which is amazing. :)
Also i have added that pause line which i was missing so much. :D And partially done whisper check/play sound on whisper dettect. Just have to add some simple gui for it. I did that color saving function buch much simplified than you (only saves and load the last used color) but its all i need for now from that function.
Anyway it starts to look as pretty sophisticated bot. :lol:

In a near future i will try to add that minimap detection based on imagesearch and this: http://www.autohotke...topic18146.html as source image capture. I think that this will be very nice addition because people can gank you/deathgrip you away from water and/or GM can teleport you away from water to the testing area because of suspision for botting.

Mike the Fishmonger
  • Guests
  • Last active:
  • Joined: --
Hey all.
So I did a little tweaking and melded a little bit of Doctor Who's and The Aliens code with mine. I woke up this morning to some positive results.
Items Caught Caught:
Murglesnout: 460
Algaefin Rockfish: 135
Deepsea Sagefish: 260
Volatile Water: 19
Azsharas Veil: 9

I woke up with no available bag spots [yea!] and I was logged out and dead [yea!].
Why am I excited about the second part? Well, I was ganked while fishing [the pile of bones where I was standing is proof] and my code logged me out when it realized I was dead.

So now I'm off to empty my bags and start over fresh this morning. Wish me luck!
-Mike the Fishmonger

The Alien
  • Guests
  • Last active:
  • Joined: --
@NewGuest: It is probably because the load color menu is generated by an ini file, and you don't have the ini file with any saved colors in it yet. An oversight of mine.

@Dr Who: Sounds like you're doing great with it. I am a PHP programmer and this is my first time tackling AHK, I know there are a few things it can still use improvement on, especially the bug above. If you're having that good of a splash detection, I wish I could get your code to work for me. Not sure why it isn't. Instead of a minimap check, I thought of maybe adding a check for the line on the screen that tells you that your bobber didn't land in fishable water or whatever it says. But since I use a different UI, not sure if the message would be the same or the same color for everyone.

@Guest666: You have to download and install the AHK program, then you take code and paste it into a text editor and save it as any file name with an extension of .ahk then you can just double click that ahk file and it will launch.

@Mike: You also seem to be having great success, I am glad I could help out. But still I give you all the credit for getting me thinking and getting me started on it and providing the base code. I didn't add an alive check because I never leave it running without me being there, I just hate clicking the buttons so much. Kinda the whole risk of getting banned thing and having too much to lose (Especially being the GM of over 500 members) lol. But since I really enjoy scripting, I will probably keep improving a bit on it here and there.

Guest 5
  • Guests
  • Last active:
  • Joined: --
Same issues as the above with the errors.

I tried to create a mycolors.ini file, but still no luck.


I get the ColorWin fine. But when i use Cntrl, Alt, X, nothing happens at all. Tried several different colors, but the script just seems to get stuck at this point, probably because of the lack of an .ini file.

Doctor_Who
  • Guests
  • Last active:
  • Joined: --
@Mike the Fishmonger: Glad to hear that. :)

@The Alien: Yeah i am also watching it too most of the time just to be safe. But adding some secury is never a bad idea so i can increase time interval when i check the script and chat window. Today i have finished that simple whisper alert function which check during default sleep time if i have an whisper, if i do it play the sound file to alert me and repeat it after every splash detect/click. The part with error message is pretty clever :)


I watched it fished every fishing daily quest in game (tbc, lk and cata too). I watched it fishing in cities, lakes, rivers ocenas and also in lava :lol: . It never missed the bobber or splash. I have the color save and load function but i never use it. I am always setting the color again and than hold the test button combo to try it out (mouse will move in real time while finding the color) if the cursor stay on the bobber all the time i let it to start fishing (this is probably reason why i have that good bobber detection). As for the splash detect it just search for the color from the splash in a box created on coordinates where it found the bobber color. If it cannot find it for you maybe you should adjust the color or the search expresion which create that box (maybe its different on your game version/graphics and resolution settings).


; World of Warcraft Simple Fishing Script
; By: The Alien
; Out of 100 Casts, 6 were lost, and 2 clicked premature.
; Modified script originally by Mike the Fishmonger http://www.autohotkey.com/forum/topic81808.html
; v1.0
; Instructions:
; When you first start the script there will be a box in the top left corner of your screen with a white background.
; This is your base color window. Your fishing rod, if it is hotkeyed to #1, will be cast out.
; Place your cursor over the bobber with the hook close to the red feather.
; Press and hold Ctrl+Alt+Z, the box in the top left corner will show you the color you are hovering over. Most likely it will be wrong.
; Move around the red feather while still holding Ctrl+Alt+Z until you
; find a pink/mauve/light tan color. If your bobber disappears, just recast it out. Once you think you have a good color,
; press Ctrl+Alt+X to test. If the mouse moves to anywhere except to near the bobber, then repeat the process.
; Once you find a working color, press F10 to start the automatic fishing. You should be able to sit back and let it do its dirty work.
; In some instances the color may need to be changed, like for when it is more daylight, or if it is darker.
; Or maybe you move to a different location and the scenery is a little different. In any case, if you need to rechoose
; your color, press F9 to reset the script. If you're done fishing for the time being, press F11 to exit.
; Notes: I have only tested this script in one location that the time of this writing. I have included commented out
; lines that will load images if you put the images in the same folder of this script. The 4 dot.GIF lines will show
; you the 4 corners of the scan box. The bobber.GIF will leave behind a marker where you've clicked to get a color.

#NoEnv  ; Recommended for performance and compatibility with future AutoHotkey releases.

;read last saved clor
IniRead, thecolor, %A_ScriptDir%\settings.ini, colors, thecolor, 0xFFFFFF

SetWorkingDir %A_ScriptDir%

;Get window position of WoW
WinGetPos, wowX, wowY, wowW, wowH, World of Warcraft

;Create the color box
Gui, 2:Show, x100 y100 w100 h100, ColorWin
Gui, 2:Color, %thecolor% ;0xFFFFFF
Gui 2:+AlwaysOnTop
Gui 2:-Caption +ToolWindow

;Create the scan box
Gui, Show, xCenter y200 w900 h300, FishWin

; Set the scan box to the same size and position of your WoW window
WinMove, FishWin,, 0, 0, wowW, wowH

;Creates the temp box that shows the pointer markers, only needed if you use the markers, you'll need to uncomment
Gui, 3:Show, xCenter y200 w900 h300, TempWin
WinMove, TempWin,, 0, 0, wowW, wowH
Gui, 3:Color, White
Gui, 3:Show, NA, TempWin
Gui 3:+AlwaysOnTop
WinSet, TransColor, White, TempWin
Gui 3:-Caption +ToolWindow


; Get new position of scan window
WinGetPos, fishX, fishY, fishW, fishH, FishWin

;Attempt to automatically size the scan area based on your window size
TopLx := fishX + (fishW/4)
TopLy := fishY + (fishH/4)
TopRx := fishW - (fishW/4)
TopRy := fishY + (fishH/4)
BotLx := fishX + (fishW/4)
BotLy := fishH - (fishH/2.5)
BotRx := fishW - (fishW/4)
BotRy := fishH - (fishH/2.5)

; Uncomment the following 4 lines if you want to show graphics at the corners of your scan box. You will need an image
; dot.GIF in the same folder at this script. The image sizes I used were 15x15 pure green dots.
Gui, Add, Picture, x%TopLx% y%TopLy% w15 h-1, %A_ScriptDir%\dot.GIF
Gui, Add, Picture, x%TopRx% y%TopRy% w15 h-1, %A_ScriptDir%\dot.GIF
Gui, Add, Picture, x%BotLx% y%BotLy% w15 h-1, %A_ScriptDir%\dot.GIF
Gui, Add, Picture, x%BotRx% y%BotRy% w15 h-1, %A_ScriptDir%\dot.GIF

; Creates the scan area and makes the window transparent, only needed if you use the graphic corners
Gui, Color, White
Gui, Show, NA, FishWin
Gui +AlwaysOnTop
WinSet, TransColor, White, FishWin
Gui -Caption +ToolWindow

SetKeyDelay, 60

WinActivate, World of Warcraft

thecolor = 0xFFFFFF

Sleep, 1500
send, 1


;Pause function
F12::Pause
Return

; Hotkey for the Ctrl+Alt+Y
^!y::
MouseGetPos, MouseX, MouseY
PixelGetColor, color, %MouseX%, %MouseY%

; uncomment if you use the marker image
Gui, 3:Add, Picture, x%MouseX% y%MouseY% w15 h-1, %A_ScriptDir%\bobber.GIF

thecolor = %color%
Gui, 2:Color, %thecolor%
return

; Hotkey for the Ctrl+Alt+X
^!x::
PixelSearch, Px, Py, %TopLx%, %TopLy%, %BotRx%, %BotRy%, %thecolor%, 60, fast
Mousemove, %Px%,%Py%,50
return

; Hotkey to reload and restart script
F9::
Reload
Sleep 4000 ; If successful, the reload will close this instance during the Sleep, so the line below will never be reached.
MsgBox, 4,, The script could not be reloaded. Would you like to open it for editing?
IfMsgBox, Yes, Edit
return

; Hotkey to close the script and windows
F11::
Gui, Submit
IniWrite, %thecolor%, %A_ScriptDir%\settings.ini, colors, thecolor
Gui, Destroy
ExitApp
return

; Hotkey to start the auto fishing
F10::
Gui, 2:Destroy

; uncomment if using marker
Gui, 3:Destroy

gosub start
return


; Uses help item for the fishing hat, needs some reworking to auto reuse it after 10 minutes, but it's 6Am and am tired lol
start:
sleep, 100
;send, {enter}
;sleep, 500
;send , /use 1
;send {enter}

; starts fishing
gosub next
return

; activates the WoW window, casts your fishing rod [send, 1] and goes to the fishing subroutine
next:
WinActivate, World of Warcraft
send, r
sleep, 2000
gosub fish
return

; the fishing subroutine that finds the bobber, checks the bobber pixel location, determines to retrieve bobber
fish:
sleep, 500
PixelSearch, Px, Py, %TopLx%, %TopLy%, %BotRx%, %BotRy%, %thecolor%, 60, fast
Mousemove, %Px%,%Py%,50

Px2 := Px - 120
Py2 := Py - 270

Px3 := Px + 80
Py3 := Py + 50

sleep, 300
	Loop, 38
	{
		PixelSearch, Px4, Py4, %Px2%, %Py2%, %Px3%, %Py3%, 0xFFFF90, 10, fast
		if ErrorLevel = 1
			{
			;MsgBox, Not Found
			}
		else if ErrorLevel = 0
			{
			;Mousemove, %Px4%,%Py4%,50
			mouseclick, right
			 break
			}
		Else
			{
			;MsgBox, Error
			}
	Sleep, 500
		
	}
sleep, 200 ;2000

;Whispercheck function
Loop, 20
{
	PixelSearch, WPx, WPy, 350, 740, 450, 800, 0x3B6ED6, 10, fast
	if ErrorLevel = 1
		{
		;MsgBox, Not Found
		}
	else if ErrorLevel = 0
		{
		;MouseMove, Wpx, Wpy, 50 ;show spot where color is located
		;MsgBox, Whisper In box
		SoundPlay, %A_ScriptDir%\whisper.wav
		break
	}
	Else
	{
	;MsgBox, Error
	}
Sleep, 100
}

; calls next routine to start a new cast
gosub next

return
This is that mine eddited script. Gonna add some things like for example adding auto whipsr check coordinates based on mouse position and hotkey > ini save and read function but thats the music of the future since i dont need it for now. Or maybe add some sleep before breaking the whisper loop in case i have one so the scritp wait untill looted bobber disappear so it will not mess the pixelearch.

Mike the Fishmonger
  • Guests
  • Last active:
  • Joined: --
Haha. Sorry I'm laughing but I'm just giddy with excitement :)
Reults from today [had myself fishing while at work]:
Murglesnout: 782!
Algaefin Rockfish: 297
Deepsea Sagefish: 367
Volatile Water: 22
Azsharas Veil: 18

I added a little subroutine called 'sell' to auto vendor my stuff with the travelers tundra mammoth. This is initiated every 10 minutes:
sell:
send /use traveler's tundra mammoth
sleep, 100
send, {enter}
sleep, 6000
send {end}
sleep, 2000
;move the mouse to the location of Gnimo 
Mousemove, 1027,788, 50
sleep, 1000
mouseclick, right
;move the mouse to my automagic grey sell items "ok" box [automagic is a WOW addon]
Mousemove, 1172,624, 50
sleep, 1000
mouseclick, left
sleep, 5000
send /use traveler's tundra mammoth
sleep, 100
send, {enter}
sleep, 5000
send {home}
sleep, 2000
return

While I applaud the two of you [Dr. Who and Alien] for making your scripts very versatile for many different people / locations, I have just concentrated on mine working with my one fishing toon in one location. I'll have to start broadening my thinking and make this work in multiple locations for multiple scenarios as you have.
Also, I have very little programming experience. Well, none really, just download AHK one day and started playing with it. What can I say, I'm hooked! [Bad fishing pun]
-Mike the Fishmonger

xanderhunter
  • Members
  • 1 posts
  • Last active: Mar 08 2012 08:54 AM
  • Joined: 08 Mar 2012

@Mike the Fishmonger: Glad to hear that. :)

@The Alien: Yeah i am also watching it too most of the time just to be safe. But adding some secury is never a bad idea so i can increase time interval when i check the script and chat window. Today i have finished that simple whisper alert function which check during default sleep time if i have an whisper, if i do it play the sound file to alert me and repeat it after every splash detect/click. The part with error message is pretty clever :)


I watched it fished every fishing daily quest in game (tbc, lk and cata too). I watched it fishing in cities, lakes, rivers ocenas and also in lava :lol: . It never missed the bobber or splash. I have the color save and load function but i never use it. I am always setting the color again and than hold the test button combo to try it out (mouse will move in real time while finding the color) if the cursor stay on the bobber all the time i let it to start fishing (this is probably reason why i have that good bobber detection). As for the splash detect it just search for the color from the splash in a box created on coordinates where it found the bobber color. If it cannot find it for you maybe you should adjust the color or the search expresion which create that box (maybe its different on your game version/graphics and resolution settings).


; World of Warcraft Simple Fishing Script
; By: The Alien
; Out of 100 Casts, 6 were lost, and 2 clicked premature.
; Modified script originally by Mike the Fishmonger http://www.autohotkey.com/forum/topic81808.html
; v1.0
; Instructions:
; When you first start the script there will be a box in the top left corner of your screen with a white background.
; This is your base color window. Your fishing rod, if it is hotkeyed to #1, will be cast out.
; Place your cursor over the bobber with the hook close to the red feather.
; Press and hold Ctrl+Alt+Z, the box in the top left corner will show you the color you are hovering over. Most likely it will be wrong.
; Move around the red feather while still holding Ctrl+Alt+Z until you
; find a pink/mauve/light tan color. If your bobber disappears, just recast it out. Once you think you have a good color,
; press Ctrl+Alt+X to test. If the mouse moves to anywhere except to near the bobber, then repeat the process.
; Once you find a working color, press F10 to start the automatic fishing. You should be able to sit back and let it do its dirty work.
; In some instances the color may need to be changed, like for when it is more daylight, or if it is darker.
; Or maybe you move to a different location and the scenery is a little different. In any case, if you need to rechoose
; your color, press F9 to reset the script. If you're done fishing for the time being, press F11 to exit.
; Notes: I have only tested this script in one location that the time of this writing. I have included commented out
; lines that will load images if you put the images in the same folder of this script. The 4 dot.GIF lines will show
; you the 4 corners of the scan box. The bobber.GIF will leave behind a marker where you've clicked to get a color.

#NoEnv  ; Recommended for performance and compatibility with future AutoHotkey releases.

;read last saved clor
IniRead, thecolor, %A_ScriptDir%\settings.ini, colors, thecolor, 0xFFFFFF

SetWorkingDir %A_ScriptDir%

;Get window position of WoW
WinGetPos, wowX, wowY, wowW, wowH, World of Warcraft

;Create the color box
Gui, 2:Show, x100 y100 w100 h100, ColorWin
Gui, 2:Color, %thecolor% ;0xFFFFFF
Gui 2:+AlwaysOnTop
Gui 2:-Caption +ToolWindow

;Create the scan box
Gui, Show, xCenter y200 w900 h300, FishWin

; Set the scan box to the same size and position of your WoW window
WinMove, FishWin,, 0, 0, wowW, wowH

;Creates the temp box that shows the pointer markers, only needed if you use the markers, you'll need to uncomment
Gui, 3:Show, xCenter y200 w900 h300, TempWin
WinMove, TempWin,, 0, 0, wowW, wowH
Gui, 3:Color, White
Gui, 3:Show, NA, TempWin
Gui 3:+AlwaysOnTop
WinSet, TransColor, White, TempWin
Gui 3:-Caption +ToolWindow


; Get new position of scan window
WinGetPos, fishX, fishY, fishW, fishH, FishWin

;Attempt to automatically size the scan area based on your window size
TopLx := fishX + (fishW/4)
TopLy := fishY + (fishH/4)
TopRx := fishW - (fishW/4)
TopRy := fishY + (fishH/4)
BotLx := fishX + (fishW/4)
BotLy := fishH - (fishH/2.5)
BotRx := fishW - (fishW/4)
BotRy := fishH - (fishH/2.5)

; Uncomment the following 4 lines if you want to show graphics at the corners of your scan box. You will need an image
; dot.GIF in the same folder at this script. The image sizes I used were 15x15 pure green dots.
Gui, Add, Picture, x%TopLx% y%TopLy% w15 h-1, %A_ScriptDir%\dot.GIF
Gui, Add, Picture, x%TopRx% y%TopRy% w15 h-1, %A_ScriptDir%\dot.GIF
Gui, Add, Picture, x%BotLx% y%BotLy% w15 h-1, %A_ScriptDir%\dot.GIF
Gui, Add, Picture, x%BotRx% y%BotRy% w15 h-1, %A_ScriptDir%\dot.GIF

; Creates the scan area and makes the window transparent, only needed if you use the graphic corners
Gui, Color, White
Gui, Show, NA, FishWin
Gui +AlwaysOnTop
WinSet, TransColor, White, FishWin
Gui -Caption +ToolWindow

SetKeyDelay, 60

WinActivate, World of Warcraft

thecolor = 0xFFFFFF

Sleep, 1500
send, 1


;Pause function
F12::Pause
Return

; Hotkey for the Ctrl+Alt+Y
^!y::
MouseGetPos, MouseX, MouseY
PixelGetColor, color, %MouseX%, %MouseY%

; uncomment if you use the marker image
Gui, 3:Add, Picture, x%MouseX% y%MouseY% w15 h-1, %A_ScriptDir%\bobber.GIF

thecolor = %color%
Gui, 2:Color, %thecolor%
return

; Hotkey for the Ctrl+Alt+X
^!x::
PixelSearch, Px, Py, %TopLx%, %TopLy%, %BotRx%, %BotRy%, %thecolor%, 60, fast
Mousemove, %Px%,%Py%,50
return

; Hotkey to reload and restart script
F9::
Reload
Sleep 4000 ; If successful, the reload will close this instance during the Sleep, so the line below will never be reached.
MsgBox, 4,, The script could not be reloaded. Would you like to open it for editing?
IfMsgBox, Yes, Edit
return

; Hotkey to close the script and windows
F11::
Gui, Submit
IniWrite, %thecolor%, %A_ScriptDir%\settings.ini, colors, thecolor
Gui, Destroy
ExitApp
return

; Hotkey to start the auto fishing
F10::
Gui, 2:Destroy

; uncomment if using marker
Gui, 3:Destroy

gosub start
return


; Uses help item for the fishing hat, needs some reworking to auto reuse it after 10 minutes, but it's 6Am and am tired lol
start:
sleep, 100
;send, {enter}
;sleep, 500
;send , /use 1
;send {enter}

; starts fishing
gosub next
return

; activates the WoW window, casts your fishing rod [send, 1] and goes to the fishing subroutine
next:
WinActivate, World of Warcraft
send, r
sleep, 2000
gosub fish
return

; the fishing subroutine that finds the bobber, checks the bobber pixel location, determines to retrieve bobber
fish:
sleep, 500
PixelSearch, Px, Py, %TopLx%, %TopLy%, %BotRx%, %BotRy%, %thecolor%, 60, fast
Mousemove, %Px%,%Py%,50

Px2 := Px - 120
Py2 := Py - 270

Px3 := Px + 80
Py3 := Py + 50

sleep, 300
	Loop, 38
	{
		PixelSearch, Px4, Py4, %Px2%, %Py2%, %Px3%, %Py3%, 0xFFFF90, 10, fast
		if ErrorLevel = 1
			{
			;MsgBox, Not Found
			}
		else if ErrorLevel = 0
			{
			;Mousemove, %Px4%,%Py4%,50
			mouseclick, right
			 break
			}
		Else
			{
			;MsgBox, Error
			}
	Sleep, 500
		
	}
sleep, 200 ;2000

;Whispercheck function
Loop, 20
{
	PixelSearch, WPx, WPy, 350, 740, 450, 800, 0x3B6ED6, 10, fast
	if ErrorLevel = 1
		{
		;MsgBox, Not Found
		}
	else if ErrorLevel = 0
		{
		;MouseMove, Wpx, Wpy, 50 ;show spot where color is located
		;MsgBox, Whisper In box
		SoundPlay, %A_ScriptDir%\whisper.wav
		break
	}
	Else
	{
	;MsgBox, Error
	}
Sleep, 100
}

; calls next routine to start a new cast
gosub next

return
This is that mine eddited script. Gonna add some things like for example adding auto whipsr check coordinates based on mouse position and hotkey > ini save and read function but thats the music of the future since i dont need it for now. Or maybe add some sleep before breaking the whisper loop in case i have one so the scritp wait untill looted bobber disappear so it will not mess the pixelearch.


Hey just tried to use the script for the first time and ctrl alt z didnt seem to change the color of the window at all, looked through the script and saw in the commands you changed it to ctrl alt y for some reason, but didn't update the instructions at the top to say use y instead of z. Just thought you'd like to know. Back to trying to get this to work in Mt Hyjall lava lakes.