I think I have an idea what your getting at. Basically you want a screen overlay to show when the resource re-appears. I have done this already with automation such as the clicking of the resource and a clicking of the spell so take a look. It does what you want it to do but just the outcome is different. If you know how to use ahk then it should be easy to rearange this code. If you want to use it as is, it is meant to me used on the wines of zamorak so the color codes are set to detect that.
Code: Select all
PixelCheck = 0
InputBox, windowName, Please type the name of your window.
IfWinExist, %windowName%
{
MsgBox, Selecting and Opening %windowName%
WinActivate
goto, WinExists
Return
}
IfWinNotExist, %windowName%
{
MsgBox, Window is not open! Please open the selected window and try again
Return
}
WinExists:
MsgBox, About to gather the first location of your mouse! Please hold your mouse over the spell you wish to cast! Once overtop press CTRL + o at the same time!
^o::
WinActivate, %windowName%
MouseGetPos, 1xMouse, 1yMouse
MsgBox, Your first mouses x pos is: %1xMouse% and your y pos is: %1yMouse%
MsgBox, About to gather the second location of your mouse! Please hold your mouse over the collectible then hit CTRL + i at the same time!
^i::
WinActivate, %windowName%
MouseGetPos, 2xMouse, 2yMouse
MsgBox, Your second mouses x pos is: %2xMouse% and your y pos is: %2yMouse%
MsgBox, Please press CTRL + n to run the mouse playback (no-clicks)
^n::
WinActivate, %windowName%
MouseMove, %1xMouse%, %1yMouse%
SoundPlay *-1
Sleep, 2000
MouseMove, %2xMouse%, %2yMouse%
SoundPlay *-1
InputBox, myn, Were these locations correct?
if (%myn% = yes)
{
goto mynY
Return
}
else
{
goto mynN
}
Return
mynY:
MsgBox, Mouse Pos's set (Check)
Coordmode, Mouse, Relative
MsgBox, Please press CTRL+m to run afk program and press ALT+x to end the program
Return
^m::
WinActivate %windowName%
PixelCheck := 1
while (PixelCheck = 1)
{
WinActivate %windowName%
PixelGetColor, 2PixCol, %2xMouse%, %2yMouse%
if RegExMatch(2PixCol,"0x5.....")
{
MouseMove, %2xMouse%, %2yMouse%
Click, %2xMouse%, %2yMouse%
Sleep, 2000
MouseMove, %1xMouse%, %1yMouse%
Click, %1xMouse%, %1yMouse%
MouseMove, %2xMouse%, %2yMouse%
}
if RegExMatch(2PixCol,"0x6.....")
{
MouseMove, %2xMouse%, %2yMouse%
Click, %2xMouse%, %2yMouse%
Sleep, 2000
MouseMove, %1xMouse%, %1yMouse%
Click, %1xMouse%, %1yMouse%
MouseMove, %2xMouse%, %2yMouse%
}
if RegExMatch(2PixCol,"0x7.....")
{
MouseMove, %2xMouse%, %2yMouse%
Click, %2xMouse%, %2yMouse%
Sleep, 2000
MouseMove, %1xMouse%, %1yMouse%
Click, %1xMouse%, %1yMouse%
MouseMove, %2xMouse%, %2yMouse%
}
if RegExMatch(2PixCol,"0x8.....")
{
MouseMove, %2xMouse%, %2yMouse%
Click, %2xMouse%, %2yMouse%
Sleep, 2000
MouseMove, %1xMouse%, %1yMouse%
Click, %1xMouse%, %1yMouse%
MouseMove, %2xMouse%, %2yMouse%
}
if RegExMatch(2PixCol,"0x9.....")
{
MouseMove, %2xMouse%, %2yMouse%
Click, %2xMouse%, %2yMouse%
Sleep, 2000
MouseMove, %1xMouse%, %1yMouse%
Click, %1xMouse%, %1yMouse%
MouseMove, %2xMouse%, %2yMouse%
}
}
Return
!x::
ExitApp
mynN:
MsgBox, Sorry I couldnt find your mouse locations jumping back to location select
goto WinExists
Return
!d::
MsgBox, Debug Section
MsgBox, "%2PixCol%, %PixelCheck%, %1xMouse%, %1yMouse%, %2xMouse%, %2yMouse%"