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


Joined: 27 Jul 2004
Posts: 35

PostPosted: Tue Sep 27, 2022 4:05 pm   

NOPE, REALLY SOLVED NOW: Trigger not iterating properly...
 
ALMOST SOLVED: Had misplaced ImpReport = 0. Figured it out as soon as I hit submit. *laughs*
See second post for new issue with figuring out where to put ImpReport = 0.

Nope, really solved now. Had to add an expression trigger to #WA300 when ImpReport =1 and then turn it off. All the sudden I am thinking of Useless Boxes :D



I have a trigger that colorizes skill display and tracks skill improvements in DartMUD. I am trying to add some functionality to be able to report my character's skills via ooc command (a local ooc say command.)

When I use the report switch, it only reports the first skill and doesn't seem to iterate to report the rest of them. What am I overlooking?


output from "imp report mage":

Code:
language#magic:             Above Average.      [ 32 ]
spell casting:              A Tyro.             [ 2 ]
> You say (OOC), 'Channelling: A Novice [ 9 ]'


"imp" alias (using "imp report mage" syntax)

Code:
<alias name="imp" id="79">
  <value>#SWITCH (%0)
  ("announce on") {AnnounceImp = 1;#SAY %ansi(bold,cyan)%upper("IMPROVEMENT TRACKER: NOW ANNOUNCING IMPROVEMENTS VIA OOC!")%ansi(default)}
  ("announce off") {AnnounceImp = 0;#SAY %ansi(bold,cyan)%upper("IMPROVEMENT TRACKER: NO LONGER ANNOUNCING IMPROVEMENTS VIA OOC!")%ansi(default)}
  ("report") {ReportImp = 1;show skills}
  ("report fighter") {ReportImp = 1;show skills fighter}
  ("report mage") {ReportImp = 1;show skills mage}  <<<< (Added for clarity)
  ("report crafts") {ReportImp = 1;show skills crafts}
  ("help") {}
  {}
 
 
//#IF (@debugMode = TRUE) {#SAY DEBUG: Resetting ~@jobTrackDB.Janya to 0!}</value>
</alias>


Trigger which fires on skill output:

Code:
<trigger priority="450" repeat="true" prompt="true" id="45">
  <pattern>^(*){^ }{^exit}{^exits}{^characters}{^say}{^says}{^teach}{^you}{^show}~:(%s)(*)~.*{^~<}</pattern>
  <value><![CDATA[$skill = %1
$whitespace1 = %2
$level = %3
$rangecolor = "default"
$points = %int(@SkillDB.%string($skill))
$level_len = %len($level)
$next_level = %int(%iskey(@SkillLevels,%string($level))) + 1


//Colorize skill based on level value ranges.
//Unskilled, Tyro, Novice, Beginner, Poor, Not Very Good, Below Average, Average, Above Average = RED
//Able, Fair, Proficient = Yellow
//Good, Adroid, Very Good = White
//Excellent, An Expert, Superb, A Master = Cyan
#SWITCH (%int(@SkillLevels.%string($level)) >= 0 AND %int(@SkillLevels.%string($level)) <= 134) {$rangecolor = "red"}
  (%int(@SkillLevels.%string($level)) >= 135 AND %int(@SkillLevels.%string($level)) <= 239) {$rangecolor = "yellow"}
  (%int(@SkillLevels.%string($level)) >= 240 AND %int(@SkillLevels.%string($level)) <= 389) {$rangecolor = "white"}
  (%int(@SkillLevels.%string($level)) >= 390 AND %int(@SkillLevels.%string($level)) <= 659) {$rangecolor = "cyan"}
 
#IF (@ReportImp = 0) {#SUB {%concat($skill, ": ", $whitespace1, %ansi(bold,$rangecolor)$level, ". ", %if($level_len <= 9,%char(9)%char(9),%char(9))"[ ", $points, " ]")}} {#GAG}

#IF (@ReportImp = 1) {#SEND %concat("ooc ", %string(%proper($skill)), ": ", $level, " [ ", $points, " ]")}

ReportImp = 0]]></value>
</trigger>
[/code][/code]


Last edited by JRSteensen on Tue Sep 27, 2022 4:19 pm; edited 2 times in total
Reply with quote
JRSteensen
Novice


Joined: 27 Jul 2004
Posts: 35

PostPosted: Tue Sep 27, 2022 4:14 pm   
 
Okay, kinda solved. Removed the ReportImp = 0, and it reports, but then I can't figure out where to put a ReportImp = 0 to disable it after it iterates.
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