waitpixelcolor? help?
Posted: 09 Dec 2017, 21:19
hi, i'm new to the community and to autohotkey net. i've been playing around with it for a few days so i have figured out some of the basics etc. here is my script. this script is for trove online mmo.
i can get the script to work fine of course without the waitpixelcolor and all the brackets. but what i am trying to do is make it where i dont have to monitor it and make sure it doesnt run into problems running the commands at the right time, and just do it automatically all on its own. i have read and read stuff about pixelsearch, pixelgetcolor, and waitpixelcolor, but i'm obviously getting the functions incorrect. ok so the script needs to wait a second after being activated with a hotkey, wait to find the pink color in x, y, which is the center of the screen for my crosshair, which is pink so it's easy to see. once it sees the pink x-hair, it continues the code and does the short task, then types a command to join a club world, then repeats finding the pink xhair in the x/y position. then continue the code. then go back to the world to continue killing mobs. and repeat. and continue until i press the hotkey to turn it off.
and i had to make more than 1 instance of it switching back and forth because the yes/no window that pops up for grabbing a quest has to have the mouse "moved" over it for the cursor to correctly click yes to accept the quest. hopefully this all makes sense and can be understood. can anyone please help me with how to correctly get waitpixelcolor or whichever function works best with waiting until pink is found at x,y before continuing the code? tyvm in advance! or if there's an even better way of making the script wait until the "loading screens" are done and ready to continue the script. i'm open to all ideas. tyvm!
Code: Select all
^1::
$stop := 0
Loop,
{
waitpixelcolor(0xEF00FF, 318, 240,500)
{
Send, {e down}{e up}
Sleep, 500
click, 267, 122
Sleep, 1000
send, /joinworld -272716
send, {enter down}{enter up}
sleep, 3000
}
waitpixelcolor1(0xEF00FF, 318, 240,500)
{
click, down
sleep, 24000
click, up
sleep, 1000
send, /joinworld ramses castle
send, {enter down}{enter up}
sleep, 3000
}
waitpixelcolor2(0xEF00FF, 318, 240,500)
{
Send, {e down}{e up}
Sleep, 500
click, 255, 135
Sleep, 1000
send, /joinworld -272716
send, {enter down}{enter up}
}
waitpixelcolor3(0xEF00FF, 318, 240,500)
{
click, down
sleep, 24000
click, up
sleep, 1000
send, /joinworld ramses castle
send, {enter down}{enter up}
sleep, 3000
}
if ($stop)
{
return
}
}
^2:: $stop := 1
Return
and i had to make more than 1 instance of it switching back and forth because the yes/no window that pops up for grabbing a quest has to have the mouse "moved" over it for the cursor to correctly click yes to accept the quest. hopefully this all makes sense and can be understood. can anyone please help me with how to correctly get waitpixelcolor or whichever function works best with waiting until pink is found at x,y before continuing the code? tyvm in advance! or if there's an even better way of making the script wait until the "loading screens" are done and ready to continue the script. i'm open to all ideas. tyvm!