This works...
$world->note($world->AddTrigger("monster2", $whatMatch, '%0', 1, 14, 0, "", "music"));
but this doesn't..
$world->note($world->AddTriggerEx("monster3", $whatMatch, '%0', 1, 14, 0, "", "music",9,100));
And I can't figure out why. I've tried switch the 9 and the 100, but it doesn't add the trigger. No error message, no output, nothing. Any idea why?
I think this is a Perl idiosyncracy.
It worked for me *provided* $whatMatch was defined.
If I tried it as:
$world->note($world->AddTriggerEx("monster3", $xxx, '%0', 1, 14, 0, "", "music",9,100));
then I got the same results - no return code at all.
I can only assume that the AddTrigger didn't get called at all under the circumstances. Why, I cannot say. You can get the same results like this:
$world->note($world->AddTriggerEx("monster3", , '%0', 1, 14, 0, "", "music",9,100));
I get similar results with this:
/$world->note ();
It seems the Perl interpreter must check the number of arguments, and if the supplied number does not agree with the number required, declines to call the script routine. And in your case, two consecutive commas effectively gives a missing argument, which the script is not designed to accept.
When I try..
/$world->AddTriggerEx ("", "* attacks", "You are under attack!", 1, 14, 0, "", "", 2, 50);
(The example provided in documentation) it doesn't work. Does it work for you? If so, what could possibly be causing this function not to work for myself? Thanks for the help so far..
That exact example works for me. Why it wouldn't for you is a mystery. Maybe you have a leading space before the line?
Maybe scripting isn't enabled? I hate to insult you with such suggestions, but that is the sort of thing I would check.
I am using ActivePerl 5.6.0.613.
Maybe a different version wouldn't work, but I can't think why.
Yeah.. no leading space.. I'm running ActivePerl v5.6.1 build 631, MushClient 3.17. I've tried making new world files, new scripts.. eliminating all spaces, etc. Is there by chance another way to set the Send To option via scripting?
Ah I see what the problem is.
AddTriggerEx is new to version 3.18 of MUSHclient. As I just released it an hour or so before your message I assumed you were the first to download it, so I didn't comment on that.
I have amended the documentation for the function to say that you need 3.18. Try that and see how you go.