LondonNDIB Posted March 16, 2017 Share Posted March 16, 2017 I have a piece of software that I use on infrequent days, but frequently in those days (if that makes sense). Annoyingly, there's a form that pops up that I have to fill in every time. So I thought AutoIt would be perfect for that. However, my concern is that my PC takes a performance hit for the 90%+ time I'm not actively using the script. Is the performance hit so negligiblele I shouldn't worry about it? Or is there some trick so I don't have the hit at all? I was thinking I'd have the script run at bootup and always be there, waiting for the window. But maybe there's a better way to do it? Thanks. ps. I used to use AutoIt a lot back in V2. Sparingly since it went to V3. Not at all since probably 3 to 5 years so I'm really out of practice. Link to comment Share on other sites More sharing options...
Moderators Melba23 Posted March 16, 2017 Moderators Share Posted March 16, 2017 LondonNDIB, I have a number of AutoIt scripts running constantly which does not seem to slow down my machine in any noticeable manner. These scripts usually have a Sleep(10) or GUIGetMsg call (which has an internal sleep of about that duration) in a loop - if you can afford to wait a bit longer than the 10 milliseconds which that provides you can reduce the CPU load (if it could even be called that) of the scripts even further. 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...
LondonNDIB Posted March 18, 2017 Author Share Posted March 18, 2017 Great, thank you. Yes I could probably wait 500 ms or so. This may be asking too much... but is there an example script I could use as a template? I'd like to jump start this. Just something that demonstrates a structure for a program that runs continuously. Link to comment Share on other sites More sharing options...
Moderators Melba23 Posted March 18, 2017 Moderators Share Posted March 18, 2017 LondonNDIB, You need an example for something so simple? If you insist..... While 1 If WinExists(.....) Then ; Do something EndIf Sleep(500) WEnd 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...
LondonNDIB Posted March 19, 2017 Author Share Posted March 19, 2017 As I said: Quote ps. I used to use AutoIt a lot back in V2. Sparingly since it went to V3. Not at all since probably 3 to 5 years so I'm really out of practice. So yes, an example of something so simple is helpful. No, I didn't "need" it and no, I didn't "insist". I figured it would be a couple of seconds for you to save me an hour of reading, so I made a simple request. Answer appreciated... attitude, less so. Link to comment Share on other sites More sharing options...
Moderators Melba23 Posted March 19, 2017 Moderators Share Posted March 19, 2017 LondonNDIB, If you are going to start coding in a "new" language and yet are not prepared to put in the effort to find out for yourself how to create something as simple as an infinite loop to detect a window, I question whose attitude requires adjusting. Anyway, and I hope more helpfully, might I suggest reading the Help file (at least the first few sections - Using AutoIt, Tutorials and the first couple of References - which will give you a good grounding in current AutoIt coding. You should also look at this excellent tutorial - you will find other tutorials in the Wiki (the link is at the top of the page). Good luck! 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