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


Joined: 08 Feb 2010
Posts: 3

PostPosted: Tue Feb 09, 2010 12:42 am   

Capturing mobs/items after exit keyword, before prompt, automatically?
 
I have an odd issue with the automapper, and whilst I've spent the last few days searching through the forums I cannot find the correct solution (so far) so I thought I would ask.

The MUD I play on is an LPMud called Elephant, it is heavily customised and doesn't use room names on look, only on glance (no description).
Ideally I would like to be able to capture the room name, desc, exits AND contents.
However, realistically I can go over rooms twice for the name so I would much rather be able to capture the objects/contents of a room that appear between the exits and my prompt, either automatically with the automapper or with a set of triggers and then add them to the room description that the automapper captures, after the room has been created.

The mapper works perfectly for capturing room descriptions and exits. Occasionally on setting or resetting the configuration it will actually capture the mobs/items in a room too, but then somehow forgets the ability later.

Here is some sample room text:
Code:
Hp:137/137 Mp:43/133 Exp:23,864 TI 0:27>glance
Within the graveyard, next to two graves.
[2: ne, sw]
Winifred.
Hp:137/137 Mp:43/133 Exp:23,864 TI 0:27>


Code:

Hp:137/137 Mp:43/133 Exp:23,864 TI 0:27>look

The high rafters and marble floors give this small room an atmosphere of calm, and faint chill. A serene feel in here seems to eminate from the red velvet curtains blocking all of the high window light. A small parting in the curtains reveals what would appear to be a small alcove towards the north. This is the
Cleric locker room, and for help search for the wise Santiago.
A small sign is tacked above the alcove entrance.
There are two obvious exits: east and south.
Santiago

Battle cloak
Hp:137/137 Mp:43/133 Exp:23,864 TI 0:27>


I hope this makes sense, but if it doesn't please leave a comment so I can attempt to explain myself better.
Reply with quote
myddrun
Wanderer


Joined: 31 Mar 2005
Posts: 58

PostPosted: Tue Feb 09, 2010 12:09 pm   
 
after your two prompts I assume you typed "glance" and "look".

My question is what does the mud tell you if you don't glance or look?
Reply with quote
Szetak
Newbie


Joined: 08 Feb 2010
Posts: 3

PostPosted: Tue Feb 09, 2010 10:04 pm   
 
Yes I typed glance and look. My prompt is set to
Hp:137/137 Mp:133/133 Exp:32,455 TI 22:00>
or
^Hp~:&hp~/&hpm Mp~:&mp~/&mpm Exp~:&exp &stam &time~>
If I simply press enter, I am show 2 promts, seperated by a newline

Code:
Hp:137/137 Mp:133/133 Exp:32,455 TI 22:02>

Hp:137/137 Mp:133/133 Exp:32,455 TI 22:02>


There are no TICK messages like alot of muds out there, there is the occasional weather change or other emotes/atmos but nothing so regular in timing as could be counted on to help.
Reply with quote
Szetak
Newbie


Joined: 08 Feb 2010
Posts: 3

PostPosted: Wed Feb 17, 2010 2:34 pm   
 
Well after some more digging around I found the help on multistate triggers and cobbled the following together.

Code:
#CLASS {MultiLineCap} {enable}
#TRIGGER "CaptureLines" {^(*)obvious exit(*)~:} {
  #SET CaptureLines 3 0
  #var adddesc %line
  }
#COND {} {
  #IF (%line =~ {@EndLine}) {
    #var adddesc %concat( @adddesc, %lf, %line)
    #SET CaptureLines 3 1
    } {
    #var adddesc %concat( @adddesc, %lf, %line)
    }
  } {looplines|param=99|notrig|regex}
#COND {} {
  #NOOP This state is here in case user error caused 99 lines to be captured
  #ECHO Warning multiline capture has been active for 99 lines, EndCapCommand not run.
  #SET CaptureLines 3 1
  }
#COND {} {
  #STATE CaptureLines 0
  #T- MultiLineCap
  #call %roomdesc(%roomnum,%concat(%roomdesc,%lf,@adddesc))
  } {manual}
#CLASS 0


I then intend to activate it with a button press to simply add the information I'm missing to the end of the description in the room I have mapped! I realise this isn't pretty, and therefore any suggestions on making the code tighter anfd more efficient would be appreciated.
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