Requested script snippet by Truk, very interesting question
[14:55:45] <@Truk> Is it possible to in a script do something like echo This $ScriptFileName fired
[14:55:48] <@Truk> This would help determine what script fired to find errors. yes i have "unknown command"s that show in status once in a while and this would help TS greatly
This is a short example snippet I made to report script errors, you can change it so it posts in specific channels or that channel or make it write to a log text file.
You can clearly see my error in this script:
if ($nick iso $chan) {
should be
if ($nick isop $chan) {
As this error is there, when you run the !plop command, it will return the if line error message in the channel, $error will return the error message as you see it in the status window when you make script errors.
When the script is fixed and no other errors are found, $error will return as $null and will not return anything.
Example:
[15:11:17] <@LozoCN-1> !plop
[15:11:17] <@LozoCN> Error: * /if: 'iso' unknown operator (line 5, start-connect.ini)
Enjoy! and I appreciate followers on Hawkee and my Social Media Accounts, comments welcome, but if you don't like how its written and you have something which does the exact same thing, but written differently, don't bother commenting.
http://twitter.com/LozoCN
http://facebook.com/DJLozoCN
on *:TEXT:!plop:#Dotcomboy17: {
if ($nick iso $chan) {
msg $chan Plop!
}
:error {
if ($error != $null) {
msg $chan Error: $error
}
}
}
The purpose of this script was to show an example of the $error identifier and how it should be used within a script if the script appears broken.