patrik2991 0 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 Share this post Link to post Share on other sites
jaberwacky 327 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? Share this post Link to post Share on other sites
patrik2991 0 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. Share this post Link to post Share on other sites
AdmiralAlkex 125 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 Share this post Link to post Share on other sites