bositroll Posted January 15, 2014 Share Posted January 15, 2014 Hello everybody, I'm writing a little program in autoIt and I'm having some trouble. I created a gui with two buttons. Run and Close. Func _EventRecorder() While 1 $nMsg = GUIGetMsg() Switch $nMsg Case $GUI_EVENT_CLOSE Exit Case $_Run _theLoop() Case $_Close Close() EndSwitch WEnd EndFunc _EventRecorder() So Basically I have a function that's polls the GUI with an endless while loop. Everything great here. But the problem is when I hit the "run" button, _theLoop() is called. _theLoop() is another infinite while loop, and is the "core" of my program. It polls diferent things constantly so my program works. The problem I'm having is that when I press the "Run" button the program goes to _theLoop() and stays here. It doesn't stop looping (which is fine ofcourse, because _theLoop() is the actual program), The downside of this (the program caught in _theLoop()) is that my while loop for my GUI is no longer responsive. What is the best tactic to solve this problem? Thanks in advance Sorry for bad English Link to comment Share on other sites More sharing options...
Moderators Melba23 Posted January 15, 2014 Moderators Share Posted January 15, 2014 bositroll,Welcome to the AutoIt forum. Take a look at the Interrupting a running function tutorial in the Wiki - that will explain all. You might also think of looking at Adlib in the Help file as that allows you to run code (your "polling" code perhaps?) at regular intervals. If you give us some more details of exactly what you do in this "core" function we might be able to suggest which strategy would be best suited to your case. M23 Any of my own code posted anywhere on the forum is available for use by others without any restriction of any kind Open spoiler to see my UDFs: Spoiler ArrayMultiColSort ---- Sort arrays on multiple columnsChooseFileFolder ---- Single and multiple selections from specified path treeview listingDate_Time_Convert -- Easily convert date/time formats, including the language usedExtMsgBox --------- A highly customisable replacement for MsgBoxGUIExtender -------- Extend and retract multiple sections within a GUIGUIFrame ---------- Subdivide GUIs into many adjustable framesGUIListViewEx ------- Insert, delete, move, drag, sort, edit and colour ListView itemsGUITreeViewEx ------ Check/clear parent and child checkboxes in a TreeViewMarquee ----------- Scrolling tickertape GUIsNoFocusLines ------- Remove the dotted focus lines from buttons, sliders, radios and checkboxesNotify ------------- Small notifications on the edge of the displayScrollbars ----------Automatically sized scrollbars with a single commandStringSize ---------- Automatically size controls to fit textToast -------------- Small GUIs which pop out of the notification area Link to comment Share on other sites More sharing options...
Moderators Melba23 Posted January 15, 2014 Moderators Share Posted January 15, 2014 bositroll, i was trying to write a bot for one of the stupid flash games I found on the internetI suggest you read the Forum rules (there is also a link at bottom right of each page) - particularly the part about not discussing game automation - before you post again. M23 Any of my own code posted anywhere on the forum is available for use by others without any restriction of any kind Open spoiler to see my UDFs: Spoiler ArrayMultiColSort ---- Sort arrays on multiple columnsChooseFileFolder ---- Single and multiple selections from specified path treeview listingDate_Time_Convert -- Easily convert date/time formats, including the language usedExtMsgBox --------- A highly customisable replacement for MsgBoxGUIExtender -------- Extend and retract multiple sections within a GUIGUIFrame ---------- Subdivide GUIs into many adjustable framesGUIListViewEx ------- Insert, delete, move, drag, sort, edit and colour ListView itemsGUITreeViewEx ------ Check/clear parent and child checkboxes in a TreeViewMarquee ----------- Scrolling tickertape GUIsNoFocusLines ------- Remove the dotted focus lines from buttons, sliders, radios and checkboxesNotify ------------- Small notifications on the edge of the displayScrollbars ----------Automatically sized scrollbars with a single commandStringSize ---------- Automatically size controls to fit textToast -------------- Small GUIs which pop out of the notification area Link to comment Share on other sites More sharing options...
Recommended Posts
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 accountSign in
Already have an account? Sign in here.
Sign In Now