[Function] Timer

Post gaming related scripts
FanaticGuru
Posts: 534
Joined: 30 Sep 2013, 22:25

[Function] Timer

07 Nov 2013, 18:57

[Function] Timer

Below is a function I use often in my gaming scripts to keep track of timers. Generally the cooldown on abilities which is prevalent in many games.

The function is easy to use and not as complicated as the comments at the beginning might imply.

Code: [Select all] [Expand] [Download] (Timer.ahk)GeSHi © Codebox Plus



A practical gaming example.

Code: [Select all] [Expand] [Download] (Timer_Example.ahk)GeSHi © Codebox Plus


You have 5 abilities called Bash, Thrash, Trash, Slash, Crash with different cooldowns that are activated by the keys 1 2 3 4 5.
Push or hold down F1 to use any ability that is off cooldown.

The Timer function has a lot of versatility that is explained in the comments of the function.

FG
Last edited by FanaticGuru on 24 May 2014, 01:07, edited 1 time in total.
Hotkey Help - Help Dialog for Currently Running AHK Scripts

AHK Startup - Consolidate Multiply AHK Scripts with one Tray Icon

Google Search, Dictionary, Thesaurus - Quickly Get Information from Specific Web Resources

[Function] Timer - Create and Manage Timers
FanaticGuru
Posts: 534
Joined: 30 Sep 2013, 22:25

Re: [Function] Timer

24 May 2014, 00:40

Added an "Elapse" option and the ability to create a timer with a period of zero.

Inspired by tidbit in his script below that also shows nifty use of saving A_TickCount information to an array.

http://ahkscript.org/boards/viewtopic.php?f=6&t=537

FG
Hotkey Help - Help Dialog for Currently Running AHK Scripts

AHK Startup - Consolidate Multiply AHK Scripts with one Tray Icon

Google Search, Dictionary, Thesaurus - Quickly Get Information from Specific Web Resources

[Function] Timer - Create and Manage Timers
FanaticGuru
Posts: 534
Joined: 30 Sep 2013, 22:25

Re: [Function] Timer

24 May 2014, 01:15

Added an "Unset" option which removes a timer from the Timer array.

Having a no longer needed timer continue to exist has very little impact but if for some reason you are creating massive amounts of timers that you will not continue to need then it might be necessary to delete them.

Also it allows you to keep the Timer array uncluttered so that you can then loop through the array and not have to deal with no longer needed timers.

FG
Hotkey Help - Help Dialog for Currently Running AHK Scripts

AHK Startup - Consolidate Multiply AHK Scripts with one Tray Icon

Google Search, Dictionary, Thesaurus - Quickly Get Information from Specific Web Resources

[Function] Timer - Create and Manage Timers
TygerByte
Posts: 5
Joined: 12 Aug 2016, 05:22

Re: [Function] Timer

23 Sep 2016, 20:17

Hi thought I'd contribute some examples of my usage here. Thanks FanaticGuru for this great library.

Arwen2.0 script I write and named after my buddy Arwen. I believe it was set to 800x600 in a VM setup. It would do pixelsearch on the target's HP or MP then cast spells.

Code: [Select all] [Expand] [Download] GeSHi © Codebox Plus



Another Script I wrote for Skill Rotation. I'd like to also thank MasterFocus for his WaitPixelColor Function which you can find @https://github.com/MasterFocus/AutoHotkey which I used for the function TabForPixelColor

Code: [Select all] [Expand] [Download] GeSHi © Codebox Plus


Return to “Gaming”

Who is online

Users browsing this forum: No registered users and 3 guests