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


Joined: 01 Dec 2001
Posts: 3

PostPosted: Sat Dec 01, 2001 12:16 pm   

Parsing Room Descripts
 
Here is the problem:

There is a skill on a mud called peek. It allows me to peek into the next room. On group raids, I need to setup a script that takes a room description:

As you peek east you see the following:
Market Square
You are standing on the market square, the famous Square of Midgaard.
Obvious exits: [North, East, Down]
A singing, happy Drunk.

The response to the group needs to be:
Room Title
Exits
Mob names (and take into account multiple mobs)

Problems Encountered:
I can only get the exits to work!
I can't turn it off when just walking around without disabling the class.

Any suggestions on how to accurately parse the room?
Reply with quote
Acaila
Apprentice


Joined: 30 Aug 2001
Posts: 187
Location: Netherlands

PostPosted: Sat Dec 01, 2001 5:27 pm   
 
#TRIGGER {^As you peek (%w) you see the following:} {#T+ Peek;PeekCounter = 0;#TEMP {$} {Say Peek results of %1ern room are:;Say Room Name: @PeekRoomName;Say Exits: @PeekExits;#FORALL @PeekMobs {Say Mobs: %i};PeekMobs = %null;#T- Peek}}
#CLASS {Peek}
#TRIGGER {^(*)$} {#ADD Peekcounter 1;#IF (@Peekcounter = 1) {PeekRoomName = "%1"} {#IF (@Peekcounter > 3) {#VARIABLE PeekMobs %additem("%1", @PeekMobs)}}}
#TRIGGER {^Obvious exits: ~[(*)~]} {PeekExits = "%1"}
#CLASS 0

This will enable a class called Peek whenever you use the peek skill, and will do the following:
- Set up a counter to catch each line in the appropriate variable (didn't know how else to assign it to different variables based on what line it's on....)
- Create variables of the following: Room name, exits, mobs (multiples if existing)
- After the entire block of text is received it will output the captured info using say commands (you can modify these messages however you want).
- It will then shut off the class until you peek again.

You can just copy&paste these triggers in your command line to get them entered correctly.

Acaila
Reply with quote
Turlo
Newbie


Joined: 01 Dec 2001
Posts: 3

PostPosted: Wed Dec 05, 2001 9:15 am   
 
RRrrr....@Home went down when I was in middle of perfecting this.

First off, you are a saint for helping me point out the right direction to go to. However, the only problem I see now is turning off the counter. Variables to take into account are random room description lengths, and, as you know, random amounts of mobs. The counter kept going...and going...and going...bringing up ever gossip and such. Figuring out how to end it correctly. Will post finished results. (And if anyone, in addition Acaila wish to add...feel free!)
Reply with quote
Acaila
Apprentice


Joined: 30 Aug 2001
Posts: 187
Location: Netherlands

PostPosted: Wed Dec 05, 2001 11:57 am   
 
I took out the counter thing, turned out you didn't need it after all, and changed a few other things too.

#TRIGGER {^As you peek (%w) you see the following:$(*)} {#T+ Peek;PeekRoomName = "%2";#TEMP {$} {Say Peek results of %1ern room are:;Say Room Name: @PeekRoomName;Say Exits: @PeekExits;#FORALL @PeekMobs {Say Mobs: %i};PeekMobs = %null;CheckPeekMobs = 0;#T- Peek}}
#CLASS {Peek}
#TRIGGER {^Obvious exits: ~[(*)~]} {PeekExits = "%1";CheckPeekMobs = 1}
#TRIGGER {^(*)} {#IF (@CheckPeekMobs = 1) {#VARIABLE PeekMobs %additem("%1", @PeekMobs)}}}
#CLASS 0

These will skip the room desc completely after capturing the roomname and continue after finding the exits.

Hope this helps a bit.

Acaila
Reply with quote
Turlo
Newbie


Joined: 01 Dec 2001
Posts: 3

PostPosted: Wed Dec 05, 2001 12:55 pm   
 
I was playing with a flag after exits as well. Still seems to be looping, but I realized I forgot to mention one big thing...

I am using v3.62...and I suspect a there is something that does not translate in the older version correctly. Looking it over now and seeing how it reacts.
Reply with quote
Acaila
Apprentice


Joined: 30 Aug 2001
Posts: 187
Location: Netherlands

PostPosted: Wed Dec 05, 2001 4:06 pm   
 
If it keeps looping, then you'd better take a look at the temporary trigger. That is supposed to turn everything off, so it's likely the problem is there somewhere.

Btw, why not upgrade to at least v6.16? It's got a LOT of improvements (automap/database just to name a few), and you'll be able to get better help with your scripts if you use a more current version.

Acaila
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