To answer the second question in your script file (ctrl+shift+h):
function SCSnote ( passedtext )
ColourNote ( "red", "black" , "[" ,
"gray", "black", "SCS",
"red", "black", "]",
"gray", "black", ":",
"white", "black", passedtext)
end
The ColourNote function needs 3 parameters; foreground, background, and text. It will also take those 3 parameters multiple times if you're using Lua.
For samples, I'd recommend looking at the plugins that Nick provides.
For gags, I'd recommend multiple triggers.
i.e.
trigger pattern: ^You secrete (.+) and .++$
trigger field value for Script: Secrete
in your script file again:
function Secrete (trig, line, wildcards, styleruns)
SCSNote ("ENVENOMED: " .. wildcards[1]:upper() )
end
Or if you prefer,
trigger pattern: ^You secrete (.+) and .++$
trigger field value for Send To: Script After Omit
trigger field value for send:
SCSNote ("ENVENOMED: " .. string.upper("%1"))
Here's a small 'gotcha!' for the people that use the send field of a triger or alias.
Mushclient needs to do a literal replacement of the %1, %2, etc before sending the text to the Lua compiler. Keep in mind if you want your code to be 'string.upper(poison)' (a variable named poison), or 'string.upper("poison")' (convert the literal string to upper case) when using the Send field in the trigger dialog. If you have any familiarity with C/C++, it's easier to think that '%1' isn't a variable that's passed into your script, it's a token that the precompiler replaces.
|