I am working on a very simple script that is working 99% so far, with only one minor issue.
Code: Select all
NumPad8::Suspend, Toggle
NumPad9::Reload
CoordMode, Pixel, Relative
NumPad2::
PixelSearch, TargetX, TargetY, 323, 316, 1047, 599, %color%, 15, Fast
MouseMove, %TargetX%, %TargetY%
Sleep 250
MouseClick
Return
Numpad3::
MouseGetPos, MouseX, MouseY
PixelGetColor, color, %MouseX%, %MouseY%
MsgBox Bobber color has been captured. %color%
Return
NumPad7::
CoordMode, Pixel, Screen
loop
{
PixelGetColor, thiscolor, 1831, 910
thiscolor := (thiscolor >> 16)
if (thiscolor = 0x33){
Send, {NumPad2}
Sleep, 1200
Send, {NumPad1}
}
else {
Sleep, 67
}
}
return
So when I press NumPad3 it gets the pixel color at my cursor and stores it for use in the NumPad 2 hotkey so that when NumPad2 is pressed it seeks out pixels in the defined area. This works just fine unless I reload the script, which I do often, at which time it seems to revert to the PixelGetColor value that is stored hotkey NumPad7 because when NumPad 2 is depressed after a script reload, it always goes to the same green location in my designated area. What I would like is for the stored value of %color% to persist through a reload and should ideally only change when I call for a change to that value with NumPad3. Also, if there is any other general clean up that can be done, that would be appreciated too. I realize that the script is sloppy.
EDIT: Changed the code a little, I used a copy of an older version that didn't work.