Trigger -> script throwing popup

Posted by Zook on Sat 23 Oct 2004 04:21 AM — 3 posts, 15,220 views.

#0
Here's my RegEx:
((?:.*) (?:damaged) (.*) just broke(.*))

Here's my script:
function brokenItem(name, line, wildcardsVB) {
wildcards = VBArray(wildcardsVB).toArray();
world.Note("Broken " + wildcards[1] + " detected...");
world.Execute("drop " + wildcards[1]);
world.Execute("get " + wildcards[1] + " from backpack");
world.Execute("use " + wildcards[1]);
}

Now when I test (with string below) the process works. The commands are sent to the world, but only after I clear a message box with the following information

Quote:

Error: -2146827282
Event: Execution of line 1 column 11
Description:
Expected ')'
Line in error:
(Lopthiss your damaged spear just broke!)
[\quote]
Australia Forum Administrator #1
I have tried that and it works without the error message.

What version of MUSHclient do you have, and what version of JScript? There is a JScript Version plugin on this page:

http://www.gammon.com.au/mushclient/plugins/

That will tell you your version of JScript.
#2
Well, I changed my approach and now it works. Instead of calling the function from an external JS file, I simply filled in the 'Send' box with the script and now it works fine.

FYI:
MUSHclient v3.50
Javascript Engine: v5.6