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


Joined: 20 Nov 2001
Posts: 4
Location: USA

PostPosted: Mon Sep 02, 2002 10:10 pm   

How to trigger on multiple lines
 
I want to be able to follow a mob that flees, but it's set up a little awkwardly on the MUD. Here's what happens:

Mob leaves west.
Mob has fled!

I don't know if I would use the "leaves west" or "has fled" as a trigger, but either way, I'll need to read the line before/after it to go the direction the mob has fled.
Reply with quote
sda
Wanderer


Joined: 18 Apr 2001
Posts: 55
Location: United Kingdom

PostPosted: Mon Sep 02, 2002 10:21 pm   
 
Use the $ symbol to match the line break.

Pattern:
Mob flees (%w).$Mob has fled!
Command:
%1


You could just write a trigger on
Mob flees (%w).
Do you need to trigger on the second line?

Steve
Reply with quote
blkfury
Newbie


Joined: 20 Nov 2001
Posts: 4
Location: USA

PostPosted: Mon Sep 02, 2002 11:26 pm   
 
Well, see, it never actually says the mob flees any direction. One line says they leave, then the next line says that they have fled.

And what if the name of the mob is more than one word?

Here is an example that is on the MUD i play:

Your pierce DISEMBOWELS a tree frog! [106]
a tree frog leaves east.
a tree frog has fled!

What can I do to follow the frog in the direction he fled?
Reply with quote
MattLofton
GURU


Joined: 23 Dec 2000
Posts: 4834
Location: USA

PostPosted: Mon Sep 02, 2002 11:55 pm   
 
quote:

Well, see, it never actually says the mob flees any direction. One line says they leave, then the next line says that they have fled.

And what if the name of the mob is more than one word?

Here is an example that is on the MUD i play:

Your pierce DISEMBOWELS a tree frog! [106]
a tree frog leaves east.
a tree frog has fled!

What can I do to follow the frog in the direction he fled?



I assume that mobs on your MUD are referred to by one-word keywords? If that's the case, you MIGHT want to maintain some sort of list of keywords that correlates to a list of full monster names. This could be a master list that grows and grows and grows based on your experience, or it could be limited to a particular hunting area or group of monsters you want to hunt.

The trigger would then look something like this:

#Trigger {^{@Monster.fullname} leaves ({north|south|west|east|northwest|northeast|southwest|southeast}).${@Monster.fullname} flees!} {%2;#loop 1,%numitems(@monster.fullname) {#if (%item(@Monster.fullname,%i) = "%1") {attack %item(@Monster.keyword,%i);#abort 1} {#noop}}}

li'l shmoe of Dragon's Gate MUD
Reply with quote
blkfury
Newbie


Joined: 20 Nov 2001
Posts: 4
Location: USA

PostPosted: Thu Sep 05, 2002 12:39 am   
 
OK... I have a database named Mobs, with the name mobs.db. I have the fields Long name (a tree frog hops around), short name (a tree frog), and name (frog). How would I use this?
Reply with quote
MattLofton
GURU


Joined: 23 Dec 2000
Posts: 4834
Location: USA

PostPosted: Thu Sep 05, 2002 3:35 am   
 
quote:

OK... I have a database named Mobs, with the name mobs.db. I have the fields Long name (a tree frog hops around), short name (a tree frog), and name (frog). How would I use this?





Beats me. I don't use the database and any solution I'd write about would involve long hours of slogging through the help files.

However, you'll probably be looking at the %db() function (if I recall, that retrieves a record), the #query command/%query() function, and similar database actions.

li'l shmoe of Dragon's Gate MUD
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