arrWildCards question

Posted by Beldrew on Thu 31 Oct 2002 05:52 PM — 5 posts, 16,494 views.

#0
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?
Australia Forum Administrator #1
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?
#2
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
Australia Forum Administrator #3
The first * is arrWildCards (1), the second one is arrWildCards (2) and so on.
#4
duh, could of sworn I tried that. Thanks, works fine now.