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
➜ Heres a Fun one
It is now over 60 days since the last post. This thread is closed.
Refresh page
| Posted by
| WRTIII
Canada (76 posts) Bio
|
| Date
| Tue 21 Jan 2003 09:11 AM (UTC) |
| Message
| Rue Valene.
The Rue St. Lullien Martin is to the east. The Rue de Beaubourg is to the
west. Nearby to your south is the entrance of Clubhouse of the 53rd. Nearby
to your north is the entrance of 53rd Fusiliers Home. You could progress
eastwards, westwards. In your immediate vicinity you see two young black
horses, a sturdy white charger, a brown pony and three battle horses. You see
a letter and the chalice of eternal life behind you.
That is a typical room description in the game. The problem is there is a hard return at the end of each line. so if I want a trigger to match on GOLDEN CHALICE and the Golden is at the end of ine line and the Chalice is at the start of the next line The trigger fails to match.
Now would be good for autogetting items if it would match.
Also good for autowalk because in this place it's not you type EAST and you automaticaly go east.. You type east and it's You begin walking Eastwards and then you move east somewhat sometimes it might take one step sometimes two to get to the same spot. At any rate
Looking for a way to match on more than just the one line I've tried to get around this for quite some time I recall a suggestion about in here awhile ago that I never got to work out, So if anyone has some spare time and is up for a challenge let me know. If anyone wants to take a peek at this place let me know I will let you know the addy in private as to not advertise it over the forums as if you want to help seeing it might explain abit better. Thanks
Bill
| | Top |
|
| Posted by
| Poromenos
Greece (1,037 posts) Bio
|
| Date
| Reply #1 on Tue 21 Jan 2003 09:22 AM (UTC) |
| Message
| | Which brings back the issue of multi line triggers... I thought about what you said about not knowing what to match, nick, and i came up with a scheme... If you had a two line trigger, all you have to do to see if it matches is evaluate the first line with any output line from the mud, and if it matches, evaluate the second line with the next line that came from the MUD. Same thing with more triggers, as well. |
Vidi, Vici, Veni.
http://porocrom.poromenos.org/ Read it! | | Top |
|
| Posted by
| WRTIII
Canada (76 posts) Bio
|
| Date
| Reply #2 on Tue 21 Jan 2003 09:58 AM (UTC) |
| Message
| Well if your going to do that should not limit it to two lines should make it a option of how many lines.
Cause then you could say for my case and the descriptions
Match on the next 5 lines
Line 1: If line 1 matches this text check next line if not cancel operation.
Line 2: If line 2 matches this text check next line if not cancel operation.
and so on
but I figured there would be someway to do this with a script.
Have a trigger so that when it matches the line one text it runs the sub to check the next line and so on and so forth until it is sure that the complete description is correct and matching. | | Top |
|
| Posted by
| Nick Gammon
Australia (23,165 posts) Bio
Forum Administrator |
| Date
| Reply #3 on Tue 21 Jan 2003 10:17 AM (UTC) |
| Message
| OK, have 5 triggers, A, B, C, D, E.
A is enabled initially, the others aren't.
If A matches it enables B (and disables itself). If B matches it enables C and so on. When E matches you know you got the multi-line match.
As for the game problem, is there any way of predicting the start of the sequence, eg a different colour, and the end of the sequence, eg. a blank line? If so, you can start collecting multi-lines (eg. put into an array). Then assemble into one big text block and run through a VB regexp, which was recently described here in the forum. |
- Nick Gammon
www.gammon.com.au, www.mushclient.com | | Top |
|
| Posted by
| Kerrigan
(5 posts) Bio
|
| Date
| Reply #4 on Thu 13 Mar 2003 09:50 AM (UTC) |
| Message
| hi,
what nick describes works really fine (i call it cascading triggers). if i just want to send information to the MUD like "collect xyz" or "kill xyz" that works fine.
i'm working a lot with different colours, what i'm looking for is a possibility to colour this 2 or more parts of a matching text, which are multiline. i havn't found anything yet to colour it after i got the last part of the matching text. i think it isn't possible, because the MUD has already send the sentence, or am i false ?
any advice ?
thx in advance
Kerrigan | | Top |
|
| Posted by
| Nick Gammon
Australia (23,165 posts) Bio
Forum Administrator |
| Date
| Reply #5 on Thu 13 Mar 2003 10:08 PM (UTC) |
| Message
|
Quote:
If A matches it enables B (and disables itself). If B matches it enables C and so on. When E matches you know you got the multi-line match.
After re-reading my advice, I think you should probably not disable A. Otherwise if it doesn't match B (on the next line) then A is still disabled so it won't match A either later on.
However then you have the problem of what will disable B? Probably you need 6 triggers for my example, using sequence numbers:
A, B, C, D, E, *
The * trigger (matching any line) should have a higher sequence number than A to E. That way, if A to E match then the final one won't. This final trigger disables B, C, D, E and enables A, ready to start the sequence again.
To answer your question, no you can't go back and retrospectively colour the earlier lines.
|
- 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.
21,121 views.
It is now over 60 days since the last post. This thread is closed.
Refresh page
top