Snippets Project Page
Author: acvxqs
Added: 5y
Updated: 5y
mIRC: Unknown
Hits: 942
Downloads: 10
Review: westor
Size: 945B
2 0
Login to vote.
Team randomizer
Team randomizer
Usage: //teamrand #
Example usage: //teamrand # 2
Example output:
Team 1: westor Debian maroon kapot entropy
Team 2: Raccoon lobster acvxqs mIRC
Download
JSON
▲ Review
▼ Source
; teamrand #channel <number of teams> alias teamrand { if (($1 ischan) && ($2 isnum 2- $+ $calc($nick($1,0)))) { if ($hget(teamrand. $+ $cid $+ . $+ $1)) hfree teamrand. $+ $cid $+ . $+ $1 hmake teamrand. $+ $cid $+ . $+ $1 40 ; enumerate nicks in channel and assign random team number var %num = $nick($1,0) while (%num > 0) { hadd teamrand. $+ $cid $+ . $+ $1 $nick($1,%num) $rand(1,$2) dec %num } ; cycle through all teams var %team = 1 while (%team <= $2) { ;for every team, enumerate members of the team var %n = 1, %members while ($hfind(teamrand. $+ $cid $+ . $+ $1,%team,%n).data) { %members = $addtok(%members,$ifmatch,32) inc %n } echo -ag Team %team $+ : %members inc %team } hfree teamrand. $+ $cid $+ . $+ $1 } }
Changelog:
0
0