|
TrEz Newbie
Joined: 02 Aug 2006 Posts: 5
|
Posted: 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 |
|
|
|
Taz GURU
Joined: 28 Sep 2000 Posts: 1395 Location: United Kingdom
|
Posted: Thu Aug 17, 2006 8:49 am |
You can use %s to match white space in triggers.
|
|
_________________ Taz :) |
|
|
|
TrEz Newbie
Joined: 02 Aug 2006 Posts: 5
|
Posted: 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.
|
|
|
|
Vitae Enchanter
Joined: 17 Jun 2005 Posts: 673 Location: New York
|
Posted: Thu Aug 17, 2006 3:39 pm |
(*) (%s) (*)
? |
|
|
|
Kjata GURU
Joined: 10 Oct 2000 Posts: 4379 Location: USA
|
Posted: 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 |
|
|
|
TrEz Newbie
Joined: 02 Aug 2006 Posts: 5
|
Posted: 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 .. |
|
|
|
Vijilante SubAdmin
Joined: 18 Nov 2001 Posts: 5182
|
Posted: 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 |
|
|
|
Vitae Enchanter
Joined: 17 Jun 2005 Posts: 673 Location: New York
|
Posted: 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 ;-) |
|
|
|
|
|