|
IceSoft Newbie
Joined: 30 Jan 2002 Posts: 7
|
Posted: Mon Feb 18, 2002 5:34 pm
capture problem |
I made a bot that works fine.
The problem is that normaly I get from the mud something like this
Meridas tells you 'fly'
I can grab that but sometimes I get
< 774Hp 1509Mn 410Mv > Meridas tells you 'fly'
How could I responce to that?
IceSoft |
|
|
|
TonDiening GURU
Joined: 26 Jul 2001 Posts: 1958 Location: Canada
|
Posted: Mon Feb 18, 2002 9:24 pm |
I can think of two things to help you:
1) configuration setting in the mud so that
it puts prompts on a newline
2) On your prompt trigger, #SH all the stuff
that comes after the < blah blah >
#TRIGGER {^~< (%d)Hp (%d)Mn (%d)Mv ~> (%*)$} {#SH %1} "" {prompt}
#TRIGGER {^~< (%d)Hp (%d)Mn (%d)Mv ~> $} {} "" {prompt}
Or similarily as Kjata posted with #SUB:
#TRIGGER {{^~< (%d)Hp (%d)Mn (%d)Mv ~> (*)} {#SUB ~<%1Hp %2Mn %3Mv ~>%cr%4} "" {prompt}
TonDiening
Beta Upgrading to 6.26 |
|
|
|
Charbal GURU
Joined: 15 Jun 2001 Posts: 654 Location: USA
|
Posted: Sun Feb 24, 2002 1:01 am |
Try
#trigger {^(%*) tells you '(%*)'$} {#if ("%1" =~ "^~< * ~> (%w) tells you '%*'$") {#say %%1 told me %2} {#say %1 told me %2}
- Charbal |
|
|
|
heidi Newbie
Joined: 04 May 2002 Posts: 1
|
Posted: Tue Apr 02, 2002 7:52 pm |
I ran across this problem in my mud also, but came up with a slightly different approach. The first trigger I have is:
#Trigger {^({o|*})%2>} {#nomap;#sub {%1%2>%cr}} "" {nocr|prompt}
[On MUME your prompt starts with either "o" or "*" and ends with ">". It varies depending on your current activities. In IceSoft's case you would use a trigger like:
{^~< (%d)Hp (%d)Mn (%d)Mv ~>}
]
At first glance this would seem to add a lot of white space, but in my experience it doesn't. What it does do is allow all of your other triggers to assume that the prompt isn't part of the trigger line. This has helped me because I can now more liberally use the "^" character and make my triggers more secure.
One thing to note. I tried doing this at first and had a ton of grief:
#Trigger {^({o|*})%2>%3} {#nomap;#sub {%1%2>%cr}%3} "" {nocr|prompt}
Notice the new "%3" to trigger only when there is information after the prompt. This didn't work at all. My guess is the %{cr} isn't recognized by following triggers as a newline so all the triggers with "^" fail. |
|
|
|
|
|