I writing a script that users can register with the handle they want not the nick the're using.
the command is /msg <botnick> register <handle> <password>
The error i get is "Tcl error [msg:register]: no value given for parameter "arg2" to "msg:register"
proc msg:register {nick uhost hand arg1 arg2} {
adduser $arg1 *!*$uhost
chpass $arg1 $arg2
putlog "\002NEW USER\002 user $arg1 was added to the bot with $uhost"
putserv "NOTICE $nick : You're added to tbe bot with handle $arg1 and pass $arg2"
}
you cannot just add parameters to the proc-input, there is just one $arg
then you split that and pull out the different elements you want, in your script it would be something like this:
proc msg:register {nick uhost hand arg} {
set user [lindex [split $arg] 0]
set pass [lindex [split $arg] 1]
adduser $user *!*$uhost
chpass $user $pass
putlog "\002NEW USER\002 user $user was added to the bot with $uhost"
putserv "NOTICE $nick : You're added to tbe bot with handle $user and pass $pass"
}
aslo, I suggest you add some if-checks to see if there is someone by that handle/host already known to the bot