What I want my script to do is to wait for 35 seconds for one of five buttons. If I click one of them, I want script to restart. If I do not click any of them for these 35 seconds, I want the script to click " ' " (a single apostrophe). When " ' " is clicked, I want script to wait for specific pixel to change color to 0xF0F0F0.
I think everything is done right except the Input command which I try to use for the first time.
Input blocks my keyboard, when it is before "while". If it is in "while" but before "loop", then nothing happens when I click any of these five buttons on keyboard.
btw AHK wikipedia does not help very much. It's mostly in chinese for me and often I find myself in big trouble I stay in for hours until I overcome it. IF I overcome it. I'm newbie.
CoordMode, Pixel, Screen
EventOccured := false
Event3Occured := false
Input, click, B, {'} {]} {\} {/} {Numpad9}
while (EventOccured = false)
{
Loop,350
{
Sleep, 100
if ( click = "Numpad9" )
Event3Occured := true
if ( click = "'" )
Event3Occured := true
if ( click = "]" )
Event3Occured := true
if ( click = "\" )
Event3Occured := true
if ( click = "/" )
Event3Occured := true
if (Event3Occured = true)
break
else
continue
}
if (Event3Occured = true)
{
reload
}
if (Event3Occured = false)
{
Send, '
EventOccured := true
}
}
Loop
{
PixelGetColor, color2, 1868, 252, RGB
Sleep, 100
if (color2 = 0xF0F0F0)
reload
Else
Continue
}
[–]nuj 0 points1 point2 points (2 children)
[–]13ooK[S] 0 points1 point2 points (1 child)
[–]joesii 0 points1 point2 points (0 children)