Jump to content

I need help with my script


Recommended Posts

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

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

Try this example

much 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

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