Jump to content

Problems with GUI and while loops.


Insolence
 Share

Recommended Posts

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.
Link to comment
Share on other sites

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.

Link to comment
Share on other sites

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.
Link to comment
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
 Share

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...