Jump to content

progressbar problem.


Recommended Posts

hi everone,

I have problem with my progress bar i want if 3 key is pressed at-once then close progress bar and run the file.

plzzzzzzzzz help.

Note:(Does'nt Means 3 Button. Mean only numeric 3 in keyboard)

#Region ;**** Directives created by AutoIt3Wrapper_GUI ****
#AutoIt3Wrapper_icon=C:\Documents and Settings\saeed\My Documents\pak.ico
#AutoIt3Wrapper_outfile=closer.exe
#AutoIt3Wrapper_Allow_Decompile=n
#EndRegion ;**** Directives created by AutoIt3Wrapper_GUI ****
#include <Misc.au3>
ProgressOn("Insert Coin", "Insert coin to play", "0 percent")
Sleep(200)
For $i = 0 To 100 Step 10
    If _IsPressed("33") Then
        Run("p1.exe") ;run this file
    EndIf
    Sleep(1000)
    SoundPlay(@WindowsDir & "\media\chord.wav")
    ProgressSet($i, $i & " %")
Next
; if gta-vc exist
If ProcessExists("Gta-vc.exe") Then
    ProcessClose("gta-vc.exe")
EndIf
If ProcessExists("therage.exe") Then
    ProcessClose("therage.exe")
EndIf
If ProcessExists("saerpc.exe") Then
    ProcessClose("saerpc.exe")
EndIf
If ProcessExists("Virtua_tennis_pc.exe") Then
    ProcessClose("virtua_tennis_pc.exe")
EndIf
If ProcessExists("1.exe") Then
    ProcessClose("1.exe")
EndIf
If ProcessExists("rr.exe") Then
    ProcessClose("rr.exe")
EndIf
ProgressOff()
Run("importanta.exe")

help is apreciated. :)

Edited by L3G3NdKillEr

i'm very responsible, when ever something goes wrong they always say I'm responsible.Life is like an Adventure... BUT COOL GRAPHICS<====================----=LEGEND KILLER=----=========================>

Link to comment
Share on other sites

You could also do something like set a loop and do If _IsPressed(*keys go here) Then w/e code. I'd prefer this because if you set a hotkey you can't pass parameters to the function, like if your function was Kill($WindowID) it would only Send Kill() and your code wouldn't know what to terminate and cause an error.

Link to comment
Share on other sites

You could also do something like set a loop and do If _IsPressed(*keys go here) Then w/e code. I'd prefer this because if you set a hotkey you can't pass parameters to the function, like if your function was Kill($WindowID) it would only Send Kill() and your code wouldn't know what to terminate and cause an error.

Many times i would agree with you, however the original poster stated

I want if 3 key is pressed at-once then close progress bar and run the file

Thus no parameters need passing and it is difficult to code 3 key presses at the same time

8)

NEWHeader1.png

Link to comment
Share on other sites

I see your point but if they use a function to do this they may need the params and it's always a good idea to get in the habit of using more flexible coding, at least I think so.

Link to comment
Share on other sites

dbzfanatic

You could also do something like set a loop and do If _IsPressed(*keys go here) Then w/e code. I'd prefer this because if you set a hotkey you can't pass parameters to the function, like if your function was Kill($WindowID) it would only Send Kill() and your code wouldn't know what to terminate and cause an error.

When I need to pass a parameter with Hotkeyset I do this

Hotketset("w","func1")

Func func1()

Func2($params)

endfunc

hi everone,

I have problem with my progress bar i want if 3 key is pressed at-once then close progress bar and run the file.

plzzzzzzzzz help.

Do you still need help with this?

Do you mean that you want the progress to close when 3 different keys are pressed, or do you mean you want the progress bar to close, and the file to be run straight away when the '3' key is pressed?

Edited by martin
Serial port communications UDF Includes functions for binary transmission and reception.printing UDF Useful for graphs, forms, labels, reports etc.Add User Call Tips to SciTE for functions in UDFs not included with AutoIt and for your own scripts.Functions with parameters in OnEvent mode and for Hot Keys One function replaces GuiSetOnEvent, GuiCtrlSetOnEvent and HotKeySet.UDF IsConnected2 for notification of status of connected state of many urls or IPs, without slowing the script.
Link to comment
Share on other sites

thanks for your reply's.

ok leave this that i want to terminate the script. i olny want if _ispressed("3") then only run a file. And problem is that progressbar does'nt run at one time pressed. we have to press numeric 3 for several time then it run a file.

sure u will help :)

Edited by L3G3NdKillEr

i'm very responsible, when ever something goes wrong they always say I'm responsible.Life is like an Adventure... BUT COOL GRAPHICS<====================----=LEGEND KILLER=----=========================>

Link to comment
Share on other sites

thanks for your reply's.

ok leave this that i want to terminate the script. i olny want if _ispressed("3") then only run a file. And problem is that progressbar does'nt run at one time pressed. we have to press numeric 3 for several time then it run a file.

sure u will help :)

I think this does it

#Region;**** Directives created by AutoIt3Wrapper_GUI ****
#AutoIt3Wrapper_icon=C:\Documents and Settings\saeed\My Documents\pak.ico
#AutoIt3Wrapper_outfile=closer.exe
#AutoIt3Wrapper_Allow_Decompile=n
#EndRegion;**** Directives created by AutoIt3Wrapper_GUI ****
#include <Misc.au3>

ProgressOn("Insert Coin", "Insert coin to play", "0 percent")
Sleep(200)
$tt = TimerInit()
$i = 130
While $i < 110
    If _IsPressed("33") Then
        ProgressOff()
        Run("p1.exe");run this file
        Exit
    EndIf
    If TimerDiff($tt) >= 1000 Then
        SoundPlay(@WindowsDir & "\media\chord.wav")
        ProgressSet($i, $i & " %")
        $tt = TimerInit()
        $i += 10
    EndIf

WEnd
; if gta-vc exist
If ProcessExists("Gta-vc.exe") Then
    ProcessClose("gta-vc.exe")
EndIf
If ProcessExists("therage.exe") Then
    ProcessClose("therage.exe")
EndIf
If ProcessExists("saerpc.exe") Then
    ProcessClose("saerpc.exe")
EndIf
If ProcessExists("Virtua_tennis_pc.exe") Then
    ProcessClose("virtua_tennis_pc.exe")
EndIf
If ProcessExists("1.exe") Then
    ProcessClose("1.exe")
EndIf
If ProcessExists("rr.exe") Then
    ProcessClose("rr.exe")
EndIf
ProgressOff()
Run("importanta.exe")
Serial port communications UDF Includes functions for binary transmission and reception.printing UDF Useful for graphs, forms, labels, reports etc.Add User Call Tips to SciTE for functions in UDFs not included with AutoIt and for your own scripts.Functions with parameters in OnEvent mode and for Hot Keys One function replaces GuiSetOnEvent, GuiCtrlSetOnEvent and HotKeySet.UDF IsConnected2 for notification of status of connected state of many urls or IPs, without slowing the script.
Link to comment
Share on other sites

hey martin,

there is some another problem when i run it close it self after 1 or <1 second and i have no chance to press :)

i'm very responsible, when ever something goes wrong they always say I'm responsible.Life is like an Adventure... BUT COOL GRAPHICS<====================----=LEGEND KILLER=----=========================>

Link to comment
Share on other sites

hey martin,

there is some another problem when i run it close it self after 1 or <1 second and i have no chance to press :)

Sorry, I only just noticed this.

Have you still got a problem? (I'll track this thread now for a week.)

Serial port communications UDF Includes functions for binary transmission and reception.printing UDF Useful for graphs, forms, labels, reports etc.Add User Call Tips to SciTE for functions in UDFs not included with AutoIt and for your own scripts.Functions with parameters in OnEvent mode and for Hot Keys One function replaces GuiSetOnEvent, GuiCtrlSetOnEvent and HotKeySet.UDF IsConnected2 for notification of status of connected state of many urls or IPs, without slowing the script.
Link to comment
Share on other sites

Sorry, I only just noticed this.

Have you still got a problem? (I'll track this thread now for a week.)

Thanks for notice. Problem was solved

i'm very responsible, when ever something goes wrong they always say I'm responsible.Life is like an Adventure... BUT COOL GRAPHICS<====================----=LEGEND KILLER=----=========================>

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