Jump to content

Option Window - Wait for Click then, assume


Iceburg
 Share

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.

Goals:

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()

        Select

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

            ;Check if user clicked on the "A" button
            Case $msg = $A
                func1()
                func2()
                
            ;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
                reset()

        EndSelect

    WEnd
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...