Jump to content
Sign in to follow this  
Insolence

Problems with GUI and while loops.

Recommended Posts

Insolence

I can't do ANYTHING (events wise) while a while loop is running.

I've tried to recieve any messages inside the specific while loop:

While $InGameCheck[0] <> 16579640 AND $InGameCheck[1] <> 16579640 AND $InGameCheck[2] <> 16579640
      $InGameCheck[0] = PixelGetColor(517, 458)
      $InGameCheck[1] = PixelGetColor(565, 462)
      $InGameCheck[2] = PixelGetColor(610, 452)
      Sleep(5)

      $msg = GUIGetMsg()
      If $msg = $GUI_EVENT_CLOSE Then MsgBox("","","")
   WEnd

I've tried to make an AdLib:

AdlibEnable ( "CheckEvents", 100 )

Func CheckEvents()
   $msg = GUIGetMsg()
   If $msg = $GUI_EVENT_CLOSE Then MsgBox("","","")
EndFunc

What am I doing wrong?


"I thoroughly disapprove of duels. If a man should challenge me, I would take him kindly and forgivingly by the hand and lead him to a quiet place and kill him." - Mark TwainPatient: "It hurts when I do $var_"Doctor: "Don't do $var_" - Lar.

Share this post


Link to post
Share on other sites
jpm

What do you mean by I can't do ANYTHING?

I assume you have a Gui creation above, so if you click on the right upper cross of the window you get your message box

for your PixelGetColor the x,y wil get according to PixelCoordMode.

so I assume your 3 pixel are never the color you look for.

Share this post


Link to post
Share on other sites
Insolence

Well, I mean nothing receives and event.

And yes, it does detect the pixels and move onto the rest of the script, but while it's in the loop it doesn't detect any events.

EDIT - I think it's: Opt("GUIOnEventMode", 1), let me play with this and see if that was the problem.

Yeah, that was it. Thanks :idiot:

Edited by Insolence

"I thoroughly disapprove of duels. If a man should challenge me, I would take him kindly and forgivingly by the hand and lead him to a quiet place and kill him." - Mark TwainPatient: "It hurts when I do $var_"Doctor: "Don't do $var_" - Lar.

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
Sign in to follow this  

×

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.