  | 
	
	
	
		Kaputchnik Beginner
 
  Joined: 06 Jan 2002 Posts: 28 Location: Sweden
  | 
		
		  
			
			   Posted: Thu Apr 11, 2002 11:55 pm   
  Timer   | 
			 
			
				Is it possible to count up instead, say I have a command that puts me in a special state for 4 min. With start and stop messages that I can trigger on. Is it possible just to make some alarm to trigger and then stop at the stop pattern. I've looked through the helpfiles but couldn't find anything. I now have created some triggers that count it using the %time function. A bit messy though. Is there some kind of alarm that counts the other way around?
 
 
Cheers,
 
Kaputchnik | 
			 
		  | 
	
	
	  | 
		  
		 | 
	
	
		  | 
	
	
		Buba Newbie
 
  Joined: 01 May 2002 Posts: 0
 
  | 
		
		  
			
			   Posted: Fri Apr 12, 2002 3:23 am      | 
			 
			
				You could try looking in the help files for the #ALARM command, this might be better than the timer in your situation.
  | 
			 
		  | 
	
	
	  | 
		  
		 | 
	
	
		  | 
	
	
		LightBulb MASTER
 
  Joined: 28 Nov 2000 Posts: 4817 Location: USA
  | 
		
		  
			
			   Posted: Fri Apr 12, 2002 3:51 am      | 
			 
			
				I'm not at all clear on what you are trying to do, which makes answering difficult. If you want a 4 minute, one-time alarm that's easy.
 
 
#AL +4:00 {#SAY done}
 
 
Of course, if you get start and stop messages for the special state it would be more accurate to trigger on those.
 
 
LightBulb
 
Vague questions get vague answers   | 
			 
		  | 
	
	
	  | 
		  
		 | 
	
	
		  | 
	
	
		TonDiening GURU
  
  Joined: 26 Jul 2001 Posts: 1958 Location: Canada
  | 
		
		  
			
			   Posted: Fri Apr 12, 2002 3:52 am      | 
			 
			
				Give the 
 
#ALARM 
 
an id so you can 
 
#UNTRIGGER id 
 
 
To stop it if need be.
 
 
Ton Diening | 
			 
		  | 
	
	
	  | 
		  
		 | 
	
	
		  | 
	
	
		Kaputchnik Beginner
 
  Joined: 06 Jan 2002 Posts: 28 Location: Sweden
  | 
		
		  
			
			   Posted: Fri Apr 12, 2002 12:03 pm      | 
			 
			
				Not quite what I had in mind. The time of the state I get differs and I like to calculate the duration.
 
 
For example:
 
You start berserking.
 
start counting...
 
about 4 min pass
 
You stop berserking.
 
and the alarm/trigger should count the time that went by.
 
 
Something like a stopwatch start it when I start my berserk and end it when I stop my berserk. And then display the duration.
 
 
Cheers,
 
Kaputchnik | 
			 
		  | 
	
	
	  | 
		  
		 | 
	
	
		  | 
	
	
		Kjata GURU
  
  Joined: 10 Oct 2000 Posts: 4379 Location: USA
  | 
		
		  
			
			   Posted: Fri Apr 12, 2002 12:32 pm      | 
			 
			
				The best way is with the pre-defined variable %secs. You can do:
 
#TRIGGER {You start berserking.} {#VAR start %secs}
 
#TRIGGER {You stop berserking.}
 
{#SAY You berserked for %eval((%secs - @start)/1000) seconds.}
 
 
Kjata | 
			 
		  | 
	
	
	  | 
		  
		 | 
	
	
		  | 
	
	
		| 
		
		 | 
	
	
		 |