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

Play RetroMUD
Post new topic  Reply to topic     Home » Forums » zMUD General Discussion
MysticMudder
Newbie


Joined: 19 Aug 2002
Posts: 4
Location: USA

PostPosted: Mon Aug 19, 2002 1:24 am   

Trigger calls Action problem (zMud v6.16)
 
I have a trigger:
#TRIGGER {^AUCTION:(%w) is auctioning (*).} {aucItem "%2"}

Where aucItem is an Action:

#T+ Object
#VAR ITEM ""
#VAR DISPLAYNAME {%1}
auc

The problem is, the trigger works, and auc is generated, but the Object trigger doesn't seem to be working.

This does work if I type aucItem "linen scroll" on the command line.


Any ideas?
Reply with quote
Apollyon
Wanderer


Joined: 02 Oct 2001
Posts: 76
Location: USA

PostPosted: Mon Aug 19, 2002 1:35 am   
 
try this instead

#TRIGGER {^AUCTION:(%w) is auctioning (*).} {aucItem ~"%2~"}

--------------------------------------------------

"They tell Soze they want his territory - all his business. Soze looks over the faces of his family... Then he showed these men of will what will really was."
Reply with quote
MysticMudder
Newbie


Joined: 19 Aug 2002
Posts: 4
Location: USA

PostPosted: Mon Aug 19, 2002 1:58 am   
 
Tried that (but no good), then tried something to isolate the problem:

#TRIGGER
{^AUCTION:(%w) is auctioning (*). Minimum bid set at (%d).}
{
#T+ Object
#VAR Item ""
#VAR disName {%2}
#VAR ItemType ""
#VAR iType ""
auc
}

Where:

#CLASS {Object}
#TRIGGER {Object '&Item.Name' is type &iType,} {}
#TRIGGER {Weight is &%dItem.Weight} {}
#NEW "" @Item
#CLASS 0

Still no good!

auc gets generated and the mud responds with all the auc'ed object info, but still no record in my (opened) database.

And the value section of that first trigger, is the SAME value section for my 'aucItem' alias (which DOES produce the db record).

Is it that the Class name shouldn't be part of a trigger pattern in the class? Is it something about turning on a trigger within a trigger?

Any other ideas?
Reply with quote
Kjata
GURU


Joined: 10 Oct 2000
Posts: 4379
Location: USA

PostPosted: Mon Aug 19, 2002 2:29 am   
 
You problem is that you have
#NEW "" @Item

as a single command in the Object class. You should know that when you enable a class, it doesn't mean that all of the commands in Class Script are executed. In fact, the only commands that can go between
#CLASS className
and
#CLASS 0

are:
#VAR, #TRIGGER, #ALARM, #ONINPUT, #TEMP, #ALIAS, #BUTTON, #KEY, #STATUS, #MENU and #DIR.

I might have missed some, but that should be the most important, if not all.

So, you need something that will make zMUD execute the #NEW command once it has received the necessary info of the object. A trigger works for this, and usually a blank line is used as a pattern (that is, of course, if your MUD sends a blank line after the information of an object.)

So, your class shoult then be:
#CLASS {Object}
#TRIGGER {Object '&{Item.Name}' is type &{iType},} {}
#TRIGGER {Weight is &%dItem.Weight} {}
#TRIGGER {$} {#NEW "" @Item}
#CLASS 0

Also, notice how I added braces to &Item.Name and &iType. This is done to avoid the confussion of where the name of the variable ends and the pattern of the trigger continues. It is not necessary if this is clear, like in the second trigger.

Kjata
Reply with quote
MysticMudder
Newbie


Joined: 19 Aug 2002
Posts: 4
Location: USA

PostPosted: Mon Aug 19, 2002 3:00 am   
 
Sorry! My bad. (That's what I get for just copying a few lines from my script...)

The actual line is:
#TRIGGER {$} {#NEW "" @Item}
before #CLASS 0.

Thanks for the ideas so far.

Any more ideas (and I hope I haven't forgotten anything else)?
Reply with quote
Kjata
GURU


Joined: 10 Oct 2000
Posts: 4379
Location: USA

PostPosted: Mon Aug 19, 2002 3:07 am   
 
Check that the names of the different keys used in the @Item record variable are exactly the same (including case) as the names of the fields of your datbase. Also, you might want to try adding an item manually by using the #ADDKEY command and then #NEW to see if it will add it that way.

Kjata
Reply with quote
MysticMudder
Newbie


Joined: 19 Aug 2002
Posts: 4
Location: USA

PostPosted: Tue Aug 20, 2002 1:06 am   
 
Found problem!

Have to add a #CR to beginning of ^AUCTION trigger.
Reply with quote
Display posts from previous:   
Post new topic   Reply to topic     Home » Forums » zMUD 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