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
zema
Wanderer


Joined: 22 Jun 2005
Posts: 79

PostPosted: Tue Jun 28, 2005 4:08 pm   

timer assistance
 
ok what i wanna do now is my own little timer based off of when an ability starts and stops when it ends i wanna do it with the #ST command
i know a timer is somthing really simplistic i just dont get how i should go about starting this. This is what i want to make the timer start

"With Your words, you inspire yourself with strength"

#ST{Praise:@seconds :@mins}

"You are no longer inspired" to stop the timer

assuming i have this right i need to set the values for the seconds and mins being like 60 seconds = one min but how do i get the timer to know the concept of a "second"? I could be over thinking this, and it's going over my head... reason i wanna do it this way is the spells timers change alot when you level whatever stat needed and if you level the ability more as well..
_________________
There are 3 things i hate kids, animals, and women with attitudes..
Reply with quote
MattLofton
GURU


Joined: 23 Dec 2000
Posts: 4834
Location: USA

PostPosted: Wed Jun 29, 2005 1:04 am   
 
Probably your best bet is to use %ctime. %ctime is a counter-in-seconds of how long you are connected, which by itself isn't very useful for most things. However, by saving %ctime to a variable in your start trigger and then saving it to another variable the stop trigger you can then do a simple subtraction and finally convert the result to an hour:minute:second format.

#trigger {With Your words, you inspire yourself with strength} {Praisestart = %ctime}
#trigger {You are no longer inspired} Praiseend = %ctime;do calculations here}
_________________
EDIT: I didn't like my old signature
Reply with quote
zema
Wanderer


Joined: 22 Jun 2005
Posts: 79

PostPosted: Wed Jun 29, 2005 2:08 am   
 
yeaa but i have been so successful in doing alot of the things i wanna do i really think i can do this this is what i have so far...if you can help that would be super, but also dont get me wrong i have been learning alot from my past questions asked otherwise i would not even be attempting this.

#TRIGGER With your words you inspire yourself with strength

@PRAISEON = 1
@PRAISEOFF = 0
#IF (@PRAISEON = 1) {#ST Praise: seconds: @seconds}
#UNTIL "You are no longer inspired"
@PRAISEON = 0
@PRAISEOFF = 1

#TRIGGER You are no longer inspired

@PRAISEON = 0
@PRAISEOFF = 1
#UNTIL "With your words, you inspire yourself with strength"
@PRAISEON = 1
@PRAISEOFF = 0

the problem i am having is zmud is always saying that the praise on value is =1 (on) even after the spell wears off, and everything is ok with the pattern matching so i dont know whats wrong..
_________________
There are 3 things i hate kids, animals, and women with attitudes..
Reply with quote
charneus
Wizard


Joined: 19 Jun 2005
Posts: 1876
Location: California

PostPosted: Wed Jun 29, 2005 2:44 am   
 
That might be because you have two variables, praiseon, and praiseoff, and you're only checking for 1. Just set one variable. Don't switch like you have it.

@PRAISEON = 1
#IF (@PRAISEON = 1) {#ST Praise: seconds: @seconds}
#UNTIL "You are no longer inspired"
@PRAISEON = 0

So, try that out. Don't know if it'll work... I'm just pointing out a flaw in your code design.

Charneus
Reply with quote
zema
Wanderer


Joined: 22 Jun 2005
Posts: 79

PostPosted: Wed Jun 29, 2005 2:58 am   
 
perfectally fine i wanna know this thanks :) i just wanna get the variables to switch right
_________________
There are 3 things i hate kids, animals, and women with attitudes..
Reply with quote
zema
Wanderer


Joined: 22 Jun 2005
Posts: 79

PostPosted: Wed Jun 29, 2005 3:25 am   
 
-double post
_________________
There are 3 things i hate kids, animals, and women with attitudes..
Reply with quote
zema
Wanderer


Joined: 22 Jun 2005
Posts: 79

PostPosted: Wed Jun 29, 2005 5:41 am   
 
update however there is some design flaw the @second variable wont move from 0 however the @praise variable is adjusting now suggestions? Also i know currently there is no turn off trigger i just wanna get the @second variable to work.

#TRIGGER :With Your words, you inspire yourself with strength!
praise = 1
#IF (@praise =1) {#st Praise: @seconds}
#while (@praise =1) {#ADD 1 @seconds}
#UNTIL {You are no longer inspired}
_________________
There are 3 things i hate kids, animals, and women with attitudes..
Reply with quote
Aarlot
Adept


Joined: 30 Dec 2003
Posts: 226

PostPosted: Wed Jun 29, 2005 6:18 am   
 
I think you're misunderstanding how the #UNTIL works. It doesn't keep going until the until is received, it does almost the exact same thing that #WHILE does. #WHILE repeats commands until the expression is true, #UNTIL repeats commands until the expression is NOT true.
_________________
Everyone is entitled to their beliefs - until they die. Then only the truth matters.
Reply with quote
zema
Wanderer


Joined: 22 Jun 2005
Posts: 79

PostPosted: Wed Jun 29, 2005 3:16 pm   
 
I see, thanks.
_________________
There are 3 things i hate kids, animals, and women with attitudes..
Reply with quote
zema
Wanderer


Joined: 22 Jun 2005
Posts: 79

PostPosted: Wed Jun 29, 2005 5:01 pm   
 
Timer
#VAR PraiseStart {0} {0}
#TR {With Your words, you inspire yourself with strength!} {PraiseStart=%ctime}
#TR {You are no longer inspired.} {Praisedur=%eval((%ctime-@PraiseStart));PraiseStart=0}

Statusline code
#ST [Praise:@Praisedur

I went though alot of the tutorials found one that works, but i noticed variables wont show up as they increase or decrease on the status line is there a way to make this happen?
_________________
There are 3 things i hate kids, animals, and women with attitudes..
Reply with quote
zema
Wanderer


Joined: 22 Jun 2005
Posts: 79

PostPosted: Wed Jun 29, 2005 6:16 pm   
 
I found a nice one in the past posts props to kjata this is his script

#VAR hours 0
#VAR mins 0
#VAR secs 0
#ALARM {*1} {#ADD secs 1;#IF (@secs >= 60) {#ADD mins 1;#VAR secs 0};
#IF (@mins >= 60) {#ADD hours 1;#VAR mins 0};#IF (@hours >= 24) {#VAR hours 0}}
#STATUS {MUD Time: @hours:@mins}
#ALIAS settime {#VAR hours %1;#VAR mins %2;#VAR secs 0}

now the only thing i have to do is make it start and stop based on when my ability starts and stops.
_________________
There are 3 things i hate kids, animals, and women with attitudes..
Reply with quote
zema
Wanderer


Joined: 22 Jun 2005
Posts: 79

PostPosted: Wed Jun 29, 2005 6:35 pm   heh
 
yeaa..i know i am a pain in the ass heh..anyways i got the timer working however i wanna set it to start and stop when an ability pulls of i know this is done with the trigger command, BUT i have never ever...EVER had problems with triggers...so i have no idea what could be wrong..

pattern: With your words, you inspire yourself with strength!

#ADD secs 1
#IF (@secs >= 60) {
#ADD mins 1
#VAR secs 0
}
#IF (@mins >= 60) {
#ADD hours 1
#VAR mins 0
}
#IF (@hours >= 24) {#VAR hours 0}

I use my ability, it's not working..also in the patten matching box it matches soo...what could i be doing wrong?
_________________
There are 3 things i hate kids, animals, and women with attitudes..
Reply with quote
zema
Wanderer


Joined: 22 Jun 2005
Posts: 79

PostPosted: Wed Jun 29, 2005 7:35 pm   
 
-deleted
_________________
There are 3 things i hate kids, animals, and women with attitudes..
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