The pub bind accepts only 5 arguments:
nick,
user@host,
handle,
channel, and
text.
You need to check the text for a vhost and password. You could do this by either splitting the $text variable with
split then
lindex to or by using
scan. I prefer the second option.
Anyway, the two methods are:
Code: Select all
set text [split $text]
if {[llength $text] != 2} {
putserv "PRIVMSG $channel :$nick: To change your host type: !vhost <your.vhost> <pass>"
} else {
set vhost [lindex $text 0]
set password [lindex $text 1]
# use $vhost and $password to do whatever
}
and the one I prefer that's a little less messy:
Code: Select all
if {[scan $text {%s%s} vhost password] != 2} {
putserv "PRIVMSG $channel :$nick: To change your host type: !vhost <your.vhost> <pass>"
}
# use $vhost and $password to do whatever
Now, with the above in mind your proc is changed like this:
Code: Select all
bind pub - !vhost vhost
proc vhost { nick uhost handle channel text} {
if {[scan $text {%s%s} vhost password] != 2} {
puthelp "PRIVMSG $channel :$nick: To change your host type: !vhost <your.vhost> <pass>"
} else {
puthelp "PRIVMSG H :add $nick $uhost $vhost $password"
puthelp "PRIVMSG $channel :$nick: Your Vhost has been changed to: $vhost"
}
}
Edit: Typo fix.
Once the game is over, the king and the pawn go back in the same box.