To get the wildcard contents you index into the strWildcard array - see below.
Also, you cannot have duplicate trigger labels, so I have changed it to generate a unique number, as in:
"auto" & world.GetUniqueNumber
This will automatically label each added trigger like this:
auto5, auto6, auto7 and so on.
Finally, it helps if you check the error status - sometimes it is not obvious what is wrong, for instance the duplicate label problem means the first one would work but not the second one. By checking the error code, and displaying it if non-zero you can see what the problem is. The meaning of the error codes is listed at the front of the supplied file exampscript.vbs and also on the web page:
http://www.gammon.com.au/mushclient/functions.htm
Here is the amended script:
sub doactiontarget (strAliasName, strOutput, strWildcard)
err = world.addtrigger ("auto" & world.GetUniqueNumber, _
strWildcard (1) , strWildcard (2) , 545, custom16, _
0, "", "")
if err <> 0 then
world.note "Error adding trigger, error number = " & err
End If
end sub
|