|
Trigger -> script throwing popup
|
Reply to this subject
Start a new subject
 
Refresh page
| Posted by |
Zook
(2 posts) bio
|
| Date |
Sat 23 Oct 2004 04:21 AM (UTC) [ quote
] |
| Message |
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] | top |
|
| Posted by |
Nick Gammon
Australia (18,770 posts) bio
Forum Administrator |
| Date |
Reply #1 on Sat 23 Oct 2004 05:04 AM (UTC) [ quote
] |
| Message |
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. |
- Nick Gammon
www.gammon.com.au, www.mushclient.com | top |
|
| Posted by |
Zook
(2 posts) bio
|
| Date |
Reply #2 on Sat 23 Oct 2004 02:58 PM (UTC) [ quote
] |
| Message |
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 | 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.
1,369 views.
Reply to this subject
Start a new subject
 
Refresh page
top
Comments to:
Gammon Software support
Forum RSS feed ( http://www.gammon.com.au/rss/forum.xml )