I'm a new user who's writing a script for exp farming in an RPG that should operate differently depending on whether the player is in the overworld or in a battle, and I'm trying to achieve this by checking for the colour of a specific pixel. However, the code under "else" is always run, even when the conditions of the if statement should be met. The script I'm using is as follows:
Code: Select all
fightcolor := 0x000280
resultcolor := 0x002091
^g::
Loop
{
PixelGetColor, color, 18, 464, RGB
if %color% = %fightcolor% or %color% = %resultcolor%
{
SendEvent, {k down}
Sleep 10
SendEvent, {k up}
Sleep 10
}
else
{
SendEvent, {s down}
Sleep 10
SendEvent, {s up}
Sleep 10
}
}
Return
^h::Pause
^j::
PixelGetColor, color, 18, 464, RGB
MsgBox %color%
Any help would be greatly appreciated. Thank you!