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
Phanku
Novice


Joined: 09 Oct 2003
Posts: 40

PostPosted: Thu Oct 09, 2003 4:04 pm   

Time and estimated time
 
k here goes, please guys be nice this is my first time posting here, I have been using zmud for a bit of time and i know much but not all..and have many questions i would like to throw at you advance zmudders out there.

First question is the one i'm working on, ill post the other questions later.

k on my mud that i play on, there is a thing called repowers which will repower your character, its based on percenatge on the mud so you would see a line like:

Repower: [34%]

The repower number goes from 1%-100% when it hits 100% the mud will send me a message, just a single sentance that doesn't change, and thats what i have set the trigger up to fire on.

K what i want to do, is to first off time the amount of Actual time between the repowers in minutes and seconds(this i already have, which i will post the script for now).

#math difference (%ctime-@lasttime)
#var lasttime %ctime
#math minutes(@difference / 60)
#if (@minutes<1) {#var seconds @difference} {#math seconds (@difference-(@minutes*60))}
#var lastminutes @minutes
#var lastseconds @seconds

k that gives me the amount of time in minutes and second between the repower, now what i want to do is to have a script that will count down the estimated time tell the next repower. I have no clue how to do this, but i will give an example of what i want so you guys can have an idea of what i'm looking for.

Repower: [22%] LRT: 27:45 ERT: 21:32

Repower number would go up, that is the percentage received from the mud, the LRT (last repower time) would not change, tell repower happens(cause its still timming the repowers in case the repower time changes) and ERT (estimate repower time) would be counting down to the next repower..

Any help at all would be helpfull guys...ive been at this one for like 2 days now, and have searched all the forums for a possible solution with no avail.

Phanku
Reply with quote
Anabasis
Wanderer


Joined: 26 Jan 2001
Posts: 74

PostPosted: Thu Oct 09, 2003 4:23 pm   
 
Well, you can dump the total seconds of estimated time into a variable and use a conditional trigger to count it down. After that, it's just a matter of formatting it to look however you want.

#TRIGGER (@esttime>0) {} "" {notrig}
#COND {} {#ADD esttime -1} {wait|param=1000}

Ana
Reply with quote
Phanku
Novice


Joined: 09 Oct 2003
Posts: 40

PostPosted: Thu Oct 09, 2003 4:32 pm   
 
Ok lol, that just confused me ever worse. For one i have never used a #conditional i'm looking it up right now..

And for two i dont understand how that triger is working?

bah i'm just stupid lol, can some one put it in enlish for me?

You probably said it right Ana im just a beginner tho..so that was kind of way over my head.

Phanku
Reply with quote
mr_kent
Enchanter


Joined: 10 Oct 2000
Posts: 698

PostPosted: Thu Oct 09, 2003 4:38 pm   
 
This would be so much easier using the tick timer. This is precisely what the tick timer is for. You can even query the timer and show the results with something like:
#ALIAS showtime {#SH "@lastime |";#T?}
Reply with quote
Phanku
Novice


Joined: 09 Oct 2003
Posts: 40

PostPosted: Thu Oct 09, 2003 4:46 pm   
 
Oh god, i'm still confused...

K guys i have the timmers in my status bar...

And would like them to be in my status bar and be accurate hehe and umm count down on the fly, and perferably work with the script i have or umm...sigh...

okay i dont want to use the tick timer...i dont like that thing. It bugs me, so umm help out a lady heh.. help.

Confused and dazed,
Phanku
Reply with quote
Anabasis
Wanderer


Joined: 26 Jan 2001
Posts: 74

PostPosted: Thu Oct 09, 2003 5:48 pm   
 
Okay, didn't mean to go over your head.

I use this trigger to count down a timer in the game I play, so I know it works. The trigger fires off of a variable. Basically, when the variable is greater than zero, it counts the variable down by one every second. If you have the estimated time in the variable, it will count it down for you. You can display the variable on your status bar, it will show it counting down, and it should work with the script you already have. All you would need to add is something that will put the time you need counted down into the variable.

Kent is correct as well, this is exactly the sort of thing the tick timer was designed for. I should of thought of that, but I use the tick timer for something else myself. It would probably be worth your trouble to look up the info on that in the help files.

Ana
Reply with quote
Phanku
Novice


Joined: 09 Oct 2003
Posts: 40

PostPosted: Thu Oct 09, 2003 6:00 pm   
 
Actually Ana, thanks to you, I do have it up and running.

I'm stubborn so, i kept looking at what you wrote and i got it. WOOT just the way you did. I still dont understand how it works exactly but then again i don't need to. As long as it works..

K got one for you tho..how would i format the seconds into showing...umm how do i say this..hell ill just show you.

This is how it looks on my status bar now.

ERT: 4:23 <--- thats an example and once again it WORKS(U R GOOD!)

but and its a small detail, i can live with it if i can't fix it...
but when the seconds get down to 9 and lower it looks like this.

ERT: 4:3 <--- what i would like to do is to get it to look like
ERT: 4:03

I know i'm picky, hehe. K I have been trying to use the %format function right in the status bar to change it to that format but its just not working right any ideas?

Thanks to Ana,
Not Dazed Phanku
Reply with quote
Anabasis
Wanderer


Joined: 26 Jan 2001
Posts: 74

PostPosted: Thu Oct 09, 2003 7:37 pm   
 
Hmm.. Not sure. I've never had the need to use %format, but looking at the help files, it should work. I think it would be...

%format("&2.0n",@seconds)

Or whatever you're using for the seconds variable.

Ana
Reply with quote
Vijilante
SubAdmin


Joined: 18 Nov 2001
Posts: 5182

PostPosted: Thu Oct 09, 2003 10:40 pm   
 
You have to add a %replace to the %format. The %format function add spaces to establish the width instead of zeros:
%replace(%format("&2.0n",@seconds)," ","0")
Same caveats apply.
Reply with quote
Phanku
Novice


Joined: 09 Oct 2003
Posts: 40

PostPosted: Fri Oct 10, 2003 4:27 pm   
 
God u guys are good...
I just can't believe how fast you respond, and not only that, u all know what ur talking about...

WOOT thanks guys
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