patrik2991 Posted September 3, 2011 Share Posted September 3, 2011 (edited) Hello everyone! I have a really small script:#Include <Misc.au3>Global $shot=100HotKeySet ( "{ESC}", "Terminate" ) While 1If _IsPressed('70') Then$shot=$shot-1ToolT()EndIfSleep(500)WEnd Func ToolT()ToolTip("Fennmaradó lövések:" & $shot,0,0)EndFunc Func Terminate()Exit 0EndFunc I'd like to make a counter which is decreasing every time when i press F1. This simple script make very funny things somtimes the tooltip jumps (for example from 97 to 95) sometimes it doesn't decrease (97 *F1 press* still 97) In scite editor if i press stop executing it won't end it, if i use the hotkey for terminate it's the same! Someone please help me Thank you guys! Edited September 3, 2011 by patrik2991 Link to comment Share on other sites More sharing options...
jaberwacky Posted September 3, 2011 Share Posted September 3, 2011 (edited) HotKeySet("{ESC}", "Terminate") HotKeySet("{F1}", "final_countdown") While 1 Sleep(100) WEnd Func final_countdown() Static $shot = 99 ToolTip("Fennmaradó lövések:" & $shot, 0, 0) $shot -= 1 EndFunc ;==>ToolT Func Terminate() Exit 0 EndFunc ;==>Terminate Edited September 3, 2011 by LaCastiglione Helpful Posts and Websites: AutoIt3 Variables and Function Parameters MHz | AutoIt Wiki | Using the GUIToolTip UDF BrewManNH | Can't find what you're looking for on the Forum? Link to comment Share on other sites More sharing options...
patrik2991 Posted September 3, 2011 Author Share Posted September 3, 2011 HotKeySet("{ESC}", "Terminate")HotKeySet("{F1}", "final_countdown") While 1 Sleep(100)WEnd Func final_countdown() Static $shot = 99 ToolTip("Fennmaradó lövések:" & $shot, 0, 0) $shot -= 1EndFunc ;==>ToolT Func Terminate() Exit 0EndFunc ;==>Terminate Nice this time it works great, but the hotkey function isn't good in this case, beacuse when i press F1 i just use the hotkey, other program didn't get the key press I hope you understand. Link to comment Share on other sites More sharing options...
AdmiralAlkex Posted September 3, 2011 Share Posted September 3, 2011 Nice this time it works great, but the hotkey function isn't good in this case, beacuse when i press F1 i just use the hotkey, other program didn't get the key press I hope you understand.Disable the hotkey and Send() F1 then, you already made clear in your first post that _IsPressed() is not for you. .Some of my scripts: ShiftER, Codec-Control, Resolution switcher for HTC ShiftSome of my UDFs: SDL UDF, SetDefaultDllDirectories, Converting GDI+ Bitmap/Image to SDL Surface 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