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
epd
Newbie


Joined: 05 May 2005
Posts: 6

PostPosted: Thu May 05, 2005 2:31 pm   

Achaea antitheft triggers help
 
i cant seem to get my triggers to activate properly the class is activated but not the triggers i was wondering if someone could help me.
Code:
#CLASS {antitheft}
#TRIGGER {You get %d gold sovereigns from a canvas backpack} {
  wear pack108042
  put gold in pack
  }
#TRIGGER {You get %d gold sovereigns from a small pouch.} {put gold in pack}
#TRIGGER {You remove a small pouch.} {wear pouch}
#TRIGGER {You remove a Sartanic scabbard.} {wear scabbard}
#TRIGGER {You take a beautiful pearl ring from a small pouch.} {put ring in pouch}
#TRIGGER {You remove a suit of polished field plate armour.} {#ALARM +3.25 {wear fieldplate}}
#TRIGGER {You begin to wield some gold sovereigns in your %w hand.} {
  UNWIELD GOLD
  put gold in pouch
  }
#TRIGGER {You cease wielding a shining steel longsword in your left hand.} {wield longsword}
#TRIGGER {You remove a canvas backpack.} {wear pack}
#TRIGGER {snaps %w fingers in front of you.} {#t+ antitheft}
#TRIGGER {You snap your fingers in front of yourself.} {#t+ antitheft}
#CLASS 0
Reply with quote
Maelstrom
Apprentice


Joined: 10 Feb 2005
Posts: 158

PostPosted: Thu May 05, 2005 4:10 pm   
 
Remove these two triggers from the class:
#TRIGGER {snaps %w fingers in front of you.} {#t+ antitheft}
#TRIGGER {You snap your fingers in front of yourself.} {#t+ antitheft}

And modify to this:
#TRIGGER {snaps %w fingers in front of you.} {#class antitheft {1}}
#TRIGGER {You snap your fingers in front of yourself.} {#class antitheft {1}}

Now disable the class (and set this as the default) and within the class enable all the triggers. The triggers wont fire as the class they are contained in is disabled...
Reply with quote
Maelstrom
Apprentice


Joined: 10 Feb 2005
Posts: 158

PostPosted: Thu May 05, 2005 4:14 pm   
 
By the way, for your triggers I would highly recommend using anchors (IE: ^ and $).
This will prevent people from messing with you via:

Whomever tells you 'You snap your fingers in front of yourself.'

You current triggers allow firing anywhere on the line so they can turn your settings on and off with the right commands/ tells. Not only is that bad, but since these can match anywhere on a line they are slow to boot... just an fyi.
Reply with quote
epd
Newbie


Joined: 05 May 2005
Posts: 6

PostPosted: Thu May 05, 2005 4:34 pm   
 
hmm im pretty new to scripting thats my first proper attempt will have a go at adding the anchors thanks for your help Very Happy
Reply with quote
Maelstrom
Apprentice


Joined: 10 Feb 2005
Posts: 158

PostPosted: Thu May 05, 2005 4:56 pm   
 
Sure thing... just in case you have trouble finding them in the reference...

^ matches at the beginning of a line where $ matching the end of a line. So for the two modified above they we be better off as:

#TRIGGER {^snaps %w fingers in front of you.$} {#class antitheft {1}}
#TRIGGER {^You snap your fingers in front of yourself.$} {#class antitheft {1}}
Reply with quote
epd
Newbie


Joined: 05 May 2005
Posts: 6

PostPosted: Thu May 05, 2005 5:35 pm   
 
thanks Very Happy
Reply with quote
epd
Newbie


Joined: 05 May 2005
Posts: 6

PostPosted: Fri May 06, 2005 8:37 am   
 
Ok i got round to do that but still the triggers are not de/activated by de/activating the class
Reply with quote
Maelstrom
Apprentice


Joined: 10 Feb 2005
Posts: 158

PostPosted: Fri May 06, 2005 11:58 am   
 
Ummm, so let me get this straight...
You have all these triggers in the class folder and while the folder is disabled the triggers still fire?

If thats the case I am at a loss. Should not happen.
Reply with quote
epd
Newbie


Joined: 05 May 2005
Posts: 6

PostPosted: Fri May 06, 2005 12:11 pm   
 
yeah thats whats happeningi tried disableing the folder then manually the trigggers then reactivating them with the snap trigger but it didnt work
Reply with quote
Maelstrom
Apprentice


Joined: 10 Feb 2005
Posts: 158

PostPosted: Fri May 06, 2005 12:33 pm   
 
Check for duplicates...

A quick test would be to modify one of the triggers in the class (take: You remove a small pouch.) for example.
In the main body (trigger actions) add in: #ECHO {Fired!}
Then (from the command bar do a: #ECHO {You remove a small pouch.}

If indeed your class is disabled and it is still firing then you will see "Fired!" echo to the screen for verification.
If you dont see "Fired!" but you do an action then somewhere you have a duplicate trigger firing at the same time...

Its worth checking for at least... lemme know
Reply with quote
epd
Newbie


Joined: 05 May 2005
Posts: 6

PostPosted: Fri May 06, 2005 1:10 pm   
 
thanks for your help finally got it working
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