Register to post in forums, or Log in to your existing account
 

Play RetroMUD
Post new topic  Reply to topic     Home » Forums » zMUD General Discussion
nutsnbolts
Apprentice


Joined: 01 May 2002
Posts: 188
Location: USA

PostPosted: Thu May 16, 2002 6:46 pm   

%ctime question.
 
%ctime is the time from when connected. Any other variables available that I can use to just count how many minutes it has passed.

Say when I start an xp counter, it'll start the time. When I report how much xp we have gained lets say in 2 minutes, it'll say automatically I have gained 13313 xp in 2 minutes. Myself not defining the amount of minutes but systematically is captured?



Sup
Reply with quote
Kjata
GURU


Joined: 10 Oct 2000
Posts: 4379
Location: USA

PostPosted: Thu May 16, 2002 8:13 pm   
 
You can use %secs, which is the number of miliseconds since midnight. Example:
#ALIAS xpstart {#VAR start %secs;#VAR xp 0;}
#ALIAS xpstop {#SH You have gained @xp xp in %eval((%secs - @start)/60000) minutes.


Kjata
Reply with quote
nutsnbolts
Apprentice


Joined: 01 May 2002
Posts: 188
Location: USA

PostPosted: Thu May 16, 2002 9:17 pm   
 
I see that you have a variable @start

What is that variable for?

Sup
Reply with quote
Kjata
GURU


Joined: 10 Oct 2000
Posts: 4379
Location: USA

PostPosted: Thu May 16, 2002 9:35 pm   
 
Since %secs will have a different value every time you check it, you must save the value it has when you start the xp counter, and the substract it from the value it has when you stop the xp counter. The difference is the time spent gaining the xp.

Kjata
Reply with quote
LightBulb
MASTER


Joined: 28 Nov 2000
Posts: 4817
Location: USA

PostPosted: Thu May 16, 2002 9:35 pm   
 
Is there any reason this isn't part of your other question?

The only way to know when you started is for you to make a note of the time. The most convenient method for doing so is to store the time (from %ctime or %secs or %time() or some other source) in a variable.

@start is the time when Kjata started counting.

LightBulb
Vague questions get vague answers
Reply with quote
Display posts from previous:   
Post new topic   Reply to topic     Home » Forums » zMUD General Discussion All times are GMT
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum

© 2009 Zugg Software. Hosted by Wolfpaw.net