patrik2991 Posted September 3, 2011 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
jaberwacky Posted September 3, 2011 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: AutoIt Wiki | Can't find what you're looking for on the Forum? My scripts: Guiscape | Baroque AU3 Code Formatter | MouseHoverCalltips | SciTe Customization GUI | ActiveWindowTrack Toy | Monitor Configuration UDF
patrik2991 Posted September 3, 2011 Author 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.
AdmiralAlkex Posted September 3, 2011 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
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