You are using "pub" bindings, hence your procs ("functions") need to accept 5 arguments, corresponding to nickname, host, handle, channel, and text of the message that triggered the binding.
Next, this will fail utterly:
In fact, this will result in remote code exploits. [] are used for command substitutions. That is, take whatever is between the [], execute it as a separate command, and substitute the text (including the []) with whatever was returned by that command execution.
What you should do is this:
Code: Select all
if {[string equal -nocase $nick "Dark_aaron"]} {
Here we execute the command "string" with the parameters "equal", "-nocase", the value of $nick, and "Dark_aaron". Checking the manpage for the string command, this tells us string will compare the two strings (equal) in a case-insensitive (-nocase) manner, and return true if they're the same, false otherwize.
Further,
You have this command-line:
The purpose of the global command, is to link local variables to their counterpart in the global namespace. Yet you do not make use either of those variables in either function. This will not cause an error, but it is bad practise, and may cause confusion as to which variables are actually in use. Also be aware of variable name collisions (such as two scripts using the same variable for different purposes).