Jump to content

IsPressed & Tooltip, jumping numbers, cannot terminate...


Recommended Posts

Hello everyone! I have a really small script:

#Include <Misc.au3>

Global $shot=100

HotKeySet ( "{ESC}", "Terminate" )

While 1

If _IsPressed('70') Then

$shot=$shot-1

ToolT()

EndIf

Sleep(500)

WEnd

Func ToolT()

ToolTip("Fennmaradó lövések:" & $shot,0,0)

EndFunc

Func Terminate()

Exit 0

EndFunc

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 :mellow: Thank you guys!

Edited by patrik2991
Link to comment
Share on other sites

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 by LaCastiglione
Link to comment
Share on other sites

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

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 :mellow: I hope you understand.

Link to comment
Share on other sites

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 :mellow: 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.
Link to comment
Share on other sites

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 account

Sign in

Already have an account? Sign in here.

Sign In Now
 Share

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...