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
➜ arrWildCards question
It is now over 60 days since the last post. This thread is closed.
Refresh page
Posted by
| Beldrew
(3 posts) Bio
|
Date
| Thu 31 Oct 2002 05:52 PM (UTC) |
Message
| I'm trying to make a little function that works with a trigger that is like:
* text * text *
or
1 text 2 text 3
for explination
where 1 and 3 are so the trigger will fire with other stuff in the line, the middle * (2) containes the number I want. However arrWildCards appears to not like the outer *s and bugs out each time. Any suggestions? | Top |
|
Posted by
| Nick Gammon
Australia (23,158 posts) Bio
Forum Administrator |
Date
| Reply #1 on Thu 31 Oct 2002 07:50 PM (UTC) |
Message
| That should work. Make sure the trigger is *not* a regular expression, otherwise those asterisks won't be so good.
Please post your script function so we can see what you are trying to do.
What do you mean "bugs out each time"? In what way? |
- Nick Gammon
www.gammon.com.au, www.mushclient.com | Top |
|
Posted by
| Beldrew
(3 posts) Bio
|
Date
| Reply #2 on Thu 31 Oct 2002 08:12 PM (UTC) |
Message
| I'm trying to automate the amount I study various powers
The error I get is:
Subscript out of range: '[number: 0]'
and it points me at iMaxPower = 2, however if I remove this the line number the error occurs on moves up, to the dims. Makes me think its arrWildCards
The trigger is:
* alter(3): * *
where the middle * is the one I want
the sub is:
sub StudyAlter (strTriggerName, trig_line, arrWildCards)
dim ialter
dim strstudy
dim iMaxPower
iMaxPower = 2
ialter = cint(arrWildCards(0))
if ialter < iMaxPower then
ialter = iMaxPower - ialter
strstudy = "study alter " & ialter
world.note strstudy
end if
end sub | Top |
|
Posted by
| Nick Gammon
Australia (23,158 posts) Bio
Forum Administrator |
Date
| Reply #3 on Thu 31 Oct 2002 08:27 PM (UTC) |
Message
| The first * is arrWildCards (1), the second one is arrWildCards (2) and so on. |
- Nick Gammon
www.gammon.com.au, www.mushclient.com | Top |
|
Posted by
| Beldrew
(3 posts) Bio
|
Date
| Reply #4 on Thu 31 Oct 2002 08:40 PM (UTC) |
Message
| duh, could of sworn I tried that. Thanks, works fine now. | 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.
12,777 views.
It is now over 60 days since the last post. This thread is closed.
Refresh page
top