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

Play RetroMUD
Post new topic  Reply to topic     Home » Forums » CMUD Beta Forum
Tech
GURU


Joined: 18 Oct 2000
Posts: 2733
Location: Atlanta, USA

PostPosted: Thu Oct 26, 2006 9:13 pm   

[1.11] Score Trigger
 
Hey Zugg,

I forgot you asked me to post this. But here is the trigger that keeps failing for me. It was working in the session I manually recreated it, but now it is saying compilation error. PM if you need the original support case number.

One other thing I just noticed, which may help, is that only two of the conditions of this trigger are regular expression triggers. The rest are standard pattern triggers, but in the Package Editor, only the two with Regular Expression said they compiled.

Here's the original code:
Code:
#TRIGGER {+===============================================================+} {}
#COND {|%sScore sheet for the &%w{Race} known as%s|} {}
#COND {|%s-~*  &%w{Name} of &%w{City}  ~*-%s|} {}
#COND {|%s (%d) years, (%d) months and (%d) days %s |} {}
#COND {+===============================================================+} {}
#COND {\|\s*(?HP:\d+)/\s*(?MxHP:\d+) Hit\s*(?M:\d+)/\s*(?MxM:\d+) Mana\s*(?Mv:\d+)/\s*(?MxMv:\d+) Movement\s*(?Practice:\d+) Practices \|} {#IF (@HP <= @MxHP/2) {#GAUGE HP " " @HP @MxHP @Wimpy {} {high,yellow} {high,red}} {#VAR WaHP %eval( @MxHP/2) "" Stats;#GAUGE HP " " @HP @MxHP @WaHP "" "high,green" "high,yellow"}} {regex}
#COND {|%s ~[ Str:&%d{Str}/&%d{MxStr}  Int:&%d{Int}/&%d{MxInt}  Wis:&%d{Wis}/&%d{MxWis}  Dex:&%d{Dex}/&%d{MxDex}  Con:&%d{Con}/&%d{MxCon} ~] %s |} {}
#COND {\|\s+ ((?Class1:\a+):\s?(?Class1Lvl:\d+))? ((?Class2:\a+):\s?(?Class2Lvl:\d+))? ((?Class3:\a+):\s?(?Class3Lvl:\d+))? \s+\|} {#TEMP SecondRow {\|\s+ ((?AdvCls1:\a+):\s?(?AdvCls1Lvl:\d+))? ((?AdvCls2:\a+):\s?(?AdvCls2Lvl:\d+))? \s+\|} {} {regex}} {regex}
#COND {|%s Psuedo level: &%d{PLvl} %s |} {}
#COND {|%s Class Order: (%w) (%w) (%w) %s |} {}
#COND {X========= Exps:%s&%d{XP} ========= Quest Points:%s&%d{QPts} ========X} {}
#COND {|  You are carrying%s &%d{Items}/%s&%d{MxItems} items, weight (%d.%d)/%s &%d{MxWgt} kg.%s|} {}
#COND {|%s Autoexit: ~*({OFF|ON})~* %s Autoloot: ~*({OFF|ON})~* %s Autosac: ~*({OFF|ON})~* %s |} {}
#COND {|%s Autogold: ~*({OFF|ON})~* %s Autoassist: ~*({OFF|ON})~* %s |} {}
#COND {|%s Wimpy Set to &%d{Wimpy} HitPoints.  Page Length is %d lines. %s |} {}
#COND {|%s Drunk:%s(%w)   Thirsty:%s(%w)   Hungry:%s(%w)  %s |} {}
#COND {|%s You have assumed the Stance of the (*). %s |} {#VAR Stance %1}
#COND {|%sYou are (%w).%s|} {}
#COND {|%sArmor Class:%s&%n{AC}.   You are (*).%s|} {}
#COND {|%sHitroll: &%d{HRoll}%sDamroll: &%d{DRoll}%s|} {}
#COND {|%sAlignment:%s (%n).%s You are (%w).%s|} {}
#COND {|%sSaving throws: (%n)%s|} {}
#COND {+===============================================================+} {}




and here's what gets exported.
Code:

<?xml version="1.0" encoding="UTF-8" ?>
<cmud>
<module>
  <record id="3146496">
    <id>3146496</id>
    <kind>5</kind>
    <parent>3145740</parent>
    <pkgid>3145728</pkgid>
    <enabled>-1</enabled>
    <idname>Score</idname>
    <options/>
    <userval/>
    <val/>
    <comment/>
    <name>+===============================================================+</name>
    <subkind>0</subkind>
    <valkind>0</valkind>
    <opt>137</opt>
    <owner>3145740</owner>
    <userint>0</userint>
    <priority>7680</priority>
    <flag>128</flag>
    <state>0</state>
  </record>
  <record id="3146497">
    <id>3146497</id>
    <kind>5</kind>
    <parent>3146496</parent>
    <pkgid>3145728</pkgid>
    <enabled>-1</enabled>
    <idname><![CDATA[|%sScore sheet for the &%w{Race} known as%s|]]></idname>
    <options/>
    <userval/>
    <val/>
    <comment/>
    <name>{*}</name>
    <subkind>0</subkind>
    <valkind>0</valkind>
    <opt>137</opt>
    <owner>3145728</owner>
    <userint>0</userint>
    <priority>7690</priority>
    <flag>0</flag>
    <state>7690</state>
  </record>
  <record id="3146498">
    <id>3146498</id>
    <kind>5</kind>
    <parent>3146496</parent>
    <pkgid>3145728</pkgid>
    <enabled>-1</enabled>
    <idname><![CDATA[|%s-~*  &%w{Name} of &%w{City}  ~*-%s|]]></idname>
    <options/>
    <userval/>
    <val/>
    <comment/>
    <name>{*}</name>
    <subkind>0</subkind>
    <valkind>0</valkind>
    <opt>137</opt>
    <owner>3145728</owner>
    <userint>0</userint>
    <priority>7700</priority>
    <flag>0</flag>
    <state>7700</state>
  </record>
  <record id="3146499">
    <id>3146499</id>
    <kind>5</kind>
    <parent>3146496</parent>
    <pkgid>3145728</pkgid>
    <enabled>-1</enabled>
    <idname>|%s (%d) years, (%d) months and (%d) days %s |</idname>
    <options/>
    <userval/>
    <val/>
    <comment/>
    <name>{*}</name>
    <subkind>0</subkind>
    <valkind>0</valkind>
    <opt>137</opt>
    <owner>3145728</owner>
    <userint>0</userint>
    <priority>7710</priority>
    <flag>0</flag>
    <state>7710</state>
  </record>
  <record id="3146500">
    <id>3146500</id>
    <kind>5</kind>
    <parent>3146496</parent>
    <pkgid>3145728</pkgid>
    <enabled>-1</enabled>
    <idname>+===============================================================</idname>
    <options/>
    <userval/>
    <val/>
    <comment/>
    <name>+===============================================================+</name>
    <subkind>0</subkind>
    <valkind>0</valkind>
    <opt>137</opt>
    <owner>3145728</owner>
    <userint>0</userint>
    <priority>7720</priority>
    <flag>0</flag>
    <state>7720</state>
  </record>
  <record id="3146501">
    <id>3146501</id>
    <kind>5</kind>
    <parent>3146496</parent>
    <pkgid>3145728</pkgid>
    <enabled>-1</enabled>
    <idname>\|\s*(?HP:\d+)/\s*(?MxHP:\d+) Hit\s*(?M:\d+)/\s*(?MxM:\d+) Mana\</idname>
    <options/>
    <userval/>
    <val><![CDATA[#IF (@HP <= @MxHP/2) {#GAUGE HP " " @HP @MxHP @Wimpy {} {high,yellow} {high,red}} {#VAR WaHP %eval( @MxHP/2) "" Stats;#GAUGE HP " " @HP @MxHP @WaHP "" "high,green" "high,yellow"}]]></val>
    <comment/>
    <name>\|\s*(?HP:\d+)/\s*(?MxHP:\d+) Hit\s*(?M:\d+)/\s*(?MxM:\d+) Mana\s*(?Mv:\d+)/\s*(?MxMv:\d+) Movement\s*(?Practice:\d+) Practices \|</name>
    <subkind>0</subkind>
    <valkind>0</valkind>
    <opt>201</opt>
    <owner>3145728</owner>
    <userint>0</userint>
    <priority>7730</priority>
    <flag>0</flag>
    <state>7730</state>
  </record>
  <record id="3146502">
    <id>3146502</id>
    <kind>5</kind>
    <parent>3146496</parent>
    <pkgid>3145728</pkgid>
    <enabled>-1</enabled>
    <idname><![CDATA[|%s ~[ Str:&%d{Str}/&%d{MxStr}  Int:&%d{Int}/&%d{MxInt}  Wis:&%d]]></idname>
    <options/>
    <userval/>
    <val/>
    <comment/>
    <name><![CDATA[|%s ~[ Str:&%d{Str}/&%d{MxStr}  Int:&%d{Int}/&%d{MxInt}  Wis:&%d{Wis}/&%d{MxWis}  Dex:&%d{Dex}/&%d{MxDex}  Con:&%d{Con}/&%d{MxCon} ~] %s |]]></name>
    <subkind>0</subkind>
    <valkind>0</valkind>
    <opt>137</opt>
    <owner>3145728</owner>
    <userint>0</userint>
    <priority>7740</priority>
    <flag>0</flag>
    <state>7740</state>
  </record>
  <record id="3146503">
    <id>3146503</id>
    <kind>5</kind>
    <parent>3146496</parent>
    <pkgid>3145728</pkgid>
    <enabled>-1</enabled>
    <idname>\|\s+ ((?Class1:\a+):\s?(?Class1Lvl:\d+))? ((?Class2:\a+):\s?(?C</idname>
    <options/>
    <userval/>
    <val>#TEMP SecondRow {\|\s+ ((?AdvCls1:\a+):\s?(?AdvCls1Lvl:\d+))? ((?AdvCls2:\a+):\s?(?AdvCls2Lvl:\d+))? \s+\|} {} {regex}</val>
    <comment/>
    <name>\|\s+ ((?Class1:\a+):\s?(?Class1Lvl:\d+))? ((?Class2:\a+):\s?(?Class2Lvl:\d+))? ((?Class3:\a+):\s?(?Class3Lvl:\d+))? \s+\|</name>
    <subkind>0</subkind>
    <valkind>0</valkind>
    <opt>201</opt>
    <owner>3145728</owner>
    <userint>0</userint>
    <priority>7750</priority>
    <flag>0</flag>
    <state>7750</state>
  </record>
  <record id="3146504">
    <id>3146504</id>
    <kind>5</kind>
    <parent>3146496</parent>
    <pkgid>3145728</pkgid>
    <enabled>-1</enabled>
    <idname><![CDATA[|%s Psuedo level: &%d{PLvl} %s |]]></idname>
    <options/>
    <userval/>
    <val/>
    <comment/>
    <name>{*}</name>
    <subkind>0</subkind>
    <valkind>0</valkind>
    <opt>137</opt>
    <owner>3145728</owner>
    <userint>0</userint>
    <priority>7760</priority>
    <flag>0</flag>
    <state>7760</state>
  </record>
  <record id="3146505">
    <id>3146505</id>
    <kind>5</kind>
    <parent>3146496</parent>
    <pkgid>3145728</pkgid>
    <enabled>-1</enabled>
    <idname>|%s Class Order: (%w) (%w) (%w) %s |</idname>
    <options/>
    <userval/>
    <val/>
    <comment/>
    <name>{*}</name>
    <subkind>0</subkind>
    <valkind>0</valkind>
    <opt>137</opt>
    <owner>3145728</owner>
    <userint>0</userint>
    <priority>7770</priority>
    <flag>0</flag>
    <state>7770</state>
  </record>
  <record id="3146506">
    <id>3146506</id>
    <kind>5</kind>
    <parent>3146496</parent>
    <pkgid>3145728</pkgid>
    <enabled>-1</enabled>
    <idname><![CDATA[X========= Exps:%s&%d{XP} ========= Quest Points:%s&%d{QPts} ===]]></idname>
    <options/>
    <userval/>
    <val/>
    <comment/>
    <name><![CDATA[X========= Exps:%s&%d{XP} ========= Quest Points:%s&%d{QPts} ========X]]></name>
    <subkind>0</subkind>
    <valkind>0</valkind>
    <opt>137</opt>
    <owner>3145728</owner>
    <userint>0</userint>
    <priority>7780</priority>
    <flag>0</flag>
    <state>7780</state>
  </record>
  <record id="3146507">
    <id>3146507</id>
    <kind>5</kind>
    <parent>3146496</parent>
    <pkgid>3145728</pkgid>
    <enabled>-1</enabled>
    <idname><![CDATA[|  You are carrying%s &%d{Items}/%s&%d{MxItems} items, weight (%]]></idname>
    <options/>
    <userval/>
    <val/>
    <comment/>
    <name><![CDATA[|  You are carrying%s &%d{Items}/%s&%d{MxItems} items, weight (%d.%d)/%s &%d{MxWgt} kg.%s|]]></name>
    <subkind>0</subkind>
    <valkind>0</valkind>
    <opt>137</opt>
    <owner>3145728</owner>
    <userint>0</userint>
    <priority>7790</priority>
    <flag>0</flag>
    <state>7790</state>
  </record>
  <record id="3146508">
    <id>3146508</id>
    <kind>5</kind>
    <parent>3146496</parent>
    <pkgid>3145728</pkgid>
    <enabled>-1</enabled>
    <idname>|%s Autoexit: ~*({OFF|ON})~* %s Autoloot: ~*({OFF|ON})~* %s Auto</idname>
    <options/>
    <userval/>
    <val/>
    <comment/>
    <name>|%s Autoexit: ~*({OFF|ON})~* %s Autoloot: ~*({OFF|ON})~* %s Autosac: ~*({OFF|ON})~* %s |</name>
    <subkind>0</subkind>
    <valkind>0</valkind>
    <opt>137</opt>
    <owner>3145728</owner>
    <userint>0</userint>
    <priority>7800</priority>
    <flag>0</flag>
    <state>7800</state>
  </record>
  <record id="3146509">
    <id>3146509</id>
    <kind>5</kind>
    <parent>3146496</parent>
    <pkgid>3145728</pkgid>
    <enabled>-1</enabled>
    <idname>|%s Autogold: ~*({OFF|ON})~* %s Autoassist: ~*({OFF|ON})~* %s |</idname>
    <options/>
    <userval/>
    <val/>
    <comment/>
    <name>{*}</name>
    <subkind>0</subkind>
    <valkind>0</valkind>
    <opt>137</opt>
    <owner>3145728</owner>
    <userint>0</userint>
    <priority>7810</priority>
    <flag>0</flag>
    <state>7810</state>
  </record>
  <record id="3146510">
    <id>3146510</id>
    <kind>5</kind>
    <parent>3146496</parent>
    <pkgid>3145728</pkgid>
    <enabled>-1</enabled>
    <idname><![CDATA[|%s Wimpy Set to &%d{Wimpy} HitPoints.  Page Length is %d lines.]]></idname>
    <options/>
    <userval/>
    <val/>
    <comment/>
    <name><![CDATA[|%s Wimpy Set to &%d{Wimpy} HitPoints.  Page Length is %d lines. %s |]]></name>
    <subkind>0</subkind>
    <valkind>0</valkind>
    <opt>137</opt>
    <owner>3145728</owner>
    <userint>0</userint>
    <priority>7820</priority>
    <flag>0</flag>
    <state>7820</state>
  </record>
  <record id="3146511">
    <id>3146511</id>
    <kind>5</kind>
    <parent>3146496</parent>
    <pkgid>3145728</pkgid>
    <enabled>-1</enabled>
    <idname>|%s Drunk:%s(%w)   Thirsty:%s(%w)   Hungry:%s(%w)  %s |</idname>
    <options/>
    <userval/>
    <val/>
    <comment/>
    <name>{*}</name>
    <subkind>0</subkind>
    <valkind>0</valkind>
    <opt>137</opt>
    <owner>3145728</owner>
    <userint>0</userint>
    <priority>7830</priority>
    <flag>0</flag>
    <state>7830</state>
  </record>
  <record id="3146512">
    <id>3146512</id>
    <kind>5</kind>
    <parent>3146496</parent>
    <pkgid>3145728</pkgid>
    <enabled>-1</enabled>
    <idname>|%s You have assumed the Stance of the (*). %s |</idname>
    <options/>
    <userval/>
    <val>#VAR Stance %1</val>
    <comment/>
    <name>{*}</name>
    <subkind>0</subkind>
    <valkind>0</valkind>
    <opt>137</opt>
    <owner>3145728</owner>
    <userint>0</userint>
    <priority>7840</priority>
    <flag>0</flag>
    <state>7840</state>
  </record>
  <record id="3146513">
    <id>3146513</id>
    <kind>5</kind>
    <parent>3146496</parent>
    <pkgid>3145728</pkgid>
    <enabled>-1</enabled>
    <idname>|%sYou are (%w).%s|</idname>
    <options/>
    <userval/>
    <val/>
    <comment/>
    <name>{*}</name>
    <subkind>0</subkind>
    <valkind>0</valkind>
    <opt>137</opt>
    <owner>3145728</owner>
    <userint>0</userint>
    <priority>7850</priority>
    <flag>0</flag>
    <state>7850</state>
  </record>
  <record id="3146514">
    <id>3146514</id>
    <kind>5</kind>
    <parent>3146496</parent>
    <pkgid>3145728</pkgid>
    <enabled>-1</enabled>
    <idname><![CDATA[|%sArmor Class:%s&%n{AC}.   You are (*).%s|]]></idname>
    <options/>
    <userval/>
    <val/>
    <comment/>
    <name>{*}</name>
    <subkind>0</subkind>
    <valkind>0</valkind>
    <opt>137</opt>
    <owner>3145728</owner>
    <userint>0</userint>
    <priority>7860</priority>
    <flag>0</flag>
    <state>7860</state>
  </record>
  <record id="3146515">
    <id>3146515</id>
    <kind>5</kind>
    <parent>3146496</parent>
    <pkgid>3145728</pkgid>
    <enabled>-1</enabled>
    <idname><![CDATA[|%sHitroll: &%d{HRoll}%sDamroll: &%d{DRoll}%s|]]></idname>
    <options/>
    <userval/>
    <val/>
    <comment/>
    <name>{*}</name>
    <subkind>0</subkind>
    <valkind>0</valkind>
    <opt>137</opt>
    <owner>3145728</owner>
    <userint>0</userint>
    <priority>7870</priority>
    <flag>0</flag>
    <state>7870</state>
  </record>
  <record id="3146516">
    <id>3146516</id>
    <kind>5</kind>
    <parent>3146496</parent>
    <pkgid>3145728</pkgid>
    <enabled>-1</enabled>
    <idname>|%sAlignment:%s (%n).%s You are (%w).%s|</idname>
    <options/>
    <userval/>
    <val/>
    <comment/>
    <name>{*}</name>
    <subkind>0</subkind>
    <valkind>0</valkind>
    <opt>137</opt>
    <owner>3145728</owner>
    <userint>0</userint>
    <priority>7880</priority>
    <flag>0</flag>
    <state>7880</state>
  </record>
  <record id="3146517">
    <id>3146517</id>
    <kind>5</kind>
    <parent>3146496</parent>
    <pkgid>3145728</pkgid>
    <enabled>-1</enabled>
    <idname>|%sSaving throws: (%n)%s|</idname>
    <options/>
    <userval/>
    <val/>
    <comment/>
    <name>{*}</name>
    <subkind>0</subkind>
    <valkind>0</valkind>
    <opt>137</opt>
    <owner>3145728</owner>
    <userint>0</userint>
    <priority>7890</priority>
    <flag>0</flag>
    <state>7890</state>
  </record>
  <record id="3146518">
    <id>3146518</id>
    <kind>5</kind>
    <parent>3146496</parent>
    <pkgid>3145728</pkgid>
    <enabled>-1</enabled>
    <idname>+===============================================================</idname>
    <options/>
    <userval/>
    <val/>
    <comment/>
    <name>+===============================================================+</name>
    <subkind>0</subkind>
    <valkind>0</valkind>
    <opt>137</opt>
    <owner>3145728</owner>
    <userint>0</userint>
    <priority>7900</priority>
    <flag>0</flag>
    <state>7900</state>
  </record>
</module>
</cmud>

_________________
Asati di tempari!
Reply with quote
Tech
GURU


Joined: 18 Oct 2000
Posts: 2733
Location: Atlanta, USA

PostPosted: Thu Oct 26, 2006 9:26 pm   
 
Hmmm... I just reviewed the actual source and I'm guessing that the following holds true.

kind = 5 ==> Trigger
opt = 137 ==> Regular zMUD/CMUD pattern
opt = 201 ==> Regex pattern.

That means the code seems to export the options of my triggers correctly, and it is displayed correctly in the Package Editor. If that is the case, I would guess that is being represent and stored correctly, but perhaps the compiler (given on the "+=====+" style of some of the conditions), is try to compile all parts as regular expression patterns.
_________________
Asati di tempari!
Reply with quote
Zugg
MASTER


Joined: 25 Sep 2000
Posts: 23379
Location: Colorado, USA

PostPosted: Thu Oct 26, 2006 11:06 pm   
 
Remind me what the problem was. I thought I remembered the problem being that you got a parsing error when entering it into the command line, but not when entering it into an alias in the settings editor.

But I just pasted your multiline command into the command line and it worked just fine. I don't think I've fixed anything in the parser recently, so maybe I just don't remember what the problem was.

So remind me if the problem was with a syntax error, or if it's something more related to the trigger actually working or not. If it's the trigger not working properly, then also post some sample text for testing the trigger.
Reply with quote
Tech
GURU


Joined: 18 Oct 2000
Posts: 2733
Location: Atlanta, USA

PostPosted: Fri Oct 27, 2006 5:03 am   
 
It temperamental really sometimes it works and sometimes it doesn't. I haven't tried from the command line for a while but in the settings editor it gives and error. Also the trigger itself doesn't fire. If you look at the compiled tab in the Package Editor most of the states don't compile. If you get it working once, exit CMUD and try to access it again. It won't seem to work then.
_________________
Asati di tempari!
Reply with quote
Zugg
MASTER


Joined: 25 Sep 2000
Posts: 23379
Location: Colorado, USA

PostPosted: Fri Oct 27, 2006 11:41 pm   
 
Well, I discovered a couple of interesting things about this.

First, the errors when clicking the compiled tab were fake. The compiled code tab was displaying an error message whenever the script was empty. So this was just an issue with the settings editor and not actual errors in your script.

However, the big error that I discovered is that when trigger states are initially loaded, CMUD didn't actually know what the state types were. Actually, it was caching a value of zero for the state type instead of loading it from the database the first time. If you went into the settings editor and changed the state to something else, then back again, then it would work. This bug might also have been effecting some properties of button states.

Anyway, I've got this fixed in v1.12 and it looks like trigger states work. I've also been able to add a nice visual indicator in the settings editor to show which state is currently active when you expand the main trigger to see the sub-states.
Reply with quote
Tech
GURU


Joined: 18 Oct 2000
Posts: 2733
Location: Atlanta, USA

PostPosted: Sat Oct 28, 2006 5:00 am   
 
That's great news Zugg, and I'm glad you got that one tracked down. I'm sure it would have come up more often with other folks. Looking forward to tomorrows release.
_________________
Asati di tempari!
Reply with quote
Display posts from previous:   
Post new topic   Reply to topic     Home » Forums » CMUD Beta Forum 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