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

Play RetroMUD
Post new topic  Reply to topic     Home » Forums » CMUD General Discussion
tehpopa
Newbie


Joined: 01 Jun 2011
Posts: 4

PostPosted: Thu Jun 02, 2011 3:15 am   

Extracting Map?
 
I'm playing Aardwolf and I want to capture the current room's ANSI map out of the stream and put it into a separate window. Currently, I'm totally lost. I've tried a bunch of different things to capture multiple lines of text but usually I will end up getting a loop of the first line I want to capture. I have figured out how to do a multi state trigger so I've got one that checks for the first line and then the last line. I just don't know how to get everything in between out. Any ideas? If you need a better explanation, please let me know.


Code:
<?xml version="1.0" encoding="ISO-8859-1" ?>
<cmud>
  <trigger name="Get Text" priority="261" enabled="false" copy="yes">
    <pattern></pattern>
    <value>#GAGON</value>
    <trigger name="End Capture" type="Within Lines" param="20">
      <pattern></pattern>
      <value>#GAGOFF</value>
    </trigger>
  </trigger>

</cmud>
Reply with quote
MattLofton
GURU


Joined: 23 Dec 2000
Posts: 4834
Location: USA

PostPosted: Thu Jun 02, 2011 3:21 am   
 
First turn on the maptags in-game: TAGS MAPTAGS ON. You can turn on the mapname and mapexits stuff if you like too. There's also a SHORTMAP that gets rid of blank lines in the map, as well.

I do something a lot more fancy, myself, but all you really need to do is use ^<MAPSTART>$ as the first state's pattern and (*) as the second state's pattern. The second state should be either a manual state or a Within Lines param=1, and you would just test for the existence of <MAPEND>. If it's not that line, you would #capture and #gagspace; if it is, then you would use #STATE 0 to reset the trigger.
_________________
EDIT: I didn't like my old signature
Reply with quote
tehpopa
Newbie


Joined: 01 Jun 2011
Posts: 4

PostPosted: Thu Jun 02, 2011 4:48 am   
 
What variable do I use for the line's data when you're using (*) as a pattern? %1
Reply with quote
Display posts from previous:   
Post new topic   Reply to topic     Home » Forums » CMUD 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