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
  • Guests
  • Last active:
  • Joined: --

This is what I'm using now.. and it works flawlessly on my system:

Looks better now it stars moving the mouse to some random spots but it never finds the bobber. I tried it on blue, red and so on color also tryed to change tollerance from 60 to 0 but it still just pick random spot at window and never the bobber. I am picking colors from not mouse overed bobber but tryed mouseovered (brightened) clors too.

Mike the Fishmonger
  • Guests
  • Last active:
  • Joined: --
Well it sounds like you are on the right path.
Please note - if you change the default window size to something other than
Winmove,World of Warcraft,,0,0,1820, 1051
then you also have to change the X,Y coordinates of the fishing hitbox
PixelSearch, Px, Py, 514, 474, 1315, 820, 0xFAE6E6, 60, fast
and the X,Y coordinates of the Alive subroutine:
Pixelgetcolor, color, 202,78
Also, I am apparently searching for a pinkish color on the bobber. I verified this by going to http://easycalculati...color-coder.php and typing in FAE6E6. It gives you a color preview.
I believe I chose this color since it was very far away from the color of the water in the backround.
Please note - the color of the bobber varies depending on where you try and fish. If I run this script in Stormwind, it doesnt work. I get huge success running this in Tol Barad. [Note the color of my bobber in the photo below] Also note my screen location and the location of the horizon in the back.
I highlighted the default fishing hitbox coordinates.
Happy Fishing!
-Mike the Fishmonger
Posted Image[/img][/url]

  • Guests
  • Last active:
  • Joined: --
I got the color code from adobe photoshop. Ill try something with it today or tomorrow (depends on free time). I want to use it at hyjal and tol barad testing was at stormwind.

I will try to ";" the winmove/resize function and than change searching area to whole screen (not best choice but at start it could be ok).

One more thing. How did you make the bobber to be so bright? It is mouseovered? It search for mouseover color of bobber or just normal "nonmouseovered"?
Also why dont you use image search for cursor shape? I think it would be more accurate and easier to use.

  • Guests
  • Last active:
  • Joined: --
It worked than i edited it so it does not allways click after 8seconds but after it detect the splash. Than it worked even better. Now it does not find the bobber probably because of color. Any idea what to do? If i take the screenshot of the screen take the hex color code of the red part of bobber and insert it here <!-- m -->http://easycalculati...color-coder.php<!-- m --> it shows me blue color but i am suere that i pick the red from the picture. Its strane maybe because of time change so time ingame changed as well and put some color filter above everything? I dont know what else could it be.

Mike the Fishmonger
  • Guests
  • Last active:
  • Joined: --
Can you post the code that you modified?
Also, can you start using a name [doesn't have to be your real one] so I know its the same person I'm talking too and not another random "Guest"
:D

doctor who
  • Guests
  • Last active:
  • Joined: --
fish:
gosub alive
PixelSearch, Px, Py, 200, 200, 1000, 700, 0x0D256F, 10, fast
Mousemove, %Px%,%Py%,50
Sleep, 100

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

Px3 := Px + 80
Py3 := Py + 50
	Loop, 38
	{
		PixelSearch, Px4, Py4, %Px2%, %Py2%, %Px3%, %Py3%, 0xFFFF90, 10, fast
		if ErrorLevel = 1
			{
			;MsgBox, Not Found
			}
		else if ErrorLevel = 0
			{
			;mouseclick, right
			;Mousemove, %Px4%,%Py4%,50
			mouseclick, right
			 break
			}
		Else
			{
			;MsgBox, Error
			}
	Sleep, 500
		
	}
Return

This is the splash detect change. It is looking for it at loop in box around the point where it found the bobber. When it founds it it breaks the loop and continue fishing.

But i got the problem with bobber detection color it just stops working without any change (but on old screenshot it still can find it). Maybe would be better to use imagesearch to search for the bobber cursor image. How did you solve the bobber color problem?

Mike the Fishmonger
  • Guests
  • Last active:
  • Joined: --
Hello Doctor Who!
I cast the bobber [dont hover the mouse over it] and hit print screen.
Ill paste the print screen into microsoft paint brush and zoom in the bobber. Using the autoit window spy you can really pick out the color that you want to search for.
Its best to do this in the same place where you want to be fishing, that way the color you select will match.
I'll play around with your code when I get home later - hope its moving forward and making progress for you! :)
-Mike the Fishmonger

Mike the Fishmonger
  • Guests
  • Last active:
  • Joined: --
Was checking your loop..
You might want to wait to move your mouse until right before it is ready to click. I think their might be a problem when you do the first pixelsearch then move the mouse to that location. When the mouse moves over the bobber - the color of the bobber changes.
Ive never used errorlevel commands before, but after reading up on them I found this:
"Note: Since some commands set ErrorLevel to values higher than 1, it is best not check whether ErrorLevel is 1, but instead whether ErrorLevel is not zero."
You might want to change your 'if' statement to > 0 instead of = 0. I cant test this here, but just wanted to give some ideas while still fresh in my head.
-Mike the Fishmonger

doctor who
  • Guests
  • Last active:
  • Joined: --
Error level is ok and mouse move too. If you specify the error level you just know which error you get for example if you get 1 its not found if you get 2 it cannot start the search but its not too important.

I do it the same way i take the screenshot zoom it in and pick color with window spy but i think that problem is color itself (i click on red part for example and it pick some blue color which can be easily found at background). It just worked pretty good (100% success at about 100 casts) but than it just stop working character at the same place settings and program code the same... Its just like climate and time in game changed which make the scene for example darker ant it change to color of the bobber problem is that when i change the color again the same way like before it just does not move at all (like its already at that spot) or move it to some random place but never the bobber.

So my questin is how did you solve that time and weather change becasue simply pick the color again does not work for me (and i did try to pick even the blue, brown and white parts of the bobber).

Mike the Fishmonger
  • Guests
  • Last active:
  • Joined: --
Yea the color I chose was the furthest away from the background colors of the ocean.
You can try changing the level of pixelsearch precision from 10 to some number higher to allow for a broader range of colors.
so instead of:
PixelSearch, Px4, Py4, %Px2%, %Py2%, %Px3%, %Py3%, 0xFFFF90, 10, fast
you can try
PixelSearch, Px4, Py4, %Px2%, %Py2%, %Px3%, %Py3%, 0xFFFF90, 30, fast
just remember the higher you go the more likely you are to select something other than the bobber.
100 / 100 is pretty good success also! Glad to hear its working for you!
-Mike the Fishmonger

I'll come home from work to find a bag full of 350 Murglesnout, 150 Rockfish and 175 Sagefish :D

doctor who
  • Guests
  • Last active:
  • Joined: --
Yeah i already did change the tolerance and also most of the time i try to use the brightest red color of the bobber. But it still have an problem to find it. Bobber finding function needs to be taken to the next level. About the splash detection i watched the script fishing about 300 times and splash detection worked with 100% success only problem was to find the bobber but simple pick the color again is not enought to solve that.

The Alien
  • Guests
  • Last active:
  • Joined: --
I built on your code a bit and came up with some cool concepts I think. Let me know what you guys think.
; 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.

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, 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


; Hotkey for the Ctrl+Alt+Z
^!z::
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, 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, 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


doctor who
  • Guests
  • Last active:
  • Joined: --
The Alien: Gonna try it out soon than i will post some feedback.

I have been watching the last script fishing for 4 hours. It missed the bobber about 6 times so accurracy was pretty good. Than i started it few hours later with the same settings the same spot and it almost never found it. :D This pixel search just is not inought for that. I was thinking if it would be possible to link few pixel search commands together. For example it should search for color A, B, C, D and it would react on data it collect. It should compare the possition of each pixel founded and it should be like 100px from each other. This could rapidly increase the accuracy of this script but i dont know how to do that, yet.
Also i was watching my splash detection edit and it had 100% accuracy. It never missed the splash so i am pretty happy about that. :)

The Alien
  • Guests
  • Last active:
  • Joined: --
Yeah I had only had time to test it out in one location, over a 6 hour or so period. I am a scripter but never worked with AHK before, so I was testing out various things all night throughout a daylight/night transition in Uldum. It does have room for improvement, but I figured that adding a color picker would help out a lot. I even got it to work at the Dalaran fountain but it took me about 20 tries to find a color that would work against the fountain background and found a blue color that worked 90% of the time. Of course at the fountain you have to deal with the bobber not landing correctly, so trying to come up with a way around that. Plus I'm thinking of a save option to save colors, I actually have a save in already, just have to figure out how to read the ini file and place each key/value pair into a drop down select box. I tried the script edit you posted earlier for the bobber detection and I couldn't get it to work for me for some reason.

doctor who
  • Guests
  • Last active:
  • Joined: --
@The Alien: Been testing your script and it was nice suprise. Smile I was thinking about color picker too but didnt have a time to do it myself. Its for sure a nice addition. Tested it in little modified version (for example i used my splash detection becasue it just worked better for me) and accuracy of this script was pretty good. Never missed splash like before but it got 99% success in bobber finding.

I am thinking about some new additions like imagesearch on minimap in case somebody death grip me or if a GM teleport me to testing/few yards away from the water becasue of suspision of botting. This should not be a problem using error level and imagesearch. Also some whisper alerter maybe... This should not be a problem too if i create new chat window in deffault blizz ui it can flash when i recieve a whisper which can be pixelsearched and do stuff on this trigger. At least i am planning to add pause function in case i want to do something between casts (like deleting crap from bags or chat with someone) which will be the first addition probably.

Also color saving is one of the things i was thinking too. Ini read is simple but i never used drop menu but this have a time... There are more important things to do now.