Jump to content

Sky Slate Blueberry Blackcurrant Watermelon Strawberry Orange Banana Apple Emerald Chocolate
Photo

Q: a simple timer to track 2 powerups every 50 and 80 seconds


Best Answer Jackie Sztuk _Blackholyman , 12 October 2015 - 02:30 PM

Go to the full post »


  • Please log in to reply
4 replies to this topic
steven01
  • New members
  • 3 posts
  • Last active: Oct 13 2015 06:49 AM
  • Joined: 12 Oct 2015

Hello Forum,
I'm trying to write a simple timer for UT which should beep every 50 seconds and 80 seconds ,possibly with two different tones,one for each alarm.The timer should be started with a hotkey at the start of the game.
 
the spawn time is every 60 seconds for powerup1 and 90 seconds for powerup2,but I would like the timer to beep 10 seconds before each spawning time.

I haven't programming skills, so I'm stuck. Could someone help me?

 

Thanks in advance!

 

EDIT: I know I messed up the description!

I need the timer to play 10 seconds before the minute and the minute and a half



Exaskryz
  • Members
  • 3249 posts
  • Last active: Nov 20 2015 05:30 AM
  • Joined: 23 Aug 2012

#Persistent

SetTimer, first_beep, 50000

SetTimer, second_beep, 80000

return

 

first_beep:

SoundBeep, 2000, 150 ; 150 is the default sound duration

return

 

second_beep:

SoundBeep, 1000, 150 ; 150 is the default sound duration

return

 

Edit: Use Jackie's code based on your edit.



steven01
  • New members
  • 3 posts
  • Last active: Oct 13 2015 06:49 AM
  • Joined: 12 Oct 2015

that's what I tried first, but it will beep (for example) after 50 seconds,then after 100 seconds (1 minute and 40 seconds).

I need it to beep always 10 seconds before the full minute (50 seconds,110 seconds and so on).

The same for the other timer (80 seconds,170 seconds,etc).

the first powerup spawns every minute,like 1 min,2 mins,3 mins etc.

The second powerup spawns every 1 minute and a half, like 1.5 mins 3 mins,4.5 mins etc.

 

I would like the beep to alert me 10 seconds before the spawn for each powerup



Jackie Sztuk _Blackholyman
  • Spam Officer
  • 3757 posts
  • Last active: Apr 03 2016 08:47 PM
  • Joined: 28 Feb 2012
✓  Best Answer
#Persistent
SetTimer, first_beep, -50000
SetTimer, second_beep, -80000
return
 
first_beep:
SetTimer, first_beep, -60000
SoundBeep, 2000, 150 ; 150 is the default sound duration
return
 
second_beep:
SetTimer, second_beep, -90000
SoundBeep, 1000, 150 ; 150 is the default sound duration
return

Helping%20you%20learn%20autohotkey.jpg?d

[AHK] Version. 1.1+ [CLOUD] DropBox ; Copy [WEBSITE] Blog ; About

steven01
  • New members
  • 3 posts
  • Last active: Oct 13 2015 06:49 AM
  • Joined: 12 Oct 2015

lol,was it so easy? Works flawlessy,thank you so much!

 

I didn't think of calling another SetTimer from a SetTimer... I suppose that's why I was struggling so much.

Thanks again!