 |
tapi0 Newbie
Joined: 06 Jun 2004 Posts: 3
|
Posted: Sun Jun 06, 2004 2:16 pm
Needing help for scripting |
How i get this work in zmud v7.x?
timer currenttime
#math tmptime @currenttime-@%1
#math tmpmin @tmptime/60
#math tmpsek @tmptime-(@tmpmin*60)
#if (@tmpmin=0) {#var timed @{tmpsek}s} {#var timed [@{tmpmin}m @{tmpsek}s]} |
|
|
|
 |
tapi0 Newbie
Joined: 06 Jun 2004 Posts: 3
|
Posted: Sun Jun 06, 2004 2:20 pm |
Thats alias.
Ps. There isn't edit button anywhere? |
|
|
|
 |
LightBulb MASTER
Joined: 28 Nov 2000 Posts: 4817 Location: USA
|
Posted: Sun Jun 06, 2004 6:16 pm |
The Aliases button puts you in the Settings Editor, where you may edit any alias you select. There is no need for an Edit button.
The current time in seconds may be obtained from either of two system variables
%ctime - this is the number of seconds you have been connected to the MUD
%secs - this is the number of milliseconds since midnight. It would need to be divided by 1000 to provide the number of seconds
%ctime would be the easiest to work with as long as the timed period will start and end in the same session.
#VAR currenttime %ctime
You can simplify your formulas slightly by using modulo division.
#MATH tmpsek (@tmpmin60) |
|
|
|
 |
tapi0 Newbie
Joined: 06 Jun 2004 Posts: 3
|
Posted: Sun Jun 06, 2004 9:29 pm |
First: I was meaning this forum with edit button
Second: That script I pasted is working with zmud 6.x
Heres another alias script, named as timer (timer currenttime)
#math %1 (%time( yyyy)-1970)*365*24*60*60)
#math %1 @%1+(%time( m)*30*24*60*60)
#math %1 @%1+(%time( d)*24*60*60)
#math %1 @%1+(%time( h)*60*60)
#math %1 @%1+(%time( n)*60)
#math %1 @%1+%time( s) |
|
|
|
 |
LightBulb MASTER
Joined: 28 Nov 2000 Posts: 4817 Location: USA
|
Posted: Mon Jun 07, 2004 3:56 am |
Ah. The Edit button is the one with the pencil.
If it was working before, and isnt' working now, please describe what part isn't working and include all relevant aliases and triggers. I don't see anything in either alias which shouldn't work. With the inclusion of the second alias, we now know how @currenttime is calculated but still don't have any hint of what %1 is in the first alias or what value would be in the variable it references.
@timed is either seconds or minutes and seconds. It seems unlikely you would need to track years, months, and days to calculate a variable which doesn't even include hours. However, if you are going to go to such lengths you should probably adjust your calculations to account for 28, 29, and 31 day months and 366 day years. |
|
|
|
 |
|
|
|