Code: Select all
loop
{
CoordMode, Pixel, Window
PixelSearch, FoundX, FoundY, 981, 1012, 981, 1012, 0x3FDE45, 0, Fast RGB
If ErrorLevel = 0
{
; check thirst
CoordMode, Pixel, Window
PixelSearch, FoundX, FoundY, 1792, 975, 1792, 975, 0x3CD241, 20, Fast RGB
If ErrorLevel
{
Send, {5 down}
Sleep 20
Send, {5 up}
sleep, 1500
}
; check hunger
CoordMode, Pixel, Window
PixelSearch, FoundX, FoundY, 1601, 975, 1601, 975, 0x3FDE45, 5, Fast RGB
If ErrorLevel
{
Send, {4 down}
Sleep 20
Send, {4 up}
sleep, 1500
}
; check sleep
CoordMode, Pixel, Window
PixelSearch, FoundX, FoundY, 406, 1007, 406, 1007, 0xD3704C, 0, Fast RGB
If ErrorLevel = 0
{
Send, {7 down}
Sleep 20
Send, {7 up}
sleep 200
Send, {8 down}
Sleep 20
Send, {8 up}
sleep, 1200
}
}
}
How do you make the sleep function isolate only inside the { } ?
currently when the sleep activate, it sleep the whole script.
There is a hunger, thirst and disease pixelsearch, How to make it when the sleep activated, it will only sleep within the { } and it will not sleep the whole script.
Example it found the hunger pixel, it will sleep the hunger script but will continue to search for thirst and disease script.
[Mod edit: Changed inline code tags (c) to [code][/code] tags. Please use the proper tags when posting code.]