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
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
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?
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:
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).
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.
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.
* 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.
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
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...
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 <> "" 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</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").
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?
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.
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
Execution of line 118 column 12
Expected 'Then'
Line in error:
if desc <> "" 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
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
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:
* n
You begin to walk northwards.
*
You walk northwards.
Found description: Rue St. Mederic des Assis St. Jacques.The Rue St. Mederic des Assis St. Jacques continues to the north and south.The Rue de la Vanerie is to the west. You could progress northwards,southwards, westwards.* nYou begin to walk northwards.*
I can go: northwards,southwards, westwards
Direction = northwards
Direction = southwards
Direction = westwards
Rue St. Mederic des Assis St. Jacques.
The Rue St. Mederic des Assis St. Jacques continues to the south. The Pont
Notre Dame is to the north. The Rue de Geur is to the east. The Rue de la
Tannerie is to the west. You could progress northwards, eastwards,
southwards, westwards.
* e
You begin to walk eastwards.
*
You walk eastwards.
Found description: Rue St. Mederic des Assis St. Jacques.The Rue St. Mederic des Assis St. Jacques continues to the south. The PontNotre Dame is to the north. The Rue de Geur is to the east. The Rue de laTannerie is to the west. You could progress northwards, eastwards,southwards, westwards.* eYou begin to walk eastwards.*
I can go: northwards, eastwards,southwards, westwards
Direction = northwards
Direction = eastwards
Direction = southwards
Direction = westwards
Rue St. Mederic des Assis St. Jacques.
The Rue St. Mederic des Assis St. Jacques continues to the south. The Pont
Notre Dame is to the north. The Rue de Geur is to the east. The Rue de la
Tannerie is to the west. You could progress northwards, eastwards,
southwards, westwards.
* e
You begin to walk eastwards.
*
You walk eastwards.
Found description: Rue St. Mederic des Assis St. Jacques.The Rue St. Mederic des Assis St. Jacques continues to the south. The PontNotre Dame is to the north. The Rue de Geur is to the east. The Rue de laTannerie is to the west. You could progress northwards, eastwards,southwards, westwards.* eYou begin to walk eastwards.*
I can go: northwards, eastwards,southwards, westwards
Direction = northwards
Direction = eastwards
Direction = southwards
Direction = westwards
Rue de Geur.
The Rue de Geur continues to the east. The Rue St. Mederic des Assis St.
Jacques is to the west. You could progress eastwards, westwards.
* score
Marquis Crea, le Batard de Paris.
Military Rank: Recruit
Social Level: 12 Social Points: 59182
Honour: 1441 Shame: 1
Health: 109 / 113 Experience Points: 2294776
Piety Points: 55
Rank: 51st within Paris, 51st in the Land.
You are sixty three percent off of your personal highest score.
Your account may receive PayPal payments to credit it.
You are a member of The Frog and Peach social club.
Your regiment is: Cardinal's Foot Guards (not yet assigned to a company).
You are a Worshipper at Notre Dame.
You own 595 livres.
You are holding 48 items. You wield nothing.
You are not toadying to anyone.
You are satiated and not thirsty at all.
You are a Kings Bard of the Royal Court.
You are barely tasked in your current employment.
You have 105 discipline points.
You have twenty eight free lessons with the Regimental tutor remaining.
Your scope of vision is fifty yards.
Type STATUS for further information.
* e
You begin to walk eastwards.
*
You walk eastwards.
Found description: Rue de Geur.The Rue de Geur continues to the east. The Rue St. Mederic des Assis St.Jacques is to the west. You could progress eastwards, westwards.* scoreMarquis Crea, le Batard de Paris.Military Rank: RecruitSocial Level: 12 Social Points: 59182Honour: 1441 Shame: 1Health: 109 / 113 Experience Points: 2294776Piety Points: 55Rank: 51st within Paris, 51st in the Land.You are sixty three percent off of your personal highest score.Your account may receive PayPal payments to credit it.You are a member of The Frog and Peach social club.Your regiment is: Cardinal's Foot Guards (not yet assigned to a company).You are a Worshipper at Notre Dame.You own 595 livres.You are holding 48 items. You wield nothing.You are not toadying to anyone.You are satiated and not thirsty at all.You are a Kings Bard of the Royal Court.You are barely tasked in your current employment.You have 105 discipline points.You have twenty eight free lessons with the Regimental tutor remaining.Your scope of vision is fifty yards.Type STATUS for further information.* eYou begin to walk eastwards.*
I can go: eastwards, westwards
Direction = eastwards
Direction = westwards
Rue de Geur.
The Rue de Geur continues to the east. The Rue St. Mederic des Assis St.
Jacques is to the west. You could progress eastwards, westwards.
* *
Ok So in that The scipt is always one room behind and if I do anything other than walk or anything it will end up in the desc.
I am not sure how to edit it to make it work right..
But what I need to do is..
I need it to match on "You walk *." * being any possible direction.
When it matches on that it will copy Every following line until it matches an Asterik which will be on a line of it's on...
* = Normal
/* = I am parrying
*\ = I am sidestepping
/*\ = I am parrying and sidestepping
So the prompt can slightly change which means I need it to match either on all the combinations which there are more than I listed above, or , I need it to match on the next following asterik after You walk *.
So ...
Match: You walk *.
Turn * Trigger on
Copy All following Lins until *.
Match: *
Turn * Trigger off
Evalute the copied text and preform any actions providing feedback.
And I think if I do it that way it should work.
but maybe I am just repeating what I already am doing... bleh grumbles...
One way would be to follow any movement direction with something that you can pick up as the end of the movement. I don't remember exactly what the MUD supports, but on other MUDs you can "think" so I would do something like this:
To move north:
walk north
think --- Movement ended ---
(You would do that with an alias so it happens automatically).
Then the trigger picks up "--- Movement ended ---" (which should appear after the movement happens) and process the room description.
However if the MUD throws in a delay you might have to be more cunning, eg. wait a second and do the think. eg.
world.Send "walk north"
world.DoAfter 1, "think --- Movement ended --"
I don't really have time to write the whole script. I think the general ideas I have presented should be able to be made to work. For instance you could bracket a move with a before *and* after message.
eg.
think "I am about to move"
north
think "I have moved"
Now if everything is echoed in the right order you use the two bracket messages to find the description.
I strongly suspect this MUD is trying hard to defeat this sort of thing, so you may find it tricky.
* SOUTH
You begin to walk southwards.
*
You walk southwards.
Rue St. Mederic des Assis St. Jacques.
Hello there
The Rue St. Mederic des Assis St. Jacques continues to the north and south.
Hello there
You could progress northwards, southwards.
Hello there
* NORTH
Hello there
You begin to walk northwards.
*
You walk northwards.
Rue St. Mederic des Assis St. Jacques.
Hello there
The Rue St. Mederic des Assis St. Jacques continues to the north and south.
Hello there
You could progress northwards, southwards.
Hello there
* .
Hello there
I do not understand.
*
and when I change the one trigger to instead of doing the world note to send %1 to variable "desc" when it is finished I just end up with * in the variable
So I assume I either have to append each of the lines together.. or else I am matching it incorrectly and there is a way to match ALL of the text not each line seperatly which is what it appears to be doing. I am completely lost trying to decypher anything out of the snippet you gave me before although I know what I need to do now just theese small things getting in the way.
Ok also just change world note to note %1 and after each line it shows the line over again... but I don't see in the code you gave me where you are adding all thoose lines together to put them into the desc variable.. so I am thinking maybe I am missing something that will do it as a whole?
---
* n
* n0
You begin to walk northwards.
*
You walk northwards.
Rue St. Mederic des Assis St. Jacques.
Rue St. Mederic des Assis St. Jacques.0
The Rue St. Mederic des Assis St. Jacques continues to the north and south.
The Rue St. Mederic des Assis St. Jacques continues to the north and south.0
You could progress northwards, southwards.
You could progress northwards, southwards.0
* n
* n0
You begin to walk northwards.
*
You walk northwards.
Rue St. Mederic des Assis St. Jacques.
Rue St. Mederic des Assis St. Jacques.0
The Rue St. Mederic des Assis St. Jacques continues to the north and south.
The Rue St. Mederic des Assis St. Jacques continues to the north and south.0
You could progress northwards, southwards.
You could progress northwards, southwards.0
* .
* .0
I do not understand.
* *
---
!!! Oh The 0's in thoose ones came from me trying to use %10 it appeared the same way just without the 0's when I used %1 !!!
-- I saw you used %10 at one point and thought maybe that meant take it all since there are only 9 wildcard spots but doesn't seem to be like that... --
You walk northwards.
Rue V. Monoie.
You are able to see by the light of the lantern. The Rue V. Monoie continues
to the south. The Rue St. Lacque is to the north. You could progress
northwards, southwards.
*
You walk northwards.
Rue St. Lacque.
You are able to see by the light of the lantern. The Rue St. Lacque continues
to the east and west. The Rue V. Monoie is to the north and south. You could
progress northwards, eastwards, southwards, westwards.
*
You walk northwards.
Rue V. Monoie.
You are able to see by the light of the lantern. The Rue V. Monoie continues
to the north. The Rue St. Lacque is to the south. You could progress
northwards, southwards.
*
You walk northwards.
Rue V. Monoie.
You are able to see by the light of the lantern. The Rue V. Monoie continues
to the north. The Rue St. Lacque is to the south. You could progress
northwards, southwards.
*
You walk northwards.
Rue V. Monoie.
You are able to see by the light of the lantern. The Rue V. Monoie continues
to the south. The Rue de Geur is to the north. The Place au Yeux is to the
west. You could progress northwards, southwards, westwards.
* stop
You stop moving
You walk northwards. ---FIRST TRIGGER MATCHES HERE---
Rue V. Monoie. ---START COPYING HERE---
You are able to see by the light of the lantern. The Rue V. Monoie continues
to the south. The Rue de Geur is to the north. The Place au Yeux is to the
west. You could progress northwards, southwards, westwards.
* --- LAST TRIGGER FINISHES HERE AND ADD'S ALL TO VARIBLE WHICH IS WHERE THE PROBLEM LIES ---
If I was to just type WEST then nothing else and the game didn't scroll the screen at all then it would just sit then with the last thing on the last line showing being the * Which means that the last trigger and the one evaluating the desc does not run. until I type something in or the game gives some kinda output. (the line moves)
so when I type WALK WEST it makes me continusly walk to the west with a couple seconds delay between rooms... But as you can see the next line after the * is me moving into the next room so at that point any actions I wanted to do in the previous room will go off and be wasted as I am already 1 room away.
I tried to make the trigger world.send " " at the same time but that didn't work right off cause the trigger was not activating...
It doesn't color the asterik or anything till after the game goes a line past... There must be some way to fix this ... worst case scenario I can think of is a delayed timer working off of the first match and just time it perfectly but that is kinda a mickey mouse way around it I think..
Yes. Well the problem here is the Mushclient assume that if the line has not terminated in some way with a linefeed, then there may be more information pending and it won't fire a trigger. Unless you can alter the prompt to end with a /n (a line feed), you are pretty much out of luck. :(
I suggesting in another thread that this wasn't 100% necessary and you could match partial content and simply delay attempts to match most complex lines until more has arrived. If you want it to only match on a completed line, then there are ways to make it look for the end of a line, and both standard and regular expression triggers have a way. Requiring it to recieve one is often a serious problem and using a timer to make it to stop is in this case pretty useless, since the shortest delay you can create is 1 second. There are bound to be a few issues with changing it, but nothing a slight tweaking of a few triggers or a 'use old bahaviour' switch or something for those that stop working right. I suspect it would be a very small number that would completely mess up with such a change.
"you'll just have to deal with that. The correct signals are sent to
indicate that you are at a prompt once the prompt is sent"
I spoke to the sysops about the problem of the prompt line being incomplete and by the time that it is completed that the data is evaluated too late and that was his response.
Theese "correct signals" are they something I can make MUSHClient pickup on and activate the trigger when it realizes it is on a prompt line?
It doesn't know a prompt line. All that option does is start the *next* line (ie. what you type) at the end of the previous line, if the previous line does not have a line feed.
This subject must have been covered 100 times in the forum by now - trigger matching on lines before the newline appears. The problem is *when* do you match the trigger, given that TCP/IP breaks data up into packets.
Say you get a line:
The PontNotre Dame is to the north. The Rue de Geur is to the east.\n
But, because of TCP/IP packets it is broken into two packets, namely:
1: The PontNotre Dame is to
2: the north. The Rue de Geur is to the east.\n
(Where \n indicates a newline).
If the trigger fires after the first packet, then it gets an incomplete line, and the words "the north" will not be processed, and the trigger match will be wrong.
As Shadowfyr says you can use timers, as described elsewhere, to simulate this partial-line matching. A timer firing every second would not introduce a huge delay, and that could look for if:
* the last line does *not* have a newline
* the last line starts with an asterisk
Then it could process the previous description.
However you would need to combine it with the normal trigger, because it only takes someone in the room to say something, and the line *will* be completed, as the MUD outputs the "say" data.
Ok So when I want to evaluate the text I have stored in the variable "desc"
What you appeared to have used was...
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
And to be honest I don't understand any of that..
All I want for now is for it to search the text and match on any of theese..
Match: (advertising flyer|armour of agemennion|bejewelled casket|bishops mitre|black sceptre|blue cloak|bronze headband|cardinal's shield|cloak de treville|chalice of eternal life|chunk of silver ore|crucifix|cup of our lord|dagger of the ancients|father mazarin's pipe|golden branches|gold fob-watch|hammer of the underworld|helm of artemides|horn of the great boar|jade bracelet|king's snuff box|libram of herbal alchemy|libram of ineffable damnation|lyre of memnon|owl of athena|painting of paris by night|pair of winged shoes|piece of iron ore|queen's silver mirror|rustic shovel|shroud of mourning|silver amulet|silver goblet|silver ring|silver scimitar|staff of hermes|stethoscope|thin telescope|toy scabbard with many scuff marks)
If it matches on any of thoose it will GET %1
plain and simple
If I have to use that "set regex = new regexp" stuff then can someone please explain it in detail or hopefully point me to where I can read how it all works in detail.