I've looked at the script examples for triggers to capture text but I'm not sure how to call the subs with out using an external script file and I don't want to use an exteranl script file for various reasons. For example in vbscript I paste the following example in the send box and select send to script
sub MyTrigger (name, line, wildcards)
world.Note "Trigger " & name & " matched."
world.Note "Wildcard 1 was" & wildcards (1)
end sub
This doesn't give me any output, how do I get this to actually output to the world? Thanks
That is because you should not place it in the Send box. You need to place it in your scriptfile (See: Configuration->Scripting->Scripts, and then the 'External Script file' bit. Just make a new one, throw your code in that file, and make sure the language is set to VBScript since that is the language you are using.
Finally, adjust your trigger - there should be NOTHING inside the Send box, and the Script field should match the name of the sub (MyTrigger in your example).
After that, it should work.
Quote:
I don't want to use an exteranl script file for various reasons
In that case, don't put a sub there (that only declares something you can use later). Just go straight into script commands. Also in "send to script" wildcard 1 is %1, wildcard 2 is %2, and so on. Like this:
<triggers>
<trigger
custom_colour="4"
enabled="y"
match="* arrives from *."
send_to="12"
sequence="100"
>
<send>
Note "Trigger matched."
Note "Wildcard 1 was %1"
Note "Wildcard 2 was %2"
</send>
</trigger>
</triggers>
See:
http://mushclient.com/pasting for how to copy that into the client.
When testing, I saw:
A stray arrives from the north.
Trigger matched.
Wildcard 1 was A stray
Wildcard 2 was the north