set p1 ""
set p2 ""
set p1health ""
set p2health ""
set playturn ""
set attacker ""
set defender ""
set attackrate ""
set defenderhealth ""

bind pub - !battle pub:battle
proc pub:battle {nick host hand chan text} {
set p1 "$nick"
set p2 [lindex [split $text] 0]
	if {![info exists p2]} {
		putserv "PRIVMSG $chan You must select an opponent"
	}
	if {![onchan $p2 $chan]} {
		putserv "PRIVMSG $chan Opponent must be in the channel"
	}
	if {[info exists $p2] && [onchan $p2 $chan]} {
		putserv "PRIVMSG $chan $p1 has initiated a battle with $p2!!!"
		putserv "PRIVMSG $chan Type: !attack <nick>"
	}
}