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


Joined: 02 Aug 2006
Posts: 5

PostPosted: Thu Aug 17, 2006 8:16 am   

Roomname capture.
 
It's.. well not much output, when you type "where <mob>", you get the following output:
Code:

Tabaxi thief               A muddy walkway

or
 
Tabaxi predictor           Inside the Tabaxi Lair

Is there a way to catch everything after the large space in the middle? Tried a trigger capturing next line and disabling, but messes up because of the other mud spam. Any ideas appreciated, I ran out.

zMud 7.21
Reply with quote
Taz
GURU


Joined: 28 Sep 2000
Posts: 1395
Location: United Kingdom

PostPosted: Thu Aug 17, 2006 8:49 am   
 
You can use %s to match white space in triggers.
_________________
Taz :)
Reply with quote
TrEz
Newbie


Joined: 02 Aug 2006
Posts: 5

PostPosted: Thu Aug 17, 2006 2:19 pm   
 
It'll catch single spaces though... And I don't know how much spaces would be in the middle. It might capture only the 1st word of the second part of the line... either way, a simple (*)(%s)(*) doesn't seem to work properly.
Reply with quote
Vitae
Enchanter


Joined: 17 Jun 2005
Posts: 673
Location: New York

PostPosted: Thu Aug 17, 2006 3:39 pm   
 
(*) (%s) (*)

?
_________________
http://www.Aardwolf.com
Reply with quote
Kjata
GURU


Joined: 10 Oct 2000
Posts: 4379
Location: USA

PostPosted: Thu Aug 17, 2006 3:45 pm   
 
It should work. %s matches any amount of spaces. What exactly is it doing when you use that pattern that you don't want it to do?
_________________
Kjata
Reply with quote
TrEz
Newbie


Joined: 02 Aug 2006
Posts: 5

PostPosted: Thu Aug 17, 2006 6:38 pm   
 
Captures the last word, or captures every other line that appears on the screen, or captures nothing.. I tried enabling the trigger's class for 1 second, then disabling it again, but I have other text interfering.

I just wanted to make a trigger that would capture the second part, without being too general(capturing other lines in the process as less times as possible.)

Also tried changing the pattern to #va varname %2, %3, etc., but ..
Reply with quote
Vijilante
SubAdmin


Joined: 18 Nov 2001
Posts: 5182

PostPosted: Thu Aug 17, 2006 10:54 pm   
 
You will like have to do this with a regex pattern.
#REGEX {(.*) {10,}(.*)} {#VAR Mob {%1};#VAR Room {%2}}
This regex will require that at least 10 spaces are in between the 2 things.
_________________
The only good questions are the ones we have never answered before.
Search the Forums
Reply with quote
Vitae
Enchanter


Joined: 17 Jun 2005
Posts: 673
Location: New York

PostPosted: Fri Aug 18, 2006 12:41 am   
 
Vijilante, problem with that is that Aardwolf (which I'm betting this is for) at times will have only one space between the mob and the room.
It depends on the length of the mobs name
Code:
a young apprentice magic user The Apprentices' Barracks
a lost adventurer            A Small Clearing
The cook's assistant         The Kitchen
a young apprentice           The Apprentices' Barracks
the scribe's assistant       The Master Scribe's Workshop


As you can tell, generally the room starts on the 30th character.
Of course if the mob name is longer then there is just one space.

then you have the TOTALLY whacked out (and VERY rare) ones like this:
a colorful bikini Golden Sands
The thing with THIS one is that each letter of the word "colorful" is a differrent color and Aardwolf thinks that each piece of code for the colors (@R for bright red) is an actual character and adds it up so it thinks likes like this:
a 12c12o12l12o12r12f12u12l12 bikini Golden Sands
meaning that the room technically starts on the 37th character but is really the 19th.

My best suggestion is if you have the areas mapped that you loop thru, store each rooms name using #addkey and then have it compare somehow and extract from there which is the mob and which is the room.
Don't even ask me how to do this. That's what the Guru's are for ;-)
_________________
http://www.Aardwolf.com
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