Register forum user name Search FAQ

Gammon Forum

Notice: Any messages purporting to come from this site telling you that your password has expired, or that you need to verify your details, confirm your email, resolve issues, making threats, or asking for money, are spam. We do not email users with any such messages. If you have lost your password you can obtain a new one by using the password reset link.

Due to spam on this forum, all posts now need moderator approval.

 Entire forum ➜ MUSHclient ➜ VBscript ➜ Multi Line Matching per say

Multi Line Matching per say

It is now over 60 days since the last post. This thread is closed.     Refresh page


Pages: 1 2  3  

Posted by WRTIII   Canada  (76 posts)  Bio
Date Fri 02 Jan 2004 07:15 AM (UTC)
Message
Ok I have found a pattern I hope will work. first here is a couple examples of a room desc from the mud.

----
*
You walk eastwards.
Rue de la lune.
The Rue de la lune continues to the east. The Rue St. Denis is to the west.
Fourteen yards to the west is the entrance to Red Phillips. Twenty nine yards
to the west is the entrance to Le Mansion du Chein. Nearby to your south is
the entrance of The Gilded Gem. You could progress eastwards, westwards.
Ahead up the street you see Marquise Gueanor la Riveite. In your immediate
vicinity you see a dead wild dog. You see a dead ruffian and a young black
horse behind you.
*
You walk eastwards.
Rue de la lune.
The Rue de la lune continues to the east. The Rue St. Denis is to the west.
Twenty four yards to the west is the entrance to Red Phillips. Thirty nine
yards to the west is the entrance to Le Mansion du Chein. Nearby to your
south is the entrance of The Gilded Gem. You could progress eastwards,
westwards. You see a dead wild dog, a dead ruffian and a young black horse
behind you.

-----

So Lets say I want to get the dead dog, the problem is you cannot get the dead dog unless I am in the immediate vicinity and if it is slightly behind or ahead of me it still sets off the trigger.

And I can't set a trigger to include the whole line cause it is not always on a line, same with DEAD WILD DOG there is a chance that is not always on the same line.

What I have seen though is that the words IN YOUR IMMEDIATE VICINITY as least with 2 hours of watching are always on the same line

I was thinking first that I could have it watch for items I want to get if it finds a match then a script would take the current and previous 2 lines of text and check them for the words IN YOUR IMMEDIATE VICINITY but I am not sure how long it would take mushclient to do that either and that still leaves the problem of matching the artifacts.

But what if I could have a trigger match on IN YOUR IMMEDIATE VICINITY and then take the current and next following five lines put then all together and then search thoose 6 lines of text for any matching items on my list to get.

Not even sure of how I would go about half of that but in theory at least to my ears it should work. Any help or suggestion or comments would be appreciated.
Thanks
Top

Posted by Ked   Russia  (524 posts)  Bio
Date Reply #1 on Fri 02 Jan 2004 08:35 AM (UTC)
Message
Actually, it seems easier to do it the other way around: wait for words IN YOUR IMMEDIATE VICINITY and upon receiving them enable the triggers for the items you want to get. You could enable the "vicinity" trigger upon recieving the line "You walk <direction>." So it would go something like this:

1. "^You walk (eastwards|westwards|southwards|etc)\.$"
Enable the "vicinity" trigger

2. "* in your immediate vicinity *"
Enable the item triggers
Disable the "vicinity" trigger

3. "* a dead wild dog *"
Get dog
Top

Posted by WRTIII   Canada  (76 posts)  Bio
Date Reply #2 on Fri 02 Jan 2004 09:08 AM (UTC)
Message
well I had figured just having an alias to turn it on and off at will, if I am at the keyboard I don't need to have it automaticaly pick the stuff up but it is to work along with my autowalk stuff that I have done

and the problem remains that it might be

------Imediate VicinityYou See A Dead
Wild Dog-----------------------------

So it would not match on A Dead Wild Dog

So I guess what I really need to know is.. If I make a trigger that will match on --"In your Immediate Vicinity"--

What do I have to do to make mushclient take the rest of the current and the follow 2 lines combine them together and then check it for anything I want to manipulate?
Top

Posted by Nick Gammon   Australia  (23,165 posts)  Bio   Forum Administrator
Date Reply #3 on Fri 02 Jan 2004 08:04 PM (UTC)

Amended on Fri 02 Jan 2004 08:07 PM (UTC) by Nick Gammon

Message
This looks familiar. It is like a MUD I played a while back "Age Of The Throne".

I thought when I played it that it was designed, intentionally or otherwise, to make it hard for client-based triggers. Unlike some MUDs the rooms contents are not laid out in a nice list, and the exits are similarly all run together in one long description. Plus, the description has hard carriage-returns so you cannot easily make a trigger on the whole thing.

However I think it *can* be done - I just didn't have the energy at the time. :)

You will note that a description starts (or ends) with a line with an asterisk on it. This should be enough to make a nice set of triggers.

The general idea is to "collect" a group of lines, assemble them into a single paragraph, and then search for keywords like "in your immediate vicinity you see a *", and "nearby to the * is *", and so on.

What you need to do is:


  1. Identify the start of a description (eg. a line with "*" on it), or a line with "You walk *" on it.

    When you have done that you empty out a variable holding the current room description. You also enable trigger (2) below, and disable trigger (1) (itself).

  2. Gather the lines of the description. In this case a trigger matching everything would do it. This trigger would add each line to the current room description.

  3. Identify the end of the description. This could be the line with "*" on it, or if that doesn't work, a short line (eg. less than 60 characters), or a long line which does not end with a period. You now disable trigger (2) and trigger (3) (itself), enable trigger (1), and proceed to analyze the line.



Once you have identified the end of the description, run the collected description through a regular expression to pluck out the relevant parts.

See:


http://www.gammon.com.au/forum/bbshowpost.php?bbsubject_id=1291


for a description of doing that.

Let us know how you go - this could be a useful tip for others playing this game.

- Nick Gammon

www.gammon.com.au, www.mushclient.com
Top

Posted by WRTIII   Canada  (76 posts)  Bio
Date Reply #4 on Fri 02 Jan 2004 10:31 PM (UTC)
Message
* l
Guardroom of the Louvre.
The Guardroom is where a company of Guards from either the Kings Musketeers or
the Royal Foot Guards reside to protect His Majesty when he is in residence,
and the Palace from the many who may seek to gain enterance without
permission. You could progress northwards, inwards (a closed solid iron
door). Oliver, Captain of the King's Palace Guard stands before you, imposing
a strong sense of order and control. A large, warming fireplace cast from
black iron is set into the wall of the room. A veteran stands casually
nearby. A comfortable canvas covered hammock sways here invitingly.
* get hammock
You take a hammock.
* n
Louvre Gatehouse.
One of the principle entrances to the Louvre, and also the closest that most
citizens of France get to be to the seat of power, the Louvre Gatehouse keeps
Paris outside of the Royal Palace. Beyond the fancy, but otherwise seemingly
strong, gates, a vast courtyard stretches as into the distance with
reflections bouncing off of the glass at the other end. Sentries from the
Royal Foot guards stand at the gate, ready to repel any would be trespassers.
You could progress northwards, eastwards, southwards, upwards, outwards (an
open thick oak door). A scribe of the Royal Court stands here, ready to
assist with any query. An oil tin rests on the ground.
* o
You walk out of the building.
It is dark here, you can see nothing.
* light lantern
You light a dull brass lantern which begins to glow brightly.
* l
Rue de Lauftrache.
You are able to see by the light of the lantern. The Rue de Lauftrache
continues to the north and south. Nearby to your east is the entrance of The
Louvre, over which a flagpole is extended. Twenty yards to the south is the
entrance to La Cerise Ivre. Nearby to your west is the entrance of
Bastillion's Hovel. You could progress northwards, southwards. In your
immediate vicinity you see a musketeer, a stone water trough with twenty five
young black horses, sixteen sturdy white chargers, fifteen great warhorses,
twelve brown ponys, thirteen battle horses and a black thoroughbred tethered
securely to its hoops and a young black horse. You see five city guards and
an oil tin behind you.
*
Your lantern has gone out.
* go louvre
You enter The Louvre.
Louvre Gatehouse.
One of the principle entrances to the Louvre, and also the closest that most
citizens of France get to be to the seat of power, the Louvre Gatehouse keeps
Paris outside of the Royal Palace. Beyond the fancy, but otherwise seemingly
strong, gates, a vast courtyard stretches as into the distance with
reflections bouncing off of the glass at the other end. Sentries from the
Royal Foot guards stand at the gate, ready to repel any would be trespassers.
You could progress northwards, eastwards, southwards, upwards, outwards (an
open thick oak door). A scribe of the Royal Court stands here, ready to
assist with any query. An oil tin rests on the ground.
* n
The Counsellor's Chamber.
The lantern carried by Marquis Lazare de Bonnac casts light over your
surroundings. You could progress northwards, southwards. Marquis Lazare de
Bonnac is here. Baroness Amelie L'Estrange is here. Viscomte Lawrence Oliviet
is here. Honourary Chevalier Bartyn is here. Baroness Rainna is here. Comtess
Erin McKensie, d'Irlande is here. Corporal Sofia of the Cardinal's Foot
Guards is here. Duchess Miichelle la Petite Mignon is here. A stone fountain
rests in the middle of the square, clear drinking water bubbling from the
depths of the earth to splash into its centre. A Palace Guard dressed in the
finest uniform of the Foot Guards stands to attention nearby. A trash tub
sits here. A large, warming fireplace cast from black iron is set into the
wall of the room. A veteran stands casually nearby. The Counsellor of Paris
stands here, his white-trim robes laced with silver.
*
Baron Aranel, l'Ange de Vie declares that he will guide Holcken.
*
Viscomte Lawrence Oliviet says, "You know how women are nowadays".
*
Baroness Amelie L'Estrange says, "Okies".
*


Found a spot where IN YOUR IMMEDIATE VICINITY is split onto two lines.. and which the stars being on lines of their own I do not see how I could differentiate from a beginning star to a finishing star... If anyone sees anyway to make a start and a finish suggestions would be very much welcomed.

This is a problem I have been working with for quite some time and still cannot find a way around the hard returns.

And Nick yes if I recall I was attempting this before and you actually asked if the asteriks really showed up and then you were curious which mud it was which would probaly be where you got the addy and checked it out from. :) I appreciate your suggestions and thoughts on this I would love to figure something out.
Top

Posted by WRTIII   Canada  (76 posts)  Bio
Date Reply #5 on Fri 02 Jan 2004 10:42 PM (UTC)
Message
Ok so...

securely to its hoops, a young black horse and an oil tin. You see five city
guards, an oil tin and a battle horse ahead of you.
* n

Corporal Sofia of the Cardinal's Foot Guards rides a battlehorse past you,
heading east.
* You begin to walk northwards.
*
Corporal Sofia of the Cardinal's Foot Guards dismounts a battle horse.
*
Corporal Sofia of the Cardinal's Foot Guards ties a battle horse up to a stone
water trough.
*
You walk northwards.
Rue de Lauftrache.
You are able to see by the light of the lantern. The Rue de Lauftrache
continues to the north and south. Nearby to your east is the entrance of The
Louvre, over which a flagpole is extended. Thirty yards to the south is the
entrance to La Cerise Ivre. Twenty yards to the south is the entrance to
Bastillion's Hovel. You could progress northwards, southwards. Behind
you you see Corporal Sofia of the Cardinal's Foot Guards. In your immediate
vicinity you see a musketeer, a stone water trough with twenty five young
black horses, fifteen sturdy white chargers, fifteen great warhorses, twelve
brown ponys, thirteen battle horses and a black thoroughbred tethered
securely to its hoops, a young black horse and an oil tin. You see five city
guards and an oil tin behind you.
*
Behind you you observe:
Corporal Sofia of the Cardinal's Foot Guards enters The Louvre.
*
A young messenger arrives, "Baron Crea, le Batard de Paris, you have no quest.
I can take you to the counsellor that you might gain one if you like?".
Type AGREE if you wish to take up a quest.
*


n
You begin to walk northwards.
You walk northwards (MATCH HERE AND COPY EVERYTHING UNTIL YOU REACH THE NEXT ASTERIK)
* (STOP MATCHING AND RESET TRIGGERS)
Evaluate the text and check for anything needed.

Problems.
a) I do not know how to make mushclient take all the contents from You walk dir -> * hehe


b) Will mushclient be able to register the information quick enough before I am gone past into the next room
** Maybe instead of letting the game autowalk me will need to setup something that makes me continue in the direction I was going after the text has been evaluated and any actions executed?**

c) I'm a dumbass and forget most this stuff yet again so at the time am fairly helpless to be taking on such a big project lol hence your patience and assistance would be greatly appreciated

d) Hmm Don't think I can think of a d yet... hehe

Thanks
Wrtiii
Top

Posted by Nick Gammon   Australia  (23,165 posts)  Bio   Forum Administrator
Date Reply #6 on Sat 03 Jan 2004 04:35 AM (UTC)
Message
Quote:

I do not see how I could differentiate from a beginning star to a finishing star...


It doesn't really matter. If you are collecting a description, then a star must be a finishing star, otherwise it is a starting star.

You can't match stars in a normal trigger, as a star is a wildcard. You need a regular expression, eg.

Match: ^\*.*$
Regular expression: checked

That would match *(something).

Quote:

I do not know how to make mushclient take all the contents ...


Make a trigger that matches "*" (ie. everything). Enable it when required. It would call a small script that appends to a variable. Something like:

world.SetVariable "desc", world.GetVariable ("desc") & %0




- Nick Gammon

www.gammon.com.au, www.mushclient.com
Top

Posted by WRTIII   Canada  (76 posts)  Bio
Date Reply #7 on Sun 04 Jan 2004 06:16 AM (UTC)
Message
Unless I missed something with each line having a hard return even if I was to match something like

*
a
b
c
d
e
f
*

each line has a hard return so if on the trigger * I matched everything I would only get an * in return when on the first * I need to to match

a
b
c
d
e
f
and then turn off on the second *

That is what I am not sure how to do is how to make it take every line and store it together as one in a variable... and now that I think of it how do I search a varible for any matches as well...

Top

Posted by Nick Gammon   Australia  (23,165 posts)  Bio   Forum Administrator
Date Reply #8 on Sun 04 Jan 2004 08:10 PM (UTC)

Amended on Sun 04 Jan 2004 08:12 PM (UTC) by Nick Gammon

Message
OK, here is my interim solution. Build on this for a better one ...


<triggers>
  <trigger
   custom_colour="4"
   enabled="y"
   match="^\*.*"
   name="Asterisk"
   regexp="y"
   send_to="12"
   sequence="90"
  >
  <send>desc = GetVariable ("desc")
if desc &lt;&gt; "" then

'
' DEBUG: Note found text
'
  Note "Found description: " &amp; desc

'
'  Clear this description ready for next one
'
  SetVariable "desc", ""

'
'  Analyse description
'

  Set regEx = New RegExp

' get trigger match text
  regEx.Pattern = "In your immediate vicinity you see ([^.]*)\.?"

  Set Matches = regEx.Execute(desc)

  For Each match in Matches
  
    ColourNote "blue", "white", _
      "In my vicinity is: " &amp; Match.SubMatches (0)

    items = Split (Match.SubMatches (0), ",")

    For Each item in Items
      ColourNote "green", "white", "Item = " &amp; Trim (item)
    Next

  Next

  Set Match = Nothing

  regEx.Pattern = "You could progress ([^.]*)\.?"

  Set Matches = regEx.Execute(desc)

  For Each match in Matches
  
    ColourNote "blue", "white", _
      "I can go: " &amp; Match.SubMatches (0)

    items = Split (Match.SubMatches (0), ",")

    For Each item in Items
      ColourNote "green", "white", "Direction = " &amp; Trim (item)
    Next

  Next

  Set regEx = Nothing

end if  ' have a description</send>
  </trigger>
  <trigger
   enabled="y"
   match="*"
   name="Description"
   send_to="12"
   sequence="100"
  >
  <send>SetVariable "desc", GetVariable ("desc") + "%0 "</send>
  </trigger>
</triggers>


The first trigger matches * followed by something which is used to evaluate the previous description, and then clear it out ready for a new one.

The second trigger matches every line (excepting ones matched by the first trigger). This simply adds to the current description.

At the * point the collected description is run through the VB regular expression parser twice - once to pull out things in the immediate vicinity, and again to find directions we can walk. You could repeat this part to extract other things (like people nearby).

Here is an example of its debug output on one of your descriptions:


* l
Rue de Lauftrache.
You are able to see by the light of the lantern. The Rue de Lauftrache
continues to the north and south. Nearby to your east is the entrance of The
Louvre, over which a flagpole is extended. Twenty yards to the south is the
entrance to La Cerise Ivre. Nearby to your west is the entrance of
Bastillion's Hovel. You could progress northwards, southwards. In your
immediate vicinity you see a musketeer, a stone water trough with twenty five
young black horses, sixteen sturdy white chargers, fifteen great warhorses,
twelve brown ponys, thirteen battle horses and a black thoroughbred tethered
securely to its hoops and a young black horse. You see five city guards and
an oil tin behind you.
*
Found description: * l Rue de Lauftrache. You are able to see by the light of the lantern. The Rue de Lauftrache continues to the north and south. Nearby to your east is the entrance of The Louvre, over which a flagpole is extended. Twenty yards to the south is the entrance to La Cerise Ivre. Nearby to your west is the entrance of Bastillion's Hovel. You could progress northwards, southwards. In your immediate vicinity you see a musketeer, a stone water trough with twenty five young black horses, sixteen sturdy white chargers, fifteen great warhorses, twelve brown ponys, thirteen battle horses and a black thoroughbred tethered securely to its hoops and a young black horse. You see five city guards and an oil tin behind you.

In my vicinity is: a musketeer, a stone water trough with twenty five young black horses, sixteen sturdy white chargers, fifteen great warhorses, twelve brown ponys, thirteen battle horses and a black thoroughbred tethered securely to its hoops and a young black horse

Item = a musketeer
Item = a stone water trough with twenty five young black horses
Item = sixteen sturdy white chargers
Item = fifteen great warhorses
Item = twelve brown ponys
Item = thirteen battle horses and a black thoroughbred tethered securely to its hoops and a young black horse


I can go: northwards, southwards
Direction = northwards
Direction = southwards



Note how it has found the things in the nearby vicinity, and then used Split to break them up into individual items. Similarly for the directions I can go.

Now of course in practice you would not actually display it, but act on it (eg. "get twelve brown ponys", "go northwards").

- Nick Gammon

www.gammon.com.au, www.mushclient.com
Top

Posted by WRTIII   Canada  (76 posts)  Bio
Date Reply #9 on Sun 04 Jan 2004 09:06 PM (UTC)
Message
You begin to walk southwards.
*
You walk southwards.
Found description: * l Rue de Lauftrache. All about you is wreathed in shadows. The Rue de Lauftrache continues to the north and south. Nearby to your east is the entrance of The Louvre, over which a flagpole is extended. Twenty yards to the south is the entrance to La Cerise Ivre. Nearby to your west is the entrance of Bastillion's Hovel. You could progress northwards, southwards. In your immediate vicinity you see a musketeer and a stone water trough with twenty six young black horses, seventeen sturdy white chargers, eleven brown ponys, thirteen great warhorses, ten battle horses and a black thoroughbred tethered securely to its hoops. You see five city guards and a young black horse ahead of you. * drink There is nothing to drink here. * s You begin to walk southwards. *
In my vicinity is: a musketeer and a stone water trough with twenty six young black horses, seventeen sturdy white chargers, eleven brown ponys, thirteen great warhorses, ten battle horses and a black thoroughbred tethered securely to its hoops
Item = a musketeer and a stone water trough with twenty six young black horses
Item = seventeen sturdy white chargers
Item = eleven brown ponys
Item = thirteen great warhorses
Item = ten battle horses and a black thoroughbred tethered securely to its hoops
I can go: northwards, southwards
Direction = northwards
Direction = southwards
Rue de Lauftrache.
All about you is wreathed in shadows. The Rue de Lauftrache continues to the
north and south. Nearby to your east is the entrance of The Louvre, over
which a flagpole is extended. Nearby to your west is the entrance of La
Cerise Ivre. Nearby to your west is the entrance of Bastillion's Hovel. You
could progress northwards, southwards. In your immediate vicinity you see two
city guards, a musketeer and a stone water trough with twenty six young black
horses, seventeen sturdy white chargers, eleven brown ponys, thirteen great
warhorses, ten battle horses and a black thoroughbred tethered securely to
its hoops. You see two city guards, a young black horse ahead of you. You see
a city guard behind you.
*

After very small changes since matching on the stars was always one room behind and it went off while I was talking and stuff since the stars are always nonstop etc. I changed it to you walk

When I type north the mud replys
You begin to walk north
When I actually move north it then says
You move nortwards
So matching on that and ending on the next star that is the return on got.
Now that I got that to work off of.

I change it so it acts on certain things and instead of displaying the desc and the other info It will pick out all the important information hence
Road Name
Dirs to go
Items and People Nearby
Items and People in Immediate Vicinity
even thinking now that I might be able to make it smart even to take out and say for dirs

Road Name
You can go north - Street A
You can go east - Street B
You can go west - Street B
You can go in - Store
Person A and B are Nearby to the West
Person C and Horse are beside you
You pickup Item A

something along thoose lines

Thanks :) I shall definatly be expanding on this and I think it will work very well


Would I be better off to have the trigger call on a script though instead of the code stuff being right in the trigger?
Top

Posted by Shadowfyr   USA  (1,791 posts)  Bio
Date Reply #10 on Sun 04 Jan 2004 11:01 PM (UTC)
Message
Considering the likely complexity involved, a true script would be a lot easier to edit. You may want to make sure that the setting to auto-reload a modified script is selected, so when you do save changes it begins working immediately.
Top

Posted by WRTIII   Canada  (76 posts)  Bio
Date Reply #11 on Wed 07 Jan 2004 11:36 PM (UTC)
Message
sub descget (sName, sLine, wildcards)
desc = GetVariable ("desc")
if desc &lt;&gt; "" then

'
' DEBUG: Note found text
'
Note "Found description: " &amp; desc

'
' Clear this description ready for next one
'
SetVariable "desc", ""

'
' Analyse description
'

Set regEx = New RegExp

' get trigger match text
regEx.Pattern = "In your immediate vicinity you see ([^.]*)\.?"

Set Matches = regEx.Execute(desc)

For Each match in Matches

ColourNote "blue", "white", _
"In my vicinity is: " &amp; Match.SubMatches (0)

items = Split (Match.SubMatches (0), ",")

For Each item in Items
ColourNote "green", "white", "Item = " &amp; Trim (item)
Next

Next

Set Match = Nothing

regEx.Pattern = "You could progress ([^.]*)\.?"

Set Matches = regEx.Execute(desc)

For Each match in Matches

ColourNote "blue", "white", _
"I can go: " &amp; Match.SubMatches (0)

items = Split (Match.SubMatches (0), ",")

For Each item in Items
ColourNote "green", "white", "Direction = " &amp; Trim (item)
Next

Next

Set regEx = Nothing

end if ' have a description
end sub


Execution of line 118 column 12
Expected 'Then'
Line in error:
if desc &lt;&gt; "" then

Immediate Execution

Thought maybe I had to declare the desc varible but that didn't work So I am guessing there must be some diffrences it what I was given to work from and vbscript

I have no idea what the @lt @gt @amp or to be honest how most that script works so I am somewhat flying blindly here and without having it work from the get go it's hard for me to edit it to work how I need it to

Thanks
Top

Posted by Nick Gammon   Australia  (23,165 posts)  Bio   Forum Administrator
Date Reply #12 on Thu 08 Jan 2004 03:14 AM (UTC)
Message
Copy the whole script into the MUSHclient notepad, then select Convert -> Unconvert HTML Special.

That will convert:

&lt; to <
&gt; to >
&amp; to &

Then it should work.

- Nick Gammon

www.gammon.com.au, www.mushclient.com
Top

Posted by WRTIII   Canada  (76 posts)  Bio
Date Reply #13 on Thu 08 Jan 2004 10:57 PM (UTC)
Message
<variables>
<variable name="desc">%0 %0 %0 %0 %0 %0 %0 %0 </variable>
</variables>

<triggers>
<trigger
enabled="y"
match="*"
name="descfin"
script="descfin"
sequence="101"
other_text_colour="black"
other_back_colour="black"
>
</trigger>
<trigger
custom_colour="4"
enabled="y"
match="You walk *."
name="descget"
script="descget"
sequence="90"
other_text_colour="black"
other_back_colour="black"
>
</trigger>
</triggers>


sub descget (sName, sLine, wildcards)
desc = GetVariable ("desc")
if desc <> "" then

'
' DEBUG: Note found text
'
Note "Found description: " & desc

'
' Clear this description ready for next one
'
SetVariable "desc", ""

'
' Analyse description
'

Set regEx = New RegExp

' get trigger match text
regEx.Pattern = "In your immediate vicinity you see ([^.]*)\.?"

Set Matches = regEx.Execute(desc)

For Each match in Matches

ColourNote "blue", "white", _
"In my vicinity is: " & Match.SubMatches (0)

items = Split (Match.SubMatches (0), ",")

For Each item in Items
ColourNote "green", "white", "Item = " & Trim (item)
Next

Next

Set Match = Nothing

regEx.Pattern = "You could progress ([^.]*)\.?"

Set Matches = regEx.Execute(desc)

For Each match in Matches

ColourNote "blue", "white", _
"I can go: " & Match.SubMatches (0)

items = Split (Match.SubMatches (0), ",")

For Each item in Items
ColourNote "green", "white", "Direction = " & Trim (item)
Next

Next

Set regEx = Nothing

end if ' have a description
end sub

sub descfin (sName, sLine, wildcards)
SetVariable "desc", GetVariable ("desc") + "%0 "
end sub



That is what I am using, This is what I am getting..

*\ You begin to walk northwards.
/*\
You walk northwards.
Found description: %0 %0 %0 %0 %0 %0 %0 %0 %0 %0
Rue des Filles Dieu.
You are able to see by the light of the lantern. The Rue des Filles Dieu
continues to the east and west. The Rue a cote le rue des Filles est Clery is
to the south. You could progress eastwards, southwards, westwards.
/*\ e
You begin to walk eastwards.
/*\
You walk eastwards.
Found description: %0 %0 %0 %0 %0 %0 %0
Rue des Filles Dieu.
You are able to see by the light of the lantern. The Rue des Filles Dieu
continues to the west. The Rue Mont Orqueil is to the east. You could
progress eastwards, westwards.
/*\
Ahead up the street you observe:
Corporal Chadwick of the Gascon Regiment rides a battlehorse away from you,
heading south.
/*\ e
You begin to walk eastwards.
/*\
You walk eastwards.
Found description: %0 %0 %0 %0 %0 %0 %0 %0 %0 %0 %0
Rue des Filles Dieu.
You are able to see by the light of the lantern. The Rue des Filles Dieu
continues to the west. The Rue Mont Orqueil is to the east. You could
progress eastwards, westwards.
/*\
-- The headband is held by Sergeant Gerard of the 53rd Fusiliers who walks
along Les Peritentes Le Sepulchre --
/*\


I have played with making slight changes but don't really want to do anything major until I have it working as is then will fiddle with and edit it to what I want/need...
Thanks in advance for the help and advice yes I know I am a pain in the ass :) thanks again

Top

Posted by Nick Gammon   Australia  (23,165 posts)  Bio   Forum Administrator
Date Reply #14 on Fri 09 Jan 2004 06:08 AM (UTC)
Message
When you are doing "send to script" the trigger evaluator turns %0 in the matching line. However if you are doing a trigger *script* like you are now doing then this line:

SetVariable "desc", GetVariable ("desc") + "%0 "

needs to change to:

SetVariable "desc", GetVariable ("desc") + wildcards (10)

- Nick Gammon

www.gammon.com.au, www.mushclient.com
Top

The dates and times for posts above are shown in Universal Co-ordinated Time (UTC).

To show them in your local time you can join the forum, and then set the 'time correction' field in your profile to the number of hours difference between your location and UTC time.


98,184 views.

This is page 1, subject is 3 pages long: 1 2  3  [Next page]

It is now over 60 days since the last post. This thread is closed.     Refresh page

Go to topic:           Search the forum


[Go to top] top

Information and images on this site are licensed under the Creative Commons Attribution 3.0 Australia License unless stated otherwise.