bind msg - spr spr:setweapon
proc spr:setweapon {nick host handle chan arg} {
global botnick spr_player1 spr_player2 spr_started spr_playerstat spr_player1_w spr_player2_w
if {$spr_started == 0} {
puthelp "PRIVMSG $chan :Game not running. Type !spr <nick> to play."
return 0
}
if {$arg == ""} {
puthelp "notice $nick :You need to /msg $botnick <scissor, paper or rock>"
}
if {$nick == $spr_player1} {
if {$arg == "scissor"} {
set spr_player1_w scissor
}
if {$arg == "paper"} {
set spr_player1_w paper
}
if {$arg == "rock"} {
set spr_player1_w rock
}
}
if {$nick == $spr_player2} {
if {$arg == "scissor"} {
set spr_player2_w scissor
}
if {$arg == "paper"} {
set spr_player2_w paper
}
if {$arg == "rock"} {
set spr_player2_w rock
}
}
spr:checkwin
}
I'm sure it's not the cleanest way to do what I'm trying to do, but at the moment I'm just testing/playing, but I can't work out why it's giving me that error. I've tried a bunch of different things and there's still always some problem.
One suggestion, msg bindings do not provide a channel-argument, so remove that from your proc-head...
See the doc/tcl-commands.doc file that comes with your eggdrop for further details regarding different commands and bindings.