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
➜ Wildcards not pulling correctly.
Wildcards not pulling correctly.
|
It is now over 60 days since the last post. This thread is closed.
Refresh page
Posted by
| Sleaker
(24 posts) Bio
|
Date
| Sat 21 Sep 2002 04:04 AM (UTC) |
Message
| Okay I have a trigger:
^[A-Za-z *]*\[(?:.*?)\](?:.*?) x:(?:.*?) y:(?:.*?) z:(?:.*?) r:(.*?) b:(.*?) s:(.*?) h:(.*?) S:(.*?)
you remember this don't you YEAH!
Sample of what it's trying to parse:
PS*[ps]B Alpha Mongoo x: 5 y: 5 z: 0 r: 3.3 b:298 s: 0.0 h: 0 S: S
okay,
When the script runs:
Sub Store_Contact2(thename, theoutput, theparameter)
'Inputs: Contact information from contacts last 5 items.
'Outputs: None.
'Purpose: Store contact data on target for later use.
strRange = World.GetVariable("SecContactColor") & "Range: " & World.GetVariable("PriContactColor") & Trim(theparameter(1))
strSpeed = World.GetVariable("SecContactColor") & "Speed: " & World.GetVariable("PriContactColor") & Trim(theparameter(3))
strHead = World.GetVariable("SecContactColor") & "Head: " & World.GetVariable("PriContactColor") & Trim(theparameter(4))
strStatus = World.GetVariable("SecContactColor") & "Status: " & World.GetVariable("PriContactColor") & Trim(theparameter(5))
StoreContact
End Sub
It just inputs blank values instead of
str = this stuff
so when I try using the info I am using all blank values except for the World.GetVarables.
so the Trim(theparameter(#))s are returning blanks..
Now my first question is, is the trigger correct and then why is it giving blanks back yet the script is still being run.. | Top |
|
Posted by
| Nick Gammon
Australia (23,158 posts) Bio
Forum Administrator |
Date
| Reply #1 on Sat 21 Sep 2002 04:27 AM (UTC) |
Message
| Seems to me you need to "escape" the asterisk, otherwise it is looking for multiple spaces, not a space or an asterisk. I got this to work, I usually try displaying the wildcards first (see example below) and then work on the script.
<triggers>
<trigger
custom_colour="2"
enabled="y"
match="^[A-Za-z \*]*\[(?:.*?)\](?:.*?) x:(?:.*?) y:(?:.*?) z:(?:.*?) r:(.*?) b:(.*?) s:(.*?) h:(.*?) S:(.*?)$"
regexp="y"
send_to="2"
sequence="100"
>
<send>w 1 = %1
w 2 = %2
w 3 = %3
w 4 = %3
w 5 = %5</send>
</trigger>
</triggers>
|
- Nick Gammon
www.gammon.com.au, www.mushclient.com | Top |
|
Posted by
| Sleaker
(24 posts) Bio
|
Date
| Reply #2 on Sat 21 Sep 2002 05:37 AM (UTC) |
Message
| ahh for some reason it liked started working when I put another A-Z inside the first [] | Top |
|
Posted by
| Magnum
Canada (580 posts) Bio
|
Date
| Reply #3 on Sat 21 Sep 2002 04:40 PM (UTC) Amended on Sat 21 Sep 2002 04:48 PM (UTC) by Magnum
|
Message
|
^[A-Za-z \*]*\[(?:.*?)\](?:.*?) x:(?:.*?) y:(?:.*?) z:(?:.*?) r:(.*?) b:(.*?) s:(.*?) h:(.*?) S:(.*?)$
^
^
I think this will be wildcard 1, if I understand that right.
You may want to add more escape characters:
^[A-Za-z \*]*\[(?:.*?)\](?:.*?) x\:(?:.*?) y\:(?:.*?) z\:(?:.*?) r\:(.*?) b\:(.*?) s\:(.*?) h\:(.*?) S\:(.*?)$
...but if you have it working, you may not want to play with it any more. |
Get my plugins here: http://www.magnumsworld.com/muds/
Constantly proving I don't know what I am doing...
Magnum. | Top |
|
Posted by
| Nick Gammon
Australia (23,158 posts) Bio
Forum Administrator |
Date
| Reply #4 on Sat 21 Sep 2002 11:40 PM (UTC) |
Message
|
Quote:
I think this will be wildcard 1, if I understand that right.
No, because it is not in round brackets. |
- 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.
16,728 views.
It is now over 60 days since the last post. This thread is closed.
Refresh page
top