I think it's safe to remove the
[onchan $nick $enforcechan] && [onchan $::botnick $enforcechan] part as the previous two checks validate them as well, meaning
botisop can't return true unless bot is on the channel and the
isop can't return true if nick isn't on the channel.
You set the chan to be lower case via:
and then in:
Code: Select all
if {![string equal -nocase $chan "$::chanopschan"] || [string first "#" $enforcechan] == -1} { return 0 }
use the
-nocase that ignores the case, so the above is pointless.
I would consider moving the
[botisop $enforcechan] higher in the code and return if it's false, else continue with the rest of the code.
Once the game is over, the king and the pawn go back in the same box.