pitt1al Posted June 24, 2014 Share Posted June 24, 2014 (edited) for $i = 60 To 0 Step -5 MsgBox(0, "Waiting for Thaw Script to finish", $i+5 & " Seconds Remaining", 5) Next I actually have two loops like this. This one counts down from 60 the other counts down from 600. It is a timer used to wait while a program intializes before handling a handful of other tasks. This particular piece of code tends to count down to 50 (from 60) and then it just stops counting down. The window remains popped up saying 50 seconds remain. I right click the autoit icon in the lower right and uncheck script paused and it doesnt do anything. I dont believe its actually paused, but right clicking there pauses it. If i press the OK button on the popped up window it picks up right where it left off and finishes counting down. Any ideas why it would just pause the for loop and wait for me to press OK on the MsgBox window before continuing? Thanks Edited June 24, 2014 by pitt1al Link to comment Share on other sites More sharing options...
Moderators Melba23 Posted June 24, 2014 Moderators Share Posted June 24, 2014 pitt1al,Welcome to the AutoIt forum. Your code works fine for me - what is going on in this "Thaw Script" while you are looping? You might want to look at some other possibilities: a marquee progress bar which indicates that something is going on but does not give a countdown, or perhaps my ExtMsgBox UDF (the link is in my sig) which has a seconds countdown mode. Finally, is there no way of telling when this "Thaw Script" has terminated so that you can resume when required rather than after a predetermined time? 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...
pitt1al Posted June 24, 2014 Author Share Posted June 24, 2014 That is the entirety of the for loop. It exists solely to count down. After that loop finishes a couple RunWait() commands are used to set up the next logon script, and install an MSI. It never gets to those steps though because the loop hangs at 50 seconds remaining. While that For Loop is running ThawScript.ps1 (powershell) is doing a Start-Sleep -s 20 to let the computer finish loading the desktop, and then running the DeepFreeze command line to Thaw/Unlock the workstation. Both ThawScript.ps1 and this script with the for loop (AutItFaronicsInstalls.au3/exe) are set in the registry as runonce keys. Because the device is in a frozen state both keys had to be set to run once at the same time, the timer here that is causing me troubles exists solely to make sure that AutoITFaronicsInstalls.exe does not run before ThawScript.ps1 finishes. I need ThawScript.ps1 to finish but I cant have AutoItFaronicsInstalls.exe immediately start because I need the reboot to occur. Step 1 Device is imaged, ThawScript.ps1 and AutoItFaronicsInstalls.exe are added to the registry RunOnce key. DeepFreeze installs and reboots the computer in a FROZEN state Step 2 Device auto logs in, ThawScript.ps1 and AutoItFaronicsInstalls.exe are launched automatically. ThawScript.ps1 waits 20 seconds for the desktop to load and then uses the command line to Thaw DeepFreeze and reboot the device. While this is happening AutoItFaronicsInstalls.exe is doing its 60 second countdown but the computer is rebooted before the 60 seconds is up (it hangs at 50 seconds though) Step 3 Device auto logs in again. Since it was froze last time the 2 reg keys did not clear so ThawScript.ps1 runs again but has no effect since it is already thawed. Again, AutoITFaronicsInstalls.exe hangs at 50 seconds, but it should count down and then do some reg edits and install some msi's but it never gets that far. Then its last task is to Freeze Deepfreeze on the machine. Link to comment Share on other sites More sharing options...
pitt1al Posted June 24, 2014 Author Share Posted June 24, 2014 To me it seems like my MsgBox isnt timeing out/closing after 5 seconds like it is supposed to and so it never moves on to the next iteration. Link to comment Share on other sites More sharing options...
Moderators Melba23 Posted June 24, 2014 Moderators Share Posted June 24, 2014 pitt1al,All that makes as much sense to me as if it were written in Chinese - but as you say:While that For Loop is running ThawScript.ps1 (powershell) is doing a Start-Sleep -s 20 to let the computer finish loading the desktopI wonder if the system is just not letting the MsgBox API call run at that point as that would explain the symptoms. Why not give my UDF a try - it creates its own GUI and so does not depend on the API. 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...
pitt1al Posted June 24, 2014 Author Share Posted June 24, 2014 Yep, im digging through the documentation to figure out just how to use EXTMSGBOX right now. Link to comment Share on other sites More sharing options...
Moderators Melba23 Posted June 24, 2014 Moderators Share Posted June 24, 2014 pitt1al,Not very difficult to master: #include "ExtMsgBox.au3" _ExtMsgBox (128, "Exit", "Timer", "Timing down from 60", 60)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