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: Fri Jul 01, 2005 1:22 am   

almost completed timer script
 
Timer working!
#CLASS {timer}
#Variable seconds {0}
#Variable mins {0}
#Variable hours {0}
#Variable praisestart {0}

(start the timer as off)#ALARM {*1} {#ADD seconds 1;#IF (@seconds >= 60) {#ADD mins 1;#VAR seconds 0};#IF (@mins >= 60) {#ADD hours 1;#VAR mins 0};#IF (@hours >= 24) {#VAR hours 0}}
#STATUS {Praise: @hours:@mins:@seconds}


#Trigger {castmessage} #T+ *1
#Trigger {wearoffmessage} #T- *1
#Alias resettimer @seconds = 0
@mins = 0
@hours = 0
#Alias stoptimer #T- *1
_________________
There are 3 things i hate kids, animals, and women with attitudes..
Reply with quote
zema
Wanderer


Joined: 22 Jun 2005
Posts: 79

PostPosted: Fri Jul 01, 2005 1:29 am   
 
However I noticed there is no #subtract command I was gonna reverse the timer and set it to trigger when my ability was casted so it would count down from the moment i casted this is my ability message i wanna trigger off of

casting message With Your words, you inspire yourself with strength!
wearoff message You are no longer inspired.

then this is my status window code
#STW Praise: @pramins:@praseconds help would be appreated :)
_________________
There are 3 things i hate kids, animals, and women with attitudes..
Reply with quote
zema
Wanderer


Joined: 22 Jun 2005
Posts: 79

PostPosted: Fri Jul 01, 2005 4:55 am   
 
I actually got everything working now...nothing wants to work
#Trigger {castmessage} #T+ *1
#Trigger {wearoffmessage} #T- *1
those triggers wont work anymore someone wanna tell me why...cause this program is on my last nerve...
_________________
There are 3 things i hate kids, animals, and women with attitudes..
Reply with quote
Vitae
Enchanter


Joined: 17 Jun 2005
Posts: 673
Location: New York

PostPosted: Fri Jul 01, 2005 12:59 pm   
 
It's the kids, animals and women with attitudes..They are all conspiring against you.
I am not sure how you are doing this.
But rather than have castmessage in the trigger field you should have the actual msg from the mud.
Same for the wearoffmessage.
Unless you just put them there as a placeholder in your post rather than the actual msgs.
_________________
http://www.Aardwolf.com
Reply with quote
Orang
Apprentice


Joined: 22 Jul 2004
Posts: 118
Location: USA

PostPosted: Fri Jul 01, 2005 2:47 pm   
 
well i have one from a friend that works *perfectly*. i would post it but i dont think he'd appreciate me distributing it.. i can ask if though
Reply with quote
shalimar
GURU


Joined: 04 Aug 2002
Posts: 4690
Location: Pensacola, FL, USA

PostPosted: Fri Jul 01, 2005 7:59 pm   
 
Just add a negative number
_________________
Discord: Shalimarwildcat
Reply with quote
zema
Wanderer


Joined: 22 Jun 2005
Posts: 79

PostPosted: Fri Jul 01, 2005 11:07 pm   
 
Of corse i have the actual message in there i just wanted to make it easy so other people could use it if they wanna...now i got a question well 2 questions rather i open my class folder, copy and paste my code click save it takes everything i just copied and pasted...and takes it away..does this several times..2 #t- (trigger name) or #t+ (trigger name) turns off and on whatever trigger right? I just wanna make shure my understanding is correct...
_________________
There are 3 things i hate kids, animals, and women with attitudes..
Reply with quote
zema
Wanderer


Joined: 22 Jun 2005
Posts: 79

PostPosted: Fri Jul 01, 2005 11:11 pm   
 
Oh, and yes i put negative values it WAS all working fine..then stopped...actually also can you assign the same trigger twice IF you 1)put it in a seperate class folder 2) if you turn off the right folders like timer is class one and countdown timer is class 2
_________________
There are 3 things i hate kids, animals, and women with attitudes..
Reply with quote
Guinn
Wizard


Joined: 03 Mar 2001
Posts: 1127
Location: London

PostPosted: Fri Jul 01, 2005 11:34 pm   
 
What is it you're trying to achieve with the class? Are you just wanting to time how long it takes for an effect to wear off?
I can dig out an old alias that'll do that if you need it.
_________________
CMUD Pro, Windows Vista x64
Core2 Q6600, 4GB RAM, GeForce 8800GT
Because you need it for text... ;)
Reply with quote
zema
Wanderer


Joined: 22 Jun 2005
Posts: 79

PostPosted: Fri Jul 01, 2005 11:54 pm   
 
Yes with 1 timer i want to time how long abilities mind you in the higher levels abilities last like 10-30 mins depending on your status then use that to record the values for seconds mins hours take that data and make a countdown timer in the statuswindow like if i cast blah the timer will go down from 2 mins, and i can tell exactally when it wears off
_________________
There are 3 things i hate kids, animals, and women with attitudes..
Reply with quote
zema
Wanderer


Joined: 22 Jun 2005
Posts: 79

PostPosted: Sat Jul 02, 2005 12:01 am   
 
#TR [timsttr] With Your words, you inspire yourself with strength! #T+ *1 ok i copy this and paste it into the command box or whatevever you wanna call it..it does this

1) makes a folder called words,
2)In that folder makes a trigger called with
3)Then gives it the value Your..

now if i am doing somthing wrong someone please tell me cause i am following the helpfiles commands...on that note i am leaving to go play a ps2 game for awhile cause zmud is driving me nuts...
_________________
There are 3 things i hate kids, animals, and women with attitudes..
Reply with quote
Vijilante
SubAdmin


Joined: 18 Nov 2001
Posts: 5182

PostPosted: Sat Jul 02, 2005 1:30 am   
 
zMud is very smart, but it is not a mind reader, it uses spaces as arguement seperators, This can be overridden by a number of different grouping characters such as "{<([])>}". The correct characters to use for a given situation have never been fully explained, but the short of it is: use "" when you want the arguement to be taken literally and use {} when you want it to be subject to the expansion and evaluation preformed by that command. The use of <> and [] is controllable by preference options, these explicitly force expansion and evalution respectively. Meaning that they are used to override the behavior of how a command treats its arguments. For example #TRIGGER treats all its agruments litterally, meaning no expansion or evaluation is preformed.

The syntax for #TRIGGER is very simple. First a small explanation of symbols commonly used in help; [word] indicates an optional argument of "word", zMud also allows commands to be abbrieviated, this is indicated by the underlined letters in the help. In all cases the help tries to inform you what that arguement is used for and its expected type.

The syntax for #TRIGGER is:
#TRIGGER [id] pattern commands [class] [option list]

The specifics of parsing in your example are:
1. Locate full line.
#TR [timsttr] With Your words, you inspire yourself with strength! #T+ *1
2. Check for immediate expansion and evaluation items
[timsttr] found, evaluates to "timsttr"
3. Parse line
#TR "timsttr" With Your words, you inspire yourself with strength! #T+ *1
Found command #TR equals #TRIGGER takes 2 arguements with 3 optionals...
Five arguements found all options used...
ID=timsttr
Pattern=With
Commands=Your
Class=words,
OptionList=you inspire yourself with strength! #T+ *1
4. Creates the trigger based on the specified arguements
Class ',' not valid in a class name "words," stripped to "words"
OptionList "you inspire yourself with strength! #T+ *1" contains no valid options, all ignored.

Since zMud can't read your mind you have to tell it what you want to be each arguement. This is done with braces or quotes.
#TR "timsttr" {With Your words, you inspire yourself with strength!} {#T+ *1}
Now it sees 3 arguments and makes the educated guess that they should be:
ID=timsttr
Pattern=With Your words, you inspire yourself with strength!
Commands=#T+ *1
_________________
The only good questions are the ones we have never answered before.
Search the Forums
Reply with quote
zema
Wanderer


Joined: 22 Jun 2005
Posts: 79

PostPosted: Sat Jul 02, 2005 4:32 am   I see...
 
I took the helpfile literal with the syanax
#TRIGGER [id] pattern commands [class] [option list]

As in #Trigger [name of trigger] pattern the mud needs to read [optional class] and [optional option]
_________________
There are 3 things i hate kids, animals, and women with attitudes..
Reply with quote
zema
Wanderer


Joined: 22 Jun 2005
Posts: 79

PostPosted: Sat Jul 02, 2005 5:40 am   
 
I would appreate some help with this coding though i just need to find a way to make my timer code start and stop based on the casting message and wearoffmessage..i am close the timer works but for some reason the #Trigger {castmessage} #T+ *1 dosent wanna work also it is set as an alarm i dont know if that makes a difference but the code for the script i got so far is posted on the first 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: Sat Jul 02, 2005 7:11 am   yet again..
 
Everything seems to be working now..i guess this could be command errors on my part...i will post the finished scripts in a week or so if they continue working.
_________________
There are 3 things i hate kids, animals, and women with attitudes..
Reply with quote
zema
Wanderer


Joined: 22 Jun 2005
Posts: 79

PostPosted: Mon Jul 04, 2005 3:41 pm   Just a bit more help
 
#ALARM {*1} {#ADD seconds -1;#IF (@seconds >= 60) {#ADD mins -1;#VAR seconds 0};#IF (@mins >= 60) {#ADD hours -1;#VAR mins 0};#IF (@hours >= 24)

ok..the #alarm is what is the heart of this trigger, and makes it move however it also chooses the speed the timer moves at so that leads to 2 problems one if i wanna do multiple timers i could do *1 *2*3 but all the timers will move at different speeds. I would like all timers to move at the same speed, and also in the timer the @mins variable never goes down the secods go into - value...so is there an alternate way to program this timer cause i am completely stumped..
_________________
There are 3 things i hate kids, animals, and women with attitudes..
Reply with quote
Orang
Apprentice


Joined: 22 Jul 2004
Posts: 118
Location: USA

PostPosted: Tue Jul 05, 2005 2:57 pm   
 
ok this is a perfect one from a friend who made it years ago but doesnt mud anymore

Code:
#CLASS {PrivateScripts|raveTimer}
#ALIAS raveTimer {#SAY;#ECHO %ansi( bold, cyan)RaveTimer;#ECHO %ansi( bold, green)RaveTimer is a timer which displays in real time or mud time how much time has elasped since you last read your watch. There is a secondary timer as well.;#ECHO %ansi( bold, white)* Timer ...... use: timer ~(b, c, s, r~) ...... check timer.;#ECHO %ansi( bold, white)* Timer2 ..... use: timer2 ~(b, c, s, r~) ..... check secondary timer.;#SAY}
#VAR arg {2}
#CLASS 0

#CLASS {PrivateScripts|raveTimer|Timer1}
#ALIAS Timer {#VAR arg {};arg=%lower( %1);#IF (%begins( @arg, "s")) {arg=1};#IF (%begins( @arg, "b")) {arg=2};#IF (%begins( @arg, "c")) {arg=3};#IF (%begins( @arg, "r")) {arg=4};#IF (%1 = "") {arg=5};#IF (%isnumber( @arg)) {#NOOP} {arg=5};#CASE @arg {#VAR time2 {%ctime};#MATH timechecknm ((@time2 - @time1) * 3);#ECHO %ansi( bold, white)Time Msg: %ansi( cyan) Mud Time Elapsed: %eval( @timechecknm/3600)h %mod( @timechecknm/60, 60)m %mod( @timechecknm, 60)s.;#ECHO %ansi( bold, cyan) The timer has stopped.;#VAR timechecknm {};#VAR time1 {};#VAR time2 {}} {#VAR time2 {%ctime};#MATH timechecknm ((@time2 - @time1) * 3);#ECHO @istimechecknm;#ECHO %ansi( bold, white)Time Msg: %ansi( cyan) Mud Time Elapsed: %eval( @timechecknm/3600)h %mod( @timechecknm/60, 60)m %mod( @timechecknm, 60)s.;#ECHO %ansi( bold, white)Time Msg: %ansi( cyan) Timer started.;#VAR time1 {%ctime}} {#VAR time2 {%ctime};#MATH timechecknm ((@time2 - @time1) * 3);#ECHO %ansi( bold, white)Time Msg: %ansi( cyan) Mud Time Elapsed: %eval( @timechecknm/3600)h %mod( @timechecknm/60, 60)m %mod( @timechecknm, 60)s.;#ECHO %ansi( bold, cyan) The timer continues.} {#VAR time2 {%ctime};#MATH timecheckrl (@time2 - @time1);#ECHO %ansi( bold, white)Time Msg: %ansi( cyan) Real Time Elapsed: %eval( @timecheckrl/3600)h %mod( @timecheckrl/60, 60)m %mod( @timecheckrl, 60)s.;#ECHO %ansi( bold, cyan) The timer continues.} {#VAR time2 {%ctime};#MATH timechecknm ((@time2 - @time1) * 3);#ECHO %ansi( bold, white)Time Msg: %ansi( cyan) Mud Time Elapsed: %eval( @timechecknm/3600)h %mod( @timechecknm/60, 60)m %mod( @timechecknm, 60)s.;#ECHO %ansi( bold, cyan) The timer continues.;#ECHO %ansi( bold, cyan)Options: ~(s)top timer, ~(b)egin timer ~(c)ontinue timing or ~(r)eal time. eg: timer s}}
#VAR time1 {16552}
#VAR time2 {16552}
#VAR timechecknm {0} {0}
#VAR timecheckrl {0} {0}
#CLASS 0

#CLASS {PrivateScripts|raveTimer|Timer2}
#ALIAS Timer2 {#VAR arg {};arg=%lower( %1);#IF (%begins( @arg, "s")) {arg=1};#IF (%begins( @arg, "b")) {arg=2};#IF (%begins( @arg, "c")) {arg=3};#IF (%begins( @arg, "r")) {arg=4};#IF (%1 = "") {arg=5};#IF (%isnumber( @arg)) {#NOOP} {arg=5};#CASE @arg {#VAR time2_2 {%ctime};#MATH timechecknm_2 ((@time2_2 - @time1_2) * 3);#ECHO %ansi( bold, white)Time Msg: %ansi( cyan) Mud Time Elapsed: %eval( @timechecknm_2/3600)h %mod( @timechecknm_2/60, 60)m %mod( @timechecknm_2, 60)s.;#ECHO %ansi( bold, cyan) The Secondary Timer has stopped.;#VAR timechecknm_2 {};#VAR time1_2 {};#VAR time2_2 {}} {#VAR time2_2 {%ctime};#MATH timechecknm_2 ((@time2_2 - @time1_2) * 3);#ECHO @timechecknm_2;#ECHO %ansi( bold, white)Time Msg: %ansi( cyan) Mud Time Elapsed: %eval( @timechecknm_2/3600)h %mod( @timechecknm_2/60, 60)m %mod( @timechecknm_2, 60)s.;#ECHO %ansi( bold, white)Time Msg: %ansi( cyan) Secondary Timer started.;#VAR time1_2 {%ctime}} {#VAR time2_2 {%ctime};#MATH timechecknm_2 ((@time2_2 - @time1_2) * 3);#ECHO %ansi( bold, white)Time Msg: %ansi( cyan) Mud Time Elapsed: %eval( @timechecknm_2/3600)h %mod( @timechecknm_2/60, 60)m %mod( @timechecknm_2, 60)s.;#ECHO %ansi( bold, cyan) The Secondary Timer continues.} {#VAR time2_2 {%ctime};#MATH timecheckrl_2 (@time2_2 - @time1_2);#ECHO %ansi( bold, white)Time Msg: %ansi( cyan) Real Time Elapsed: %eval( @timecheckrl_2/3600)h %mod( @timecheckrl_2/60, 60)m %mod( @timecheckrl_2, 60)s.;#ECHO %ansi( bold, cyan) The Secondary Timer continues.} {#VAR time2_2 {%ctime};#MATH timechecknm_2 ((@time2_2 - @time1_2) * 3);#ECHO %ansi( bold, white)Time Msg: %ansi( cyan) Mud Time Elapsed: %eval( @timechecknm_2/3600)h %mod( @timechecknm_2/60, 60)m %mod( @timechecknm_2, 60)s.;#ECHO %ansi( bold, cyan) The Secondary Timer continues.;#ECHO %ansi( bold, cyan)Options: ~(s)top timer, ~(b)egin timer ~(c)ontinue timing or ~(r)eal time. eg: timer s}}
#VAR time1_2 {}
#VAR time2_2 {}
#VAR timechecknm_2 {}
#VAR timecheckrl_2 {27}
#CLASS 0
Reply with quote
zema
Wanderer


Joined: 22 Jun 2005
Posts: 79

PostPosted: Tue Jul 05, 2005 8:21 pm   
 
I appreate the help...but i dont understand that at at...I pritty much have it though the design flaw is it has to be set around alarm 1 so after every second goes by the trigger hits until the wearoff message goes off, and i cant set more than one ability timer at one time cause o cant keep using alarm 1..now the reason this is a big deal is abilities can last upward of 10 mins..I also want to display it in the stw..so what i need is a way for a trigger to repeat it self until the wearoff message pulls the timers work fine everything is displaying ok..this is all i need..help would be appreated
_________________
There are 3 things i hate kids, animals, and women with attitudes..
Reply with quote
zema
Wanderer


Joined: 22 Jun 2005
Posts: 79

PostPosted: Tue Jul 05, 2005 8:22 pm   
 
o..also i fixxed the -1 countdown problem too :)
_________________
There are 3 things i hate kids, animals, and women with attitudes..
Reply with quote
Orang
Apprentice


Joined: 22 Jul 2004
Posts: 118
Location: USA

PostPosted: Thu Jul 07, 2005 2:20 pm   
 
the script i posted works *perfectly*.
just use it.. :)
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