Register to post in forums, or Log in to your existing account
 

Play RetroMUD
Post new topic  Reply to topic     Home » Forums » CMUD General Discussion
TiJay
Beginner


Joined: 15 Aug 2004
Posts: 13

PostPosted: Fri Mar 20, 2009 7:28 pm   

somethings is up with my counter, now...
 
I got it working in the other windows, but for some reason, it's not working in this one....

Code:

#TRIGGER {^You receive (%d) experience points.} {#ad exp %1;#ad netxp %1;#ad cnt 1} {runcounter}

#TRIGGER {^You attempt to bash} {#ad bash 1;stand} {runcounter}

#TRIGGER {^You bash into (%*) goes down!} {#ad bash 1;#ad sucbash 1} {runcounter}

#TRIGGER {^You throw (%*) to the ground!} {#ad throw 1;#ad sucthrow 1;#hi} {runcounter}

#TRIGGER {^You trip (%*) goes down!} {#ad trip 1;#ad suctrip 1} {runcounter}

#TRIGGER {^You try to grab a hold, but miss!} {#ad throw 1} {runcounter}

#TRIGGER {^You successfully rescue} {#ad rescue 1;#ad sucrescue 1} {runcounter}

#TRIGGER {^You sweep, but they are just a little too quick for you.} {#ad trip 1} {runcounter}

#TRIGGER {^You fail to rescue} {#ad rescue 1} {runcounter}

#TRIGGER {^You successfully rescue} {#ad rescue 1;#ad sucrescue 1} {runcounter}

#TRIGGER {^Your tail whacks (%*) in the head! They are stunned} {#ad tail 1} {runcounter}

#TRIGGER {^Death sucks (%*) experience points from you as payment for resurrection.} {#ad death 1;#ad deathloss %1;#ad exp -%1} {runcounter}

#TRIGGER {^You flee (%*)! What a COWARD! You lose (%d) exps!} {#ad netxp -%2;#ad fleexp %2} {runcounter}

#TRIGGER {^You couldn't get away!  You lose (%d) exps.} {#ad netxp -%1;#ad fleexp %1} {runcounter}

#TRIGGER {^You recall from combat!  You lose (%d) exps.} {#ad netxp -%1;#ad fleexp %1} {runcounter}

#TRIGGER {^You failed!  You lose (%d) exps.} {#ad netxp -%1;#ad fleexp %1} {runcounter}

#TRIGGER {^You are (%*) and a worshipper of (%x).} {#var worship %2} {runcounter}

#TRIGGER {^You are (%*) and a devoted worshipper of (%x).} {#var worship %2} {runcounter}

#TRIGGER {^Your gain is: (%d)/(%d) hp, (%d)/(%d) m, (%d)/(%d) mv (%d)/(%d) prac.} {#ad lev 1;emote increases in power!!  |by|%1 |y|hps|n|, |br|%3 |r|mana|n|, |bw|%7 |w|practices|n|.} {runcounter}

#VAR worship {Snikt}

#ALIAS runreport {get_color;gtell |bk|This run, |@bclr|@worship |bk|gave me: |@bclr|@exp |bk|xp, |@bclr|@cnt |bk|kills, |@bclr|@lev |bk|level(s).;#if {@death=0 && @fleexp=0} {} {gtell |bk|I've lost %if( @death!=0, ~|@bclr~|@deathloss ~|bk~|xp ~|bk~|by ~|@bclr~|@death ~|bk~|death~(s~))%if( @death!=0 and @fleexp!=0, ~|bk~| ~and ~|bk~|)%if( @fleexp!=0, ~|@bclr~|@fleexp ~|bk~|xp from fleeing ~and~/~or recalling) so my net gain is |@bclr|@netxp|bk| xp.};stats}

#ALIAS stats {#if {@bash=0 && @trip=0 && @throw=0 && @rescue=0 && @tail=0} {} {gtell %if( @bash!=0, ~|bk~| Bashes: ~|@bclr~|@sucbash~|@bclr~|~/~|@bclr~|@bash)%if( @trip!=0, ~|bk~| Trips: ~|@bclr~|@suctrip~|bk~|~/~|@bclr~|@trip)%if( @throw!=0, ~|bk~| Throws: ~|@bclr~|@sucthrow~|bk~|~/~|@bclr~|@throw)%if( @rescue!=0, ~|bk~| Rescues: ~|@bclr~|@sucrescue~|bk~|~/~|@bclr~|@rescue)%if( @tail!=0, ~|bk~| Tails: ~|@bclr~|@tail) ~|w~|}}

#ALIAS get_color {#var colors {y|g|b|r|c|p};#var bright_colors {by|bg|bb|br|bc|bp};#ad ccc 1;#if (@ccc>%numitems(@colors)) {#var ccc 1};#var clr %item(@colors,@ccc);#var bclr %item(@bright_colors,@ccc)}

#ALIAS resetrun {#var exp 0;#var cnt 0;#var lev 0;#var bash 0;#var sucbash 0;#var trip 0;#var suctrip 0;#var throw 0;#var sucthrow 0;#var rescue 0;#var sucrescue 0;#var death 0;#var deathloss 0;#var netxp 0;#var fleexp 0;#var tail 0;#ec --- Resetting counters ---}



The error is somewhere in this line...something to do with the #IF command...
#ALIAS runreport {get_color;gtell |bk|This run, |@bclr|@worship |bk|gave me: |@bclr|@exp |bk|xp, |@bclr|@cnt |bk|kills, |@bclr|@lev |bk|level(s).;#if {@death=0 && @fleexp=0} {} {gtell |bk|I've lost %if( @death!=0, ~|@bclr~|@deathloss ~|bk~|xp ~|bk~|by ~|@bclr~|@death ~|bk~|death~(s~))%if( @death!=0 and @fleexp!=0, ~|bk~| ~and ~|bk~|)%if( @fleexp!=0, ~|@bclr~|@fleexp ~|bk~|xp from fleeing ~and~/~or recalling) so my net gain is |@bclr|@netxp|bk| xp.};stats}
Reply with quote
calesta
Apprentice


Joined: 07 Dec 2008
Posts: 102
Location: New Hampshire, USA

PostPosted: Fri Mar 20, 2009 7:46 pm   
 
Your #if command has the wrong syntax... you are using {@death=0 && @fleexp=0} instead of (@death=0 && @fleexp=0).
Reply with quote
Rahab
Wizard


Joined: 22 Mar 2007
Posts: 2320

PostPosted: Fri Mar 20, 2009 11:25 pm   
 
Yes, I think this is another case where zmud wasn't strict about enforcing the correct syntax.
Reply with quote
TiJay
Beginner


Joined: 15 Aug 2004
Posts: 13

PostPosted: Fri Mar 20, 2009 11:47 pm   
 
I've changed all of my triggers for #ad to #var with %eval()...but now it doesn't add properly...

#tr {^You flee (%*)! What a COWARD! You lose (%d) exps!}
#var netxp %eval(@netxp - %2)
#var fleexp %eval(@fleexp + %2)

when i tested it, i fled twice from a mob, once lost 28 xp, and once 29, but both the @netxp and @fleexp only show for the 29xp loss...

I'm having issues with *ALL* of them with this code, so that tells me i'm doing the same thing wrong in every one of them...probably about 2 dozen total
Reply with quote
Dumas
Enchanter


Joined: 11 Feb 2003
Posts: 511
Location: USA

PostPosted: Sat Mar 21, 2009 3:52 am   
 
Hmm, you need to show the rest of this. And if you could, switch to the xml tab and copy what is there over here. Makes it a little easier for us to copy it to test out.

I did test this trigger in a blank session and it worked as it should. I set netxp to 100 and fleexp to 0.
#SHOW You flee jim! What a COWARD! You lose 40 exps!
netxp was then 60 and fleexp was 40.

So the trigger is working correctly. But you are obviously missing some functionality that you are expecting.

EDIT: Oops, I'm using 3.05. Can someone be sure this trigger is firing properly in the latest public version?
Reply with quote
TiJay
Beginner


Joined: 15 Aug 2004
Posts: 13

PostPosted: Mon Mar 23, 2009 1:32 am   
 
Code:

<trigger priority="2950" id="295">
  <pattern>^You bash into (%*) goes down!</pattern>
  <value>#var bash %eval(@bash + 1)
#var sucbash %eval(@sucbash + 1)</value>
</trigger>
Reply with quote
Rahab
Wizard


Joined: 22 Mar 2007
Posts: 2320

PostPosted: Mon Mar 23, 2009 3:51 pm   
 
That code is working fine for me. One thing to note is that you probably don't want %* in your trigger--you probably mean *.
Reply with quote
Display posts from previous:   
Post new topic   Reply to topic     Home » Forums » CMUD 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