|
asler243 Newbie
Joined: 12 Jun 2006 Posts: 4
|
Posted: Sat Dec 16, 2006 6:17 pm
Question on status bar for Dragonrealms |
Trying to setup my roundtime and hands display on the status bar of Cmud. The triggers and stuff work in zMud and they somewhat work in cMud. The RT triggers I got from the ZMud forum and the statusbar I got from the DR forums.
Code: |
#TRIGGER {Q} {} "" {gsl}
#COND {q} {roundtime = %eval(%gsl(Q)-%gsl(q));gaugemax=@roundtime} {gsl}
#TRIGGER (@roundtime>0) {}
#COND {} {#ADD roundtime -1} {wait|param=1000}
#STAT {%ansi(bold)RT: %ansi(high,red)@roundtime %ansi(bold,black)Left: %ansi(high,red)@lefthand %ansi(bold,black)Right: %ansi(high,red)@righthand} |
It initally updates the roundtime variable but does not countdown like it does in zMud. I read that cMud is stricter on the syntax but in the meantime, I will work on it.
Thanks,
Jack |
|
|
|
hogarius Adept
Joined: 29 Jan 2003 Posts: 221 Location: islands.genesismuds.org
|
Posted: Sat Dec 16, 2006 10:12 pm |
I play Modus Operandi. I had to rework my roundtime gauge to get it to work. Here is what I did.
First, set up an #alarm that continuously counts seconds:
#alarm 1 clock=count+1
--This causes the variable @clock to increment by 1 each second.
Next, rework the gsl(Q) and gsl(q) triggers:
#trigger {Q} {} "" {gsl}
#cond {q} {roundmax=%gsl(Q)-%gsl(q);roundtime=@roundmax;EndClock=@Clock+@roundmax} "" {gsl}
Make sure you go into the setting editor and mark the checkbox for Case Sensitive on both of these triggers. (I'm not sure how to do it on the command line, to be honest. I create my triggers in the GUI interface.) Note that in the second trigger state, the value of @EndClock, which is when the roundtime should end, is set to be the current @Clock value plus the value of @roundmax.
Now for the business part:
#alarm 1 {roundtime=(@EndClock-@clock);#if (@roundtime<0) {roundtime=0}}
Every second, this #alarm trigger changes @roundtime to equal @EndClock minus the current @Clock value. This should result in your status bar display updating every second to show the current remaining roundtime. The #if statement is for when @clock clicks past the @EndClock value (that is, when the round time is over), so that you do not end up with negative numbers appearing in your roundtime display.
I have some more stuff to help stabilize and self-correct my round-time gauge, but that should get you started. Let me know how this works for you.
Hogarius |
|
|
|
asler243 Newbie
Joined: 12 Jun 2006 Posts: 4
|
Posted: Tue Dec 26, 2006 10:57 pm |
Thanks for posting this. I did not have any luck getting this to work in cMud for DR either. When I checked the contents of the variable <clock> it was showing it had a valuse of <count+1>. Not sure if I need a variable count, I am going to mess around with it over new year's. Thanks again for posting the above.
Jack |
|
|
|
hogarius Adept
Joined: 29 Jan 2003 Posts: 221 Location: islands.genesismuds.org
|
Posted: Sat Dec 30, 2006 3:57 pm |
I screwed up on that trigger. (I've been away from the computer over the holidays. I apologize for not responding sooner.)
The alarm trigger should read:
#alarm 1 clock=@clock+1
I think you'll see that makes more sense. : / |
|
|
|
Wrens Novice
Joined: 01 Jun 2003 Posts: 32 Location: USA
|
Posted: Wed Feb 07, 2007 12:02 am |
I did post something to this effect some time ago. I was using
Code: |
#TRIGGER (@roundtime>0) {} "DragonRealms"
#COND {} {#ADD roundtime -1} {wait|param=1000} |
for a countdown on a gauge button.
Zugg made this reply.
Quote: |
Your trigger:
Code:
#TRIGGER (@roundtime>0) {} "DragonRealms"
will fire in CMUD whenever the @roundtime variable is changed. However, in CMUD right now you can't have expression triggers in multi-state triggers...it doesn't fire the other states properly.
Also, I noticied the the #COND command doesn't work properly when the pattern is empty. It thinks this is the ID field for the #COND instead of a blank pattern. I've added both of these issues to the bug list. |
Wrens |
|
|
|
Wrens Novice
Joined: 01 Jun 2003 Posts: 32 Location: USA
|
Posted: Sun Jun 03, 2007 5:16 pm Found a fix |
If someone is still following this post, remember I was having trouble with a countdown timer for roundtime. I thought up a fix and it seems to work very well.
Code: |
#TRIGGER {Q} {} "" {gsl}
#COND {q} {
@roundtime = %eval( %gsl( Q)-%gsl( q))
gaugemax=@roundtime
#while (@roundtime >0) {#wait 1000;#add roundtime -1}
} {gsl}
|
The gauge works just fine now.
Wrens |
|
|
|
|
|