[Home] [Downloads] [Search] [Help/forum]

Gammon Software Solutions forum

See www.mushclient.com/spam for dealing with forum spam. Please read the MUSHclient FAQ!

[Folder]  Entire forum
-> [Folder]  MUSHclient
. -> [Folder]  General
. . -> [Subject]  Trigger -> script throwing popup

Home  |  Users  |  Search  |  FAQ
Username:
Register forum user name
Password:
Forgotten password?

Trigger -> script throwing popup

[Reply to this subject]  Reply to this subject   [New subject]  Start a new subject   [Refresh] Refresh page


Posted by Zook   (2 posts)  [Biography] 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]
[Go to top] top

Posted by Nick Gammon   Australia  (18,770 posts)  [Biography] 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
[Go to top] top

Posted by Zook   (2 posts)  [Biography] 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
[Go to top] 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]  Reply to this subject   [New subject]  Start a new subject   [Refresh] Refresh page

Go to topic:           Search the forum


[Go to top] top

[Home]

Written by Nick Gammon - 5K

Comments to: Gammon Software support
[RH click to get RSS URL] Forum RSS feed ( http://www.gammon.com.au/rss/forum.xml )

[Best viewed with any browser - 2K]    [Internet Contents Rating Association (ICRA) - 2K]    [Web site powered by FutureQuest.Net]