+/^\.team/ {
+ gsub(/^\.team */, "")
+ _team = sp_from in sp_players ? sp_players[sp_from] % 2 : 0
+ if (sp_state ~ "new|join") {
+ reply("The game has not yet started")
+ }
+ else if (!(sp_from in sp_players)) {
+ reply("You are not playing")
+ }
+ else if ($0 ~ /^[^a-zA-Z0-9]/) {
+ reply("Invalid team name")
+ }
+ else if ($0 ~ /^./) {
+ sp_teams[_team] = substr($0, 0, 32)
+ sp_say(sp_team(_team,1) " are now known as " sp_team(_team))
+ }
+ else {
+ delete sp_teams[_team]
+ sp_say(sp_team(_team,1) " are boring")
+ }
+}
+