boltc Posted February 7, 2006 Share Posted February 7, 2006 (edited) i want to make 5 differend counters in the same gui.. can someone give me a little bit help? i have this now.. expandcollapse popup#NoTrayIcon #include <GuiConstants.au3> ; $counter = 200 $main_gui = GuiCreate("Test by Wake", 320, 134) GuiCtrlCreateButton ("", 10000,10000,1,1) $em = GuiCtrlCreateButton ("start", 10,10,50,20) $exitbutton = GuiCtrlCreateButton ("exit", 10,40,50,20) $main_gui = GUISetState() While 1 $msg = GUIGetMsg() Select Case $msg = $GUI_EVENT_CLOSE GUIDelete() ExitLoop Case $msg = $EM $counter = $counter - 1 sleep(1000) GuiCtrlCreateInput($counter, 70, 10, 130, 20) Case $msg = $exitbutton GUIDelete() ExitLoop EndSelect WEnd Func QuitIt () Exit Return EndFunc GUIDelete() Exit but it does not count down, only every time when i press the start button it will decrease with 1.. how can i fix this? he need to decrease every 1 second by 1 Edited February 7, 2006 by boltc Link to comment Share on other sites More sharing options...
flaxcrack Posted February 7, 2006 Share Posted February 7, 2006 You needed a For Next Step statement. expandcollapse popup#NoTrayIcon #include <GuiConstants.au3> ; $counter = 200 $main_gui = GuiCreate("Test by Wake", 320, 134) GuiCtrlCreateButton ("", 10000,10000,1,1) $em = GuiCtrlCreateButton ("start", 10,10,50,20) $exitbutton = GuiCtrlCreateButton ("exit", 10,40,50,20) $main_gui = GUISetState() While 1 $msg = GUIGetMsg() Select Case $msg = $GUI_EVENT_CLOSE GUIDelete() ExitLoop Case $msg = $EM For $q = 100 To 1 Step -1 $counter = $counter - 1 sleep(1000) GuiCtrlCreateInput($counter, 70, 10, 130, 20) Next Case $msg = $exitbutton GUIDelete() ExitLoop EndSelect WEnd Func QuitIt () Exit Return EndFunc GUIDelete() Exit [quote] Gilbertson's Law: Nothing is foolproof to a sufficiently talented fool.Sandro Alvares: Flaxcrack is please not noob! i can report you is stop stupid. The Post[/quote]I made this: FWD & MD5PWD() Link to comment Share on other sites More sharing options...
boltc Posted February 7, 2006 Author Share Posted February 7, 2006 (edited) how can i stop the counter? and if the counter has started, i cant close my gui any more:S and i want to make different counters in the same gui.. is this possible? Edited February 7, 2006 by boltc Link to comment Share on other sites More sharing options...
flaxcrack Posted February 7, 2006 Share Posted February 7, 2006 how can i stop the counter?and if the counter has started, i cant close my gui any more:Sand i want to make different counters in the same gui.. is this possible?Sure, put all of you code to update the counters between the For and the Sleep statements and in order to stop the script you will need a 'HOTKEY' [quote] Gilbertson's Law: Nothing is foolproof to a sufficiently talented fool.Sandro Alvares: Flaxcrack is please not noob! i can report you is stop stupid. The Post[/quote]I made this: FWD & MD5PWD() Link to comment Share on other sites More sharing options...
boltc Posted February 7, 2006 Author Share Posted February 7, 2006 Sure, put all of you code to update the counters between the For and the Sleep statements and in order to stop the script you will need a 'HOTKEY'can you give me a little help with the hotkey? Link to comment Share on other sites More sharing options...
BigDod Posted February 7, 2006 Share Posted February 7, 2006 can you give me a little help with the hotkey?Lookup the examples for HotKeySet in the help files. The show how to pause/unpause a script and how to exit using ESC. Time you enjoyed wasting is not wasted time ......T.S. Elliot Suspense is worse than disappointment................Robert Burns God help the man who won't help himself, because no-one else will...........My Grandmother Link to comment Share on other sites More sharing options...
flaxcrack Posted February 7, 2006 Share Posted February 7, 2006 can you give me a little help with the hotkey? expandcollapse popup#NoTrayIcon #include <GuiConstants.au3> Global $Paused HotKeySet("{PAUSE}", "TogglePause") HotKeySet("{ESC}", "Terminate") $counter = 200 $main_gui = GuiCreate("Test by Wake", 320, 134) GuiCtrlCreateButton ("", 10000,10000,1,1) $em = GuiCtrlCreateButton ("start", 10,10,50,20) $exitbutton = GuiCtrlCreateButton ("exit", 10,40,50,20) $main_gui = GUISetState() While 1 $msg = GUIGetMsg() Select Case $msg = $GUI_EVENT_CLOSE GUIDelete() ExitLoop Case $msg = $EM For $q = 200 To 1 Step -1 $counter = $counter - 1 sleep(1000) GuiCtrlCreateInput($counter, 70, 10, 130, 20) Next Case $msg = $exitbutton GUIDelete() ExitLoop EndSelect WEnd GUIDelete() Exit Func TogglePause() $Paused = NOT $Paused While $Paused sleep(100) ToolTip('Script is "Paused"',0,0) WEnd ToolTip("") EndFunc Func Terminate() Exit 0 EndFunc Func QuitIt () Exit Return EndFunc [quote] Gilbertson's Law: Nothing is foolproof to a sufficiently talented fool.Sandro Alvares: Flaxcrack is please not noob! i can report you is stop stupid. The Post[/quote]I made this: FWD & MD5PWD() Link to comment Share on other sites More sharing options...
flaxcrack Posted February 7, 2006 Share Posted February 7, 2006 Lookup the examples for HotKeySet in the help files. The show how to pause/unpause a script and how to exit using ESC.Yep I used the examples from the help file in the script I just posted. [quote] Gilbertson's Law: Nothing is foolproof to a sufficiently talented fool.Sandro Alvares: Flaxcrack is please not noob! i can report you is stop stupid. The Post[/quote]I made this: FWD & MD5PWD() Link to comment Share on other sites More sharing options...
boltc Posted February 7, 2006 Author Share Posted February 7, 2006 the pause and esc works now.. but i dont under stand this:Sure, put all of you code to update the counters between the For and the Sleep statements(i want to have more counters in the same gui..) Link to comment Share on other sites More sharing options...
flaxcrack Posted February 7, 2006 Share Posted February 7, 2006 the pause and esc works now.. but i dont under stand this:(i want to have more counters in the same gui..)Ah, you code to update your other counters you will need to place them between the for and sleep statements that way your counters all count at the same time. I think your problem will be if you step them faster than - 1 or if some counters have to sleep longer than 1 second. Try your code out and paste back in the post if it doesnt work. we will get you up and running. [quote] Gilbertson's Law: Nothing is foolproof to a sufficiently talented fool.Sandro Alvares: Flaxcrack is please not noob! i can report you is stop stupid. The Post[/quote]I made this: FWD & MD5PWD() Link to comment Share on other sites More sharing options...
boltc Posted February 7, 2006 Author Share Posted February 7, 2006 i have this now: expandcollapse popup#NoTrayIcon #include <GuiConstants.au3> Global $Paused HotKeySet("{PAUSE}", "TogglePause") HotKeySet("{ESC}", "Terminate") $counter = 200 $counter1 = 100 $main_gui = GuiCreate("Test by Wake", 320, 134, -1, -1, -1, $WS_EX_TOPMOST) GuiCtrlCreateButton ("", 10000,10000,1,1) $em = GuiCtrlCreateButton ("start", 10,10,50,20) $em1 = GuiCtrlCreateButton ("start", 10,40,50,20) $exitbutton = GuiCtrlCreateButton ("exit", 10,70,50,20) $main_gui = GUISetState(@SW_SHOW) While 1 $msg = GUIGetMsg() Select Case $msg = $GUI_EVENT_CLOSE GUIDelete() ExitLoop Case $msg = $EM For $q = 200 To 1 Step -1 $counter = $counter - 1 sleep(1000) GuiCtrlCreateInput($counter, 70, 10, 130, 20) Next Case $msg = $EM1 For $q = 200 To 1 Step -1 $counter1 = $counter1 - 1 sleep(1000) GuiCtrlCreateInput($counter1, 70, 40, 130, 20) next Case $msg = $exitbutton GUIDelete() ExitLoop EndSelect WEnd Func TogglePause() $Paused = NOT $Paused While $Paused sleep(100) ToolTip('Script is "Paused"',0,0) WEnd ToolTip("") EndFunc Func Terminate() Exit 0 EndFunc Func QuitIt () Exit Return EndFunc GUIDelete() Exit the problem is, he first counter that i want to start will work, and the other one does nothing when i try to start him... Link to comment Share on other sites More sharing options...
flaxcrack Posted February 7, 2006 Share Posted February 7, 2006 (edited) Try it like this expandcollapse popup#NoTrayIcon #include <GuiConstants.au3> Global $Paused HotKeySet("{PAUSE}", "TogglePause") HotKeySet("{ESC}", "Terminate") $counter = 200 $counter1 = 100 $main_gui = GuiCreate("Test by Wake", 320, 134, -1, -1, -1, $WS_EX_TOPMOST) GuiCtrlCreateButton ("", 10000,10000,1,1) $em = GuiCtrlCreateButton ("start", 10,10,50,20) $exitbutton = GuiCtrlCreateButton ("exit", 10,70,50,20) $main_gui = GUISetState(@SW_SHOW) While 1 $msg = GUIGetMsg() Select Case $msg = $GUI_EVENT_CLOSE GUIDelete() ExitLoop Case $msg = $EM For $q = 200 To 1 Step -1 $counter = $counter - 1 $counter1 = $counter1 - 1 If $counter1 < 0 Then $counter1 = 0 sleep(1000) GuiCtrlCreateInput($counter, 70, 10, 130, 20) GuiCtrlCreateInput($counter1, 70, 40, 130, 20) Next Case $msg = $exitbutton GUIDelete() ExitLoop EndSelect WEnd Func TogglePause() $Paused = NOT $Paused While $Paused sleep(100) ToolTip('Script is "Paused"',0,0) WEnd ToolTip("") EndFunc Func Terminate() Exit 0 EndFunc Func QuitIt () Exit Return EndFunc GUIDelete() Exit Edited February 7, 2006 by flaxcrack [quote] Gilbertson's Law: Nothing is foolproof to a sufficiently talented fool.Sandro Alvares: Flaxcrack is please not noob! i can report you is stop stupid. The Post[/quote]I made this: FWD & MD5PWD() Link to comment Share on other sites More sharing options...
boltc Posted February 7, 2006 Author Share Posted February 7, 2006 gehe next problem: i need to start then @ diffrent times.. it starts to get hard isnt it? Link to comment Share on other sites More sharing options...
flaxcrack Posted February 7, 2006 Share Posted February 7, 2006 gehe next problem:i need to start then @ diffrent times..it starts to get hard isnt it?That shouldn't be a problem, explain what you mean... [quote] Gilbertson's Law: Nothing is foolproof to a sufficiently talented fool.Sandro Alvares: Flaxcrack is please not noob! i can report you is stop stupid. The Post[/quote]I made this: FWD & MD5PWD() Link to comment Share on other sites More sharing options...
boltc Posted February 7, 2006 Author Share Posted February 7, 2006 That shouldn't be a problem, explain what you mean...i try to explain but im not the best in english...i start counter 1 now..some seconds later i want to start counter 2..enough? Link to comment Share on other sites More sharing options...
flaxcrack Posted February 7, 2006 Share Posted February 7, 2006 i try to explain but im not the best in english... i start counter 1 now.. some seconds later i want to start counter 2.. enough? Check out this snippt For $q = 200 To 1 Step -5 $counter = $counter - 1 For $p = 3 To 1 Step - 1 $counter1 = $counter1 - 1 If $counter1 < 0 Then $counter1 = 0 Next sleep(1000) GuiCtrlCreateInput($counter, 70, 10, 130, 20) GuiCtrlCreateInput($counter1, 70, 40, 130, 20) Next [quote] Gilbertson's Law: Nothing is foolproof to a sufficiently talented fool.Sandro Alvares: Flaxcrack is please not noob! i can report you is stop stupid. The Post[/quote]I made this: FWD & MD5PWD() 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