Tyld Posted November 11, 2006 Share Posted November 11, 2006 Hi i am new to autoit and i got small problem. I wanted to create a counter that counts from 60 to 0 and starts when i press some button. I wanted to use it as a help in some game. The problem i got i when i am in the game and hit my hotkey button the new window that shows me how much time i got left appears and minimize my game. What i want it to do is just appear and stay there and not minimize my game. I want that it works like a tooltip command sort of. And another question is that when i use tooltip everything is fine except that after it ends counting and there is 0 it doesnt disapear (its because the while loop that keeps that program running) i manage to fix it by simply restarting program after i use that count but now i`d like to add some things there and restarting is not an option anymore. So if anybody can help me either with first or second problem id be greatfull. #include <GUIConstants.au3> HotKeySet("+z","Odliczanie") HotKeySet("{END}", "Koniec") HotKeySet("{ESC}", "stop") ;ToolTip("Shift Z -start, ESC - abort counting, END - Turn off",0,0) while 1 sleep(1000) WEnd Func Odliczanie() $window = GUICreate("licznik", 70,15,0,0,$WS_POPUPWINDOW,$WS_EX_TOPMOST) GUISetState() GUISetBkColor(0xffcc99) for $licznik = 1 to 61 $x = 60 + 1 - $licznik GUICtrlCreateLabel ("pfm/amp: "& $x,0,0, $window) ;ToolTip("Pozostalo :"& $x, 100, 0) if $x<=5 then SoundPlay("beep.aif") sleep(1000) Next GUIDelete($window) ;If @Compiled = 1 Then ; Run( FileGetShortName(@ScriptFullPath)) ; Else ; Run( FileGetShortName(@AutoItExe) & " " & FileGetShortName(@ScriptFullPath)) ;EndIf ;Exit EndFunc Func Koniec() Exit EndFunc Func stop() If @Compiled = 1 Then Run( FileGetShortName(@ScriptFullPath)) Else Run( FileGetShortName(@AutoItExe) & " " & FileGetShortName(@ScriptFullPath)) EndIf Exit EndFunc 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