Jump to content
Sign in to follow this  

Option Window - Wait for Click then, assume

Recommended Posts


I have searched the forums, and can't find anything similar.

Basically I am writing a small bot, with 4 options.

I am doing:

4 buttons: A, B, C, D

Each of the buttons have a function that they do if they are pressed. My issue is that if I press A, I want A to loop till the end of time, unless B, C, D is pressed.


Add a progress bar to the GUI an wait 60 seconds, set choice A, then start over if nothing is pressed.

Check the current date and time, and only set choice A if between xx:xx a.m. xx:xx p.m.

Display time somewhere.

Pause button stops timer / progress bar where it is at that time.

My questions:

1.) How can I interrupt choice A, and the functions associated with it without having to finish the current loop to wait for another button? Choice A takes 45-60 seconds (by design)

2.) How do I assume choice A all the time unless something else is pressed?

I may have some questions on the progress bar and getting the timing dead on, but I haven't researched that one enough to have solid questions.

My code now:

While 1
    ;After every loop check if the user clicked something in the GUI window
        $msg = GUIGetMsg()


        ;Check if user clicked on the close button
            Case $msg = $GUI_EVENT_CLOSE
            ;Destroy the GUI including the controls
            ;Exit the script

            ;Check if user clicked on the "A" button
            Case $msg = $A
            ;Check if user clicked on the "B" button
            Case $msg = $B
            ;B function goes here
            ;Check if user clicked on the "Pause" button
            Case $msg = $Pause
            ;Pause function goes here
        ;Check if user clicked on the "Reset" button
            Case $msg = $Reset



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