This is the new home of the egghelp.org community forum.
All data has been migrated (including user logins/passwords) to a new phpBB version.


For more information, see this announcement post. Click the X in the top right-corner of this box to dismiss this message.

help

Old posts that have not been replied to for several years.
Locked
b
bobjuh
Master
Posts: 268
Joined: Wed Oct 03, 2001 8:00 pm
Location: Netherlands
Contact:

help

Post by bobjuh »

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"
}
User avatar
Papillon
Owner
Posts: 724
Joined: Fri Feb 15, 2002 8:00 pm
Location: *.no

Post by Papillon »

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:

Code: Select all

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
Elen sila lúmenn' omentielvo
b
bobjuh
Master
Posts: 268
Joined: Wed Oct 03, 2001 8:00 pm
Location: Netherlands
Contact:

Post by bobjuh »

Papillon wrote: aslo, I suggest you add some if-checks to see if there is someone by that handle/host already known to the bot
I thought about that already
That's mutch easy

take a look at it if that will work later
Locked