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