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
➜ Bug reports
➜ Script in 3.20 not working (not a label issue)
Script in 3.20 not working (not a label issue)
|
It is now over 60 days since the last post. This thread is closed.
Refresh page
Posted by
| Wnohgb-washu
USA (5 posts) Bio
|
Date
| Thu 09 May 2002 03:36 PM (UTC) |
Message
| Okay.. I have a trigger that watches for a string, pulls out two variables, and appends them to a notepad window.
It then turns on a "*" line that captures everything.
In that script, it stops with a "." at the end. It is a modified version of a script I found in this forum (sadly, I cannot give credit other than that) for Local Editing in a Moo with Mushclient. Suddenly after upgrading to 3.20 and copying back over my modified example.pl script (yes, using perl) I dont get trigger matching.
So, checking wildcards, I discovered that the data instead of being at:
$world->GetTriggerInfo ($thename, 100 + 1);
..the data is now at
$world->GetTriggerInfo ($thename, 100 + 10);
Whats up with that? Bug? Utter Weirdness? Not sure if this is a feature, change, what-have-you. Still doing tests to narrow this down more. Just curious whether this sounds familiar, if I'm overlooking something, etc. | Top |
|
Posted by
| Nick Gammon
Australia (23,158 posts) Bio
Forum Administrator |
Date
| Reply #1 on Thu 09 May 2002 09:04 PM (UTC) |
Message
| I would have to look at:
a) The match text; and
b) What you are matching on
to comment in greater length.
However, wildcard 10 should be the entire matched text. Possibly you have omitted a bracket. The behaviour should be the same between version 3.20 and recent ones. |
- Nick Gammon
www.gammon.com.au, www.mushclient.com | Top |
|
Posted by
| Wnohgb-washu
USA (5 posts) Bio
|
Date
| Reply #2 on Fri 10 May 2002 03:04 AM (UTC) |
Message
| Trigger: xtest(.*),(.*)$
--output from trigger using ExampleTrigger in examplescript.pl---
You say, "xtest 1,1"
Trigger xTrigger fired.
Matching line was: You say, "xtest 1,1"
Wildcard 1 =
Wildcard 2 = 1"
Wildcard 3 =
Wildcard 4 =
Wildcard 5 =
Wildcard 6 =
Wildcard 7 =
Wildcard 8 =
Wildcard 9 =
Wildcard 10 = xtest 1,1"
-----------------------------------------------------------------
Looks like its not passing the first arg? | Top |
|
Posted by
| Nick Gammon
Australia (23,158 posts) Bio
Forum Administrator |
Date
| Reply #3 on Fri 10 May 2002 04:00 AM (UTC) |
Message
| Oops.
When adding new items for GetTriggerInfo I accidentally deleted selector 101, hence you can't access wildcard 1 any more (that way).
Will be fixed in 3.21. |
- Nick Gammon
www.gammon.com.au, www.mushclient.com | Top |
|
Posted by
| Wnohgb-washu
USA (5 posts) Bio
|
Date
| Reply #4 on Fri 10 May 2002 05:01 AM (UTC) |
Message
| Coolies. Just wanted to make sure I wasn't crazy ^_^ | Top |
|
Posted by
| Wnohgb-washu
USA (5 posts) Bio
|
Date
| Reply #5 on Fri 10 May 2002 04:15 PM (UTC) |
Message
| You mentioned getting trigger info "in that way"..
Is there another way I should be doing it? | Top |
|
Posted by
| Nick Gammon
Australia (23,158 posts) Bio
Forum Administrator |
Date
| Reply #6 on Fri 10 May 2002 10:30 PM (UTC) |
Message
| In VBscript and JScript the easier and preferred way of accessing the wildcard values is to simply use the third argument passed to the trigger.
eg.
sub OnTrigger (strTriggerName, trig_line, arrWildCards)
world.note arrWildCards (1)
end sub
However, try as I might, I couldn't get that to work in Perlscript, hence the introduction of GetTriggerInfo.
However I am not a Perlscript expert, if you can work it out I would be pleased to pass the knowledge on. The data is there (and will be there even in version 3.20), and works in the other scripting languages.
The data type is "variant - which is an array of variants". It seems to work for things like GetTriggerList, like this ...
foreach $item (Win32::OLE::in ($world->GetTriggerList))
{
$world->note($item);
}
However, that technique doesn't seem to work on the third argument to a trigger. |
- 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.
17,103 views.
It is now over 60 days since the last post. This thread is closed.
Refresh page
top