 |
hogarius Adept
Joined: 29 Jan 2003 Posts: 221 Location: islands.genesismuds.org
|
Posted: Sun Dec 14, 2008 12:46 am
[3.03] %query is not working. |
This is the xml for my PerpDatabase class that I use to track and capture perps in Modus Operandi. It worked fairly well (but missed a few perps I saw on the street) in version 2.xx, but does not work in version 3.03.
| Code: |
<class name="PerpDatabase" id="249">
<trigger name="BoardInfo" priority="940" id="250">
<pattern><![CDATA[Police are asking for your help to bring &{Perp.FirstName} &{Perp.LastName} to justice *. &{Perp.Pronoun} appears to be in %w &%w{Perp.AgeRange} &%w{Perp.AgeDecade}%p standing about &%d{Perp.HFt} feet and &%d{Perp.HIn} inch* tall with %w &{Perp.Build} build. %w has %w &{Perp.Fitness} fitness level, with a weight of about &%d{Perp.Weight} pounds. %w skin is &{Perp.SkinTone}. %w eyes are &{Perp.EyeColor}, and %w has &{Perp.Hair} hair.]]></pattern>
<value>#if (@Perp.Pronoun="He") {#var Perp.Gender "M"} {#var Perp.Gender "F"}
#switch @Perp.AgeDecade
"teens" {#var Perp.AgeNum "10's"}
"twenties" {#var Perp.AgeNum "20's"}
"thirties" {#var Perp.AgeNum "30's"}
"forties" {#var Perp.AgeNum "40's"}
"fifties" {#var Perp.AgeNum "50's"}
"sixties" {#var Perp.AgeNum "60's"}
"seventies" {#var Perp.AgeNum "70's"}
"eighties" {#var Perp.AgeNum "80's"}
"nineties" {#var Perp.AgeNum "90's"}</value>
<trigger>
<pattern>^* was recently seen &{Perp.Location}.$</pattern>
</trigger>
<trigger>
<pattern>^%w is to be considered &{Perp.ThreatLevel}%p$</pattern>
<value><![CDATA[#var Duplicate (%query(&FirstName=@Perp.FirstName && &LastName=@Perp.LastName))
#if @Duplicate
{#dbput @Duplicate {Location=@Perp.Location}}
#if !@Duplicate
{#new Perps @Perp}
#wait 250]]></value>
</trigger>
</trigger>
<alias name="clean" id="253">
<value>#say "clean"
#dbfirst
#while !%null(%rec) {#dbdelete &Num}
#say "--All perps erased."
#send "";#gagspace</value>
</alias>
<var name="Duplicate" id="254"/>
<trigger name="StudySuspect" priority="1010" id="255">
<pattern>You look carefully at %w &{Suspect.Adjective} &{Suspect.ManWoman} ...</pattern>
<trigger>
<pattern><![CDATA[&{Suspect.Pronoun} appears to be in %w &{Suspect.AgeRange} &{Suspect.AgeDecade}, standing about &%d{Suspect.HFt} feet and &%d{Suspect.HIn} inch* tall with %w &{Suspect.Build} build. %w has %w &{Suspect.Fitness} fitness level, with a weight of about &%d{Suspect.Weight} pounds. %w skin is &{Suspect.SkinTone}. %w eyes are &{Suspect.EyeColor}, and %w has &{Suspect.Hair} hair.]]></pattern>
</trigger>
<trigger>
<pattern>%w appears to be &{Suspect.ThreatLevel}.</pattern>
<value><![CDATA[SuspectMatch=%query((@Suspect.Weight=&Weight&&@Suspect.HFt=&HFt&&@Suspect.HIn=&HIn&&@Suspect.AgeRange=&AgeRange&&@Suspect.AgeDecade=&AgeDecade),"Perps")]]></value>
</trigger>
<trigger>
<pattern>^A*.$</pattern>
<value><![CDATA[#if @SuspectMatch<>""
{#dbget @SuspectMatch;#say "Match:";#sayprompt &FirstName &LastName}]]></value>
</trigger>
</trigger>
<var name="SuspectMatch" id="259"/>
<trigger name="Arrested" priority="1180" id="260">
<pattern>for capturing &{Arrest.FirstName} &{Arrest.LastName}.</pattern>
<value><![CDATA[Arrest.Line=%query(&FirstName=@Arrest.FirstName && &LastName=@Arrest.LastName)
#if (@Arrest.Line)
{#dbdelete @Arrest.Line;#say Perp erased ~(@Arrest.Line~)~.}
{#say --@Arrest.FirstName @Arrest.LastName not in database.}]]></value>
</trigger>
<trigger name="Escaped" priority="1280" id="261">
<pattern>regret to say that &Arrest.FirstName &Arrest.LastName has escaped</pattern>
<value><![CDATA[Arrest.Line=%query(&FirstName=@Arrest.FirstName && &LastName=@Arrest.LastName)
#if (@Arrest.Line)
{#dbdelete @Arrest.Line;#say Perp erased ~(@Arrest.Line~)~.}
{#say --@Arrest.FirstName @Arrest.LastName not in database.}]]></value>
</trigger>
<var name="Arrest" type="Record" id="262">LastName=Bradley|Line="2276pe|2277pe|2278pe|2279pe|2280pe|2281pe"|FirstName=Seamus</var>
<var name="Suspect" type="Record" id="263">Hair=silver permed|ThreatLevel=not at all dangerous|EyeColor=violet|AgeRange=mid|ManWoman=woman|HIn=0|Weight=264|Build=overweight|Pronoun=She|Fitness=average|HFt=6|AgeDecade=teens|SkinTone=copper|Adjective=suspicious</var>
<var name="Perp" type="Record" id="264">Hair=carrot red close-cut|LastName=Zeiher|Location=near the Musee des Beaux-Arts|ThreatLevel=not at all dangerous|EyeColor=ice blue|AgeRange=early|HIn=0|Weight=189|FirstName=Arte|Build=average|Pronoun=He|Fitness=very low|AgeNum=20's|HFt=6|AgeDecade=twenties|SkinTone=bronzed|Gender=M</var>
</class>
|
The database variables and Perps database are being populated correctly when the triggers fire. However, none of the %query functions seem to be working. I've tried exporting the xml for the class, deleting the class and reimporting the xml for the class, with no success.
I've seen some posts recently about problems with %query, but I'm honestly not sure if they apply to this case or how to rewrite the %query functions to make them work, if that is what I need to do.
I would appreciate any help anyone can provide, including a detailed rundown of how to constuct my %query's. |
|
|
|
 |
calesta Apprentice
Joined: 07 Dec 2008 Posts: 102 Location: New Hampshire, USA
|
Posted: Sun Dec 14, 2008 1:25 am |
Dunno if it will fix it for you or not, but %query works for me if I put quotes around the query parameter:
| Code: |
| %query("&X=@Coords.X && &Y=@Coords.Y") |
|
|
|
|
 |
hogarius Adept
Joined: 29 Jan 2003 Posts: 221 Location: islands.genesismuds.org
|
Posted: Sun Dec 14, 2008 2:21 am |
That seems to have fixed it. Thank you, Calesta.
|
|
|
|
 |
Zugg MASTER

Joined: 25 Sep 2000 Posts: 23379 Location: Colorado, USA
|
Posted: Mon Dec 15, 2008 5:41 pm |
Yes, you have to pass string arguments to the database module stuff. That will be fixed when the database module is rewritten next year. But it's not part of the current beta cycle, sorry.
|
|
|
|
 |
|
|
|
|
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
|
|