sandin Posted March 14, 2007 Share Posted March 14, 2007 This is my script so far... It can disconnect or shutdown computer with the time inputed. But I can't figure how to make time count down. and how to pause it with stop button, and continue with start. Some cool glass and image menu | WinLIRC remote controler | Happy Holidays to all... | Bounce the sun, a game in which you must save the sun from falling by bouncing it back into the sky | Hook Leadtek WinFast TV Card Remote Control Msges | GDI+ sliding toolbar | MIDI Keyboard (early alpha stage, with lots of bugs to fix) | Alt+Tab replacement | CPU Benchmark with pretty GUI | Ini Editor - Edit/Create your ini files with great ease | Window Manager (take total control of your windows) Pretty GUI! | Pop-Up window from a button | Box slider for toolbar | Display sound volume on desktop | Switch hotkeys with mouse scroll Link to comment Share on other sites More sharing options...
JohnBailey Posted March 14, 2007 Share Posted March 14, 2007 The following is just an idea that I use. Create a GUI that has a progress bar and the buttons you want (pause, cancel, etc. - I made the pause btn switch to read resume when clicked). Have this placed before your current script. If you need a few more nudges let me know, but the documentation in the manual should be all you need. A decision is a powerful thing Link to comment Share on other sites More sharing options...
sandman Posted March 14, 2007 Share Posted March 14, 2007 For a countdown you could use a For loop: For $i = 99999 To 0 Step -1 Sleep(1000) Next This means it would countdown from 99999 seconds to 0. [center]"Yes, [our app] runs on Windows as well as Linux, but if you had a Picasso painting, would you put it in the bathroom?" -BitchX.com (IRC client)"I would change the world, but they won't give me the source code." -Unknownsite . blog . portfolio . claimidcode.is.poetry();[/center] Link to comment Share on other sites More sharing options...
JohnBailey Posted March 14, 2007 Share Posted March 14, 2007 Try this examplemuch need props to someone who originally helped me figure this out. Alas, I didn't document who helped.$i = 0 $state = "Resumed" While $i < 100 $msg = GUIGetMsg() If $msg = $stop OR $msg = $GUI_EVENT_CLOSE Then Exit If $state = "Resumed" Then If $msg = $pause Then GUICtrlSetData($pause,"Resume") $state = "Paused" EndIf $i = $i + 1 GUICtrlSetData ($progressbar,$i) GUICtrlSetData ($procent,$i & ' %') ElseIf $state = "Paused" Then If $msg = $pause Then GUICtrlSetData($pause,"Pause") $state = "Resumed" EndIf EndIf If $i > 100 Then ExitLoop EndIf Sleep(50) Wend GUIDelete($opener) A decision is a powerful thing 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