;;;;;;;;;;;;;;;;;;;;;;;;
;; ;;
;; -=Cup Script=- ;;
;; -=By Jointen=- ;;
;; ;;
;;;;;;;;;;;;;;;;;;;;;;;;
alias cuphelp {
echo -at ------------------------------------>
echo -at 1on1, 2on2, 3on3, 4on4 & 5on5 Cup bot!
echo -at 2, 4, 8, 16, 32, 64, 128, 256 Slots.
echo -at Coded by Jointen - Version 1.1
echo -at ------------------------------------>
echo -at Bot Commands:
echo -at --- Admins(ops) --->
echo -at !/.start <type> <slots>
echo -at !/.end
echo -at !/.prize [newprize]
echo -at !/.maps [newmaps]
echo -at !/.winner <team>
echo -at !/.delwinner <team>
echo -at --- Public(all) --->
echo -at !/.add <team> [mate] [mate] [mate] [mate]
echo -at !/.remove <team>
echo -at !/.status
echo -at !/.whois <team>
echo -at ------------------------------------>
}
alias startsym { set %cup.startsym $$?="Enter a start text:" }
alias endsym { set %cup.endsym $$?="Enter a end text:" }
alias cupmsg {
if ($1 == -c) {
if ($hget(cupmsg,num) >= 14) { goto x }
if ($numcups <= 1) { msg $2 $3- | goto x }
.timer.cup off
if (!$hget(cupmsg)) { hmake cupmsg 1 | .hadd cupmsg num 2 | msg $2 $3- }
else { .timer 1 $hget(cupmsg, num) msg $2 $3- | hinc cupmsg num 2 }
.timer.cup 1 10 hfree cupmsg
goto x
}
if ($numcups <= 1) { msg $1 $2- | goto x }
.timer.cup off
if (!$hget(cupmsg)) { hmake cupmsg 1 | .hadd cupmsg num 1 | msg $1 $2- }
else { .timer 1 $hget(cupmsg, num) msg $1 $2- | hinc cupmsg num 2 }
.timer.cup 1 10 hfree cupmsg
:x
}
alias numcups {
var %a = 1, %b = 0
while (%a <= $chan(0)) {
if ($hget(cup. [ $+ [ $chan(%a) ] ],status) == on) { inc %b }
inc %a
}
return %b
}
alias div32 {
if ($1 <= 16) { return 1 }
elseif ($1 <= 32) { return 2 }
elseif ($1 <= 48) { return 3 }
elseif ($1 <= 64) { return 4 }
elseif ($1 <= 80) { return 5 }
elseif ($1 <= 96) { return 6 }
elseif ($1 <= 112) { return 7 }
elseif ($1 <= 128) { return 8 }
elseif ($1 <= 144) { return 9 }
elseif ($1 <= 160) { return 10 }
elseif ($1 <= 176) { return 11 }
elseif ($1 <= 192) { return 12 }
elseif ($1 <= 208) { return 13 }
elseif ($1 <= 224) { return 14 }
elseif ($1 <= 240) { return 15 }
elseif ($1 <= 256) { return 16 }
}
alias failnick { if (($1 == $me) || ($1 == fishbot) || ($1 == T) || ($1 == Q) || ($1 == L) || ($1 == S)) { return fail } }
alias twistnick {
tokenize 32 $1-
var %x = 1, %y = $0
while (%x <= %y) {
if ($ [ $+ [ %x ] ] == $1) && (%x != 1) { return fail }
if ($ [ $+ [ %x ] ] == $2) && (%x != 2) { return fail }
if ($ [ $+ [ %x ] ] == $3) && (%x != 3) { return fail }
if ($ [ $+ [ %x ] ] == $4) && (%x != 4) { return fail }
if ($ [ $+ [ %x ] ] == $5) && (%x != 5) { return fail }
inc %x
}
}
alias cuprounds {
if ($left($1,1) == -) {
if (s isin $1) && ($me ison $2) {
mode $2 -c+m
.timer 1 1 msg $2 $hget(cup, startsym) $hget(cup, maincolor) $+ Round 1, Map: $hget(cup. [ $+ [ $chan ] ],maps) $hget(cup, endsym)
var %a = 1, %b = 2, %c = $hget(cup. [ $+ [ $2 ] ],slots)
while (%a <= %c) {
.timer 1 %b msg $2 $hget(cup, startsym) $hget(cup, maincolor) $+ [#1- $+ %a $+ ] $hget(teams. [ $+ [ $2 ] ],%a).item VS. $hget(cup, maincolor) $+ $hget(teams. [ $+ [ $2 ] ],%c).item $hget(cup, endsym)
inc %a | inc %b 3 | dec %c
}
.timer 1 $calc($hget(cup. [ $+ [ $2 ] ],slots) + 3) msg $2 $hget(cup, startsym) $hget(cup, maincolor) $+ $iif($hget(cup,adv) != $null,$hget(cup,adv),This script is created by Jointen) $hget(cup, endsym)
.timer 1 $calc($hget(cup. [ $+ [ $2 ] ],slots) + 8) mode $2 -mN
.hadd cup. [ $+ [ $chan ] ] nextround $calc($hget(cup. [ $+ [ $2 ] ],slots) / 2) | .hadd cup. [ $+ [ $chan ] ] nextpeople 0 | .hadd cup. [ $+ [ $chan ] ] roundnr 2
}
if (w isin $1) && ($me ison $2) {
mode $2 -c+m
.timer 1 1 msg $2 $hget(cup, startsym) $hget(cup, maincolor) $+ Round $hget(cup. [ $+ [ $chan ] ],roundnr) $+ , Map: $hget(cup. [ $+ [ $chan ] ],maps) $hget(cup, endsym)
var %a = 1, %b = 2, %c = $hget(cup. [ $+ [ $2 ] ],nextround)
while (%a <= %c) {
.timer 1 %b msg $2 $hget(cup, startsym) $hget(cup, maincolor) $+ $chr(91) $+ $chr(35) $+ $hget(cup. [ $+ [ $chan ] ],roundnr) $+ $chr(45) $+ %a $+ $chr(93) $hget(nextteams. [ $+ [ $2 ] ],%a).item VS. $hget(cup, maincolor) $+ $hget(nextteams. [ $+ [ $2 ] ],%c).item $hget(cup, endsym)
inc %a | inc %b 3 | dec %c
}
.timer 1 $calc(%b + 3) msg $2 $hget(cup, startsym) $hget(cup, maincolor) $+ $iif($hget(cup,adv) != $null,$hget(cup,adv),This script is created by Jointen) $hget(cup, endsym)
.timer 1 $calc(%b + 8) mode $2 -mN
.hadd cup. [ $+ [ $chan ] ] nextround $calc($hget(cup. [ $+ [ $2 ] ],nextround) / 2) | .hadd cup. [ $+ [ $chan ] ] nextpeople 0 | .hinc cup. [ $+ [ $chan ] ] roundnr 1
var %x = 1, %k = $hget(teams. [ $+ [ $2 ] ],0).item, %a = 1
while (%x <= %k) {
if (!$hget(nextteams. [ $+ [ $2 ] ],$hget(teams. [ $+ [ $2 ] ],%x).item)) { set %y $addtok(%y,$hget(teams. [ $+ [ $2 ] ],%x).item,32) }
inc %x
}
while (%a <= $numtok(%y,32)) {
.hdel teams. [ $+ [ $2 ] ] $gettok(%y,%a,32)
inc %a
}
hfree nextteams. [ $+ [ $2 ] ] | unset %y
}
}
}
on *:text:*:#:{
if (($1 == !start) || ($1 == .start)) && ($me isop $chan) {
if ($hget(cup. [ $+ [ $chan ] ],status) != off) { cupmsg $chan $hget(cup, startsym) $hget(cup, maincolor) $+ $nick $+ : A $hget(cup. [ $+ [ $chan ] ],type) cup is allready running!, $hget(cup. [ $+ [ $chan ] ],teamnr) $+ / $+ $hget(cup. [ $+ [ $chan ] ],slots) Teams signed. $hget(cup, endsym) }
elseif ($hget(cup. [ $+ [ $chan ] ],status) == off) && ($nick isop $chan) && (($3 == 2) || ($3 == 4) || ($3 == 8) || ($3 == 16) || ($3 == 32) || ($3 == 64) || ($3 == 128) || ($3 == 256)) && (($2 == 1on1) || ($2 == 2on2) || ($2 == 3on3) || ($2 == 4on4) || ($2 == 5on5)) {
.hadd cup. [ $+ [ $chan ] ] status on | .hadd cup. [ $+ [ $chan ] ] slots $3 | .hadd cup. [ $+ [ $chan ] ] type $2 | .hadd cup. [ $+ [ $chan ] ] teamnr 0 | .hadd cup. [ $+ [ $chan ] ] prize none | .hadd cup. [ $+ [ $chan ] ] round 1
hmake teams. [ $+ [ $chan ] ] $calc($3 + 2)
if ($4) { .hadd cup. [ $+ [ $chan ] ] prize $4- }
msg $chan $hget(cup, startsym) $hget(cup, maincolor) $+ $nick has started a $2 Cup on $3 Slots. $hget(cup, endsym)
if ($hget(cup. [ $+ [ $chan ] ], type) == 1on1) { .hadd cup. [ $+ [ $chan ] ] maps de_aztec | msg $chan $hget(cup, startsym) $hget(cup, maincolor) $+ Use: !add <team> $hget(cup, maincolor) $+ To join the cup. $hget(cup, endsym) }
elseif ($hget(cup. [ $+ [ $chan ] ], type) == 2on2) { .hadd cup. [ $+ [ $chan ] ] maps de_aztec | msg $chan $hget(cup, startsym) $hget(cup, maincolor) $+ Use: !add <team> <m8> $hget(cup, maincolor) $+ To add your team. $hget(cup, endsym) }
elseif ($hget(cup. [ $+ [ $chan ] ], type) == 3on3) { .hadd cup. [ $+ [ $chan ] ] maps de_actec | msg $chan $hget(cup, startsym) $hget(cup, maincolor) $+ Use: !add <team> <m8> <m8> $hget(cup, maincolor) $+ To add your team. $hget(cup, endsym) }
elseif ($hget(cup. [ $+ [ $chan ] ], type) == 4on4) { .hadd cup. [ $+ [ $chan ] ] maps de_dust2 | msg $chan $hget(cup, startsym) $hget(cup, maincolor) $+ Use: !add <team> <m8> <m8> <m8> $hget(cup, maincolor) $+ To add your team. $hget(cup, endsym) }
elseif ($hget(cup. [ $+ [ $chan ] ], type) == 5on5) { .hadd cup. [ $+ [ $chan ] ] maps de_dust2 | msg $chan $hget(cup, startsym) $hget(cup, maincolor) $+ Use: !add <team> <m8> <m8> <m8> <m8> $hget(cup, maincolor) $+ To add your team. $hget(cup, endsym) }
}
elseif (!$3) && ($2) { cupmsg $chan $hget(cup, startsym) $hget(cup, maincolor) $+ Wrong amount of slots. Usable slots: 2, 4, 8, 32, 64, 128, 256 -> Use: !start <type> <slots> $hget(cup, endsym) }
}
elseif (($1 == !end) || ($1 == .end)) && ($nick isop $chan) && ($me isop $chan) && ($hget(cup. [ $+ [ $chan ] ],status) != off) {
cupmsg $chan $hget(cup, startsym) $hget(cup, maincolor) $+ $nick has ended the $hget(cup. [ $+ [ $chan ] ], type) Cup. $hget(cup, endsym)
cupmsg $chan $hget(cup, startsym) $hget(cup, maincolor) $+ All cup data has been deleted! $hget(cup, endsym)
cupmsg $chan $hget(cup, startsym) $hget(cup, maincolor) $+ This script is created by Jointen $hget(cup, endsym)
if ($hget(cup. [ $+ [ $chan ] ])) { hfree cup. [ $+ [ $chan ] ] }
if ($hget(teams. [ $+ [ $chan ] ])) { hfree teams. [ $+ [ $chan ] ] }
if ($hget(nextteams. [ $+ [ $chan ] ])) { hfree nextteams. [ $+ [ $chan ] ] }
hmake cup. $+ $chan 140
.hadd cup. $+ $chan status off
}
elseif (($1 == !status) || ($1 == .status)) {
if ($hget(cup. [ $+ [ $chan ] ],status) == on) && (!$istok($hget(cup. [ $+ [ $chan ] ], bad.status),$nick,32)) {
.hadd cup. [ $+ [ $chan ] ] bad.status $addtok($hget(cup. [ $+ [ $chan ] ], bad.status),$nick,32) | .timer $+ $+($nick,.,$chan) 1 5 .hadd cup. [ $+ [ $chan ] ] bad.status $deltok($hget(cup. [ $+ [ $chan ] ], bad.status),$findtok($hget(cup. [ $+ [ $chan ] ], bad.status),$nick,32),32)
cupmsg $chan $hget(cup, startsym) $hget(cup, maincolor) $+ Status for the $chan $hget(cup. [ $+ [ $chan ] ],type) Cup, Teams signed: $hget(cup. [ $+ [ $chan ] ],teamnr) $+ / $+ $hget(cup. [ $+ [ $chan ] ],slots) $hget(cup, endsym)
}
elseif ($hget(cup. [ $+ [ $chan ] ],status) == full) {
.hadd cup. [ $+ [ $chan ] ] bad.status $addtok($hget(cup. [ $+ [ $chan ] ], bad.status),$nick,32) | .timer $+ $+($nick,.,$chan) 1 5 .hadd cup. [ $+ [ $chan ] ] bad.status $deltok($hget(cup. [ $+ [ $chan ] ], bad.status),$findtok($hget(cup. [ $+ [ $chan ] ], bad.status),$nick,32),32)
cupmsg $chan $hget(cup, startsym) $hget(cup, maincolor) $+ Status for the $chan $hget(cup. [ $+ [ $chan ] ],type) Cup, Teams: $hget(cup. [ $+ [ $chan ] ],nextpeople) $+ / $+ $hget(cup. [ $+ [ $chan ] ],nextround) (Winners of round $calc($hget(cup. [ $+ [ $chan ] ],roundnr) - 1) $+ $chr(41) $hget(cup, endsym)
}
}
elseif (($1 == !teams) || ($1 == .teams)) && (!$istok($hget(cup. [ $+ [ $chan ] ], bad.teams),$nick,32)) {
if ($hget(cup. [ $+ [ $chan ] ],status) != off) {
if ($hget(cup. [ $+ [ $chan ] ],teamnr) >= 1) {
.hadd cup. [ $+ [ $chan ] ] bad.status $addtok($hget(cup. [ $+ [ $chan ] ], bad.teams),$nick,32) | .timer $+ $+($nick,.,$chan) 1 20 .hadd cup. [ $+ [ $chan ] ] bad.teams $deltok($hget(cup. [ $+ [ $chan ] ], bad.teams),$findtok($hget(cup. [ $+ [ $chan ] ], bad.teams),$nick,32),32)
var %a = 1, %b = $hget(teams. [ $+ [ $chan ] ],0).item, %c = $div32($hget(teams. [ $+ [ $chan ] ],0).item), %d = 1, %z = 16
while (%a <= %c) {
while (%d <= %z) && (%d <= %b) {
.hadd cup. $+ $chan $+(teamsss.,%a) $addtok($hget(cup. [ $+ [ $chan ] ], $+(teamsss.,%a)),$hget(teams. [ $+ [ $chan ] ],%d).item,32)
inc %d
}
inc %a | inc %z 16
}
var %a = 1
while (%a <= %c) {
cupmsg -c $chan $hget(cup, startsym) $hget(cup, maincolor) $+ Teams[ $+ %a $+ ]: $hget(cup. [ $+ [ $chan ] ],$+(teamsss.,%a)) $hget(cup, endsym)
.hdel cup. [ $+ [ $chan ] ] $+(teamsss.,%a)
inc %a
}
}
}
}
elseif (($1 == !whois) || ($1 == .whois)) {
if ($hget(cup. [ $+ [ $chan ] ],status) != off) && ($hget(teams. [ $+ [ $chan ] ],$2)) && (!$istok($hget(cup. [ $+ [ $chan ] ], bad.whois),$nick,32)) {
.hadd cup. [ $+ [ $chan ] ] bad.whois $addtok($hget(cup. [ $+ [ $chan ] ], bad.whois),$nick,32) | .timer $+ $+($nick,.,$chan) 1 5 .hadd cup. [ $+ [ $chan ] ] bad.whois $deltok($hget(cup. [ $+ [ $chan ] ], bad.whois),$findtok($hget(cup. [ $+ [ $chan ] ], bad.whois),$nick,32),32)
cupmsg -c $chan $hget(cup, startsym) $hget(cup, maincolor) $+ Team name: $gettok($hget(teams. [ $+ [ $chan ] ],$2),1,32) $+ $hget(cup, maincolor) $+ Players: $gettok($hget(teams. [ $+ [ $chan ] ],$2),2-,32) $hget(cup, endsym)
}
}
elseif (($1 == !setslots) || ($1 == .setslots)) && ($nick isop $chan) && ($me isop $chan) && ($hget(cup. [ $+ [ $chan ] ],status) == on) {
if (($2 == 2) || ($2 == 4) || ($2 == 8) || ($2 == 16) || ($2 == 32) || ($2 == 64) || ($2 == 128) || ($2 == 256)) && ($2 != $hget(cup. [ $+ [ $chan ] ],slots)) && ($2 > $hget(cup. [ $+ [ $chan ] ],teamnr)) {
.hadd cup. [ $+ [ $chan ] ] slots $2
cupmsg $chan $hget(cup, startsym) $hget(cup, maincolor) $+ MAXSlots have ben changed to: $2 $+ $hget(cup, maincolor) $+ $hget(cup, endsym)
}
}
elseif (($1 == !prize) || ($1 == .prize)) {
if ($hget(cup. [ $+ [ $chan ] ],status) != off) && (!$istok($hget(cup. [ $+ [ $chan ] ], bad.prize),$nick,32)) {
.hadd cup. [ $+ [ $chan ] ] bad.prize $addtok($hget(cup. [ $+ [ $chan ] ], bad.prize),$nick,32) | .timer $+ $+($nick,.,$chan) 1 5 .hadd cup. [ $+ [ $chan ] ] bad.prize $deltok($hget(cup. [ $+ [ $chan ] ], bad.prize),$findtok($hget(cup. [ $+ [ $chan ] ], bad.prize),$nick,32),32)
if ($nick isop $chan) && ($2) { .hadd cup. [ $+ [ $chan ] ] prize $2- | cupmsg $chan $hget(cup, startsym) $hget(cup, maincolor) $+ The prize has been changed to $hget(cup. [ $+ [ $chan ] ],prize) $+ $hget(cup, endsym) }
elseif (!$2) { cupmsg -c $chan $hget(cup, startsym) $hget(cup, maincolor) $+ The prize of the $chan $hget(cup. [ $+ [ $chan ] ],type) Cup is: $hget(cup. [ $+ [ $chan ] ],prize) $+ $hget(cup, endsym) }
}
}
elseif (($1 == !maps) || ($1 == .maps)) && (!$istok($hget(cup. [ $+ [ $chan ] ], bad.maps),$nick,32)) {
if ($hget(cup. [ $+ [ $chan ] ],status) != off) {
.hadd cup. [ $+ [ $chan ] ] bad.maps $addtok($hget(cup. [ $+ [ $chan ] ], bad.maps),$nick,32) | .timer $+ $+($nick,.,$chan) 1 5 .hadd cup. [ $+ [ $chan ] ] bad.maps $deltok($hget(cup. [ $+ [ $chan ] ], bad.maps),$findtok($hget(cup. [ $+ [ $chan ] ], bad.maps),$nick,32),32)
if ($nick isop $chan) && ($2) { .hadd cup. [ $+ [ $chan ] ] maps $2- | cupmsg $chan $hget(cup, startsym) $hget(cup, maincolor) $+ The map $+ $iif($3,s,$null) has been changed to $hget(cup. [ $+ [ $chan ] ],maps) $+ $hget(cup, endsym) }
elseif (!$2) { cupmsg -c $chan $hget(cup, startsym) $hget(cup, maincolor) $+ The maps to the $chan $hget(cup. [ $+ [ $chan ] ],type) Cup is: $hget(cup. [ $+ [ $chan ] ],maps) $+ $hget(cup, endsym) }
}
}
elseif (($1 == !add) || ($1 == .add)) && ($hget(cup. [ $+ [ $chan ] ],status) == on) && ($2) && ($len($2) <= 15) {
if ($hget(cup. [ $+ [ $chan ] ],type) == 1on1) {
if ($hget(cup. [ $+ [ $chan ] ],teamnr) == $hget(cup. [ $+ [ $chan ] ],slots)) { goto x }
if ($hget(teams. [ $+ [ $chan ] ],$2) != $null) { cupmsg $chan $hget(cup, startsym) $hget(cup, maincolor) $+ Error: the team name ' $+ $2 $+ ' is allready in use!, plz chose another. $hget(cup, endsym) | goto x }
if ($hget(cup. [ $+ [ $chan ] ],teamnr) == 0) { goto y1 }
var %x = 1, %y = $hget(cup. [ $+ [ $chan ] ],teamnr)
while (%x <= $hget(teams. [ $+ [ $chan ] ],0).item) {
if ($nick == $gettok($hget(teams. [ $+ [ $chan ] ],$hget(teams. [ $+ [ $chan ] ],%x).item),2,32)) { cupmsg $chan $hget(cup, startsym) $hget(cup, maincolor) $+ You are allready added to another team: ( $+ $hget(teams. [ $+ [ $chan ] ],%x).item $+ ) $hget(cup, endsym) | goto x }
inc %x
}
:y1
hinc cup. [ $+ [ $chan ] ] teamnr 1
.hadd teams. $+ $chan $2 $2 $nick
cupmsg $chan $hget(cup, startsym) $hget(cup, maincolor) $+ $nick has added the team: $2 $+ $+ $hget(cup, maincolor) to the $chan 1on1 cup. Teams signed: $hget(cup. [ $+ [ $chan ] ],teamnr) $+ / $+ $hget(cup. [ $+ [ $chan ] ],slots) $hget(cup, endsym)
}
elseif ($hget(cup. [ $+ [ $chan ] ],type) == 2on2) {
if ($hget(cup. [ $+ [ $chan ] ],teamnr) == $hget(cup. [ $+ [ $chan ] ],slots)) { goto x }
if (!$3) { cupmsg $chan $hget(cup, startsym) $hget(cup, maincolor) $+ Plz enter your mate's nick, use: !add <team> <mate> $hget(cup, endsym) | goto x }
if ($3 !ison $chan) { cupmsg $chan $hget(cup, startsym) $hget(cup, maincolor) $+ Your mate ( $+ $3 $+ ) is not on chan, use: !add <team> <mate> $hget(cup, endsym) | goto x }
if ($hget(teams. [ $+ [ $chan ] ],$2) != $null) { cupmsg $chan $hget(cup, startsym) $hget(cup, maincolor) $+ Error: the team name ' $+ $2 $+ ' is allready in use!, plz chose another. $hget(cup, endsym) | goto x }
if ($failnick($3)) { cupmsg $chan $hget(cup, startsym) $hget(cup, maincolor) $+ Error: invalid nick(s) $hget(cup, endsym) | goto x }
if ($twistnick($nick $3)) { cupmsg $chan $hget(cup, startsym) $hget(cup, maincolor) $+ Error: you cant add the same nick twice $hget(cup, endsym) | goto x }
if ($hget(cup. [ $+ [ $chan ] ],teamnr) == 0) { goto y2 }
var %x = 1, %y = $hget(cup. [ $+ [ $chan ] ],teamnr)
while (%x <= $hget(teams. [ $+ [ $chan ] ],0).item) {
if ($nick == $gettok($hget(teams. [ $+ [ $chan ] ],$hget(teams. [ $+ [ $chan ] ],%x).item),2,32)) || ($nick == $gettok($hget(teams. [ $+ [ $chan ] ],$hget(teams. [ $+ [ $chan ] ],%x).item),3,32)) { cupmsg $chan $hget(cup, startsym) $hget(cup, maincolor) $+ You are allready added to another team: ( $+ $hget(teams. [ $+ [ $chan ] ],%x).item $+ ) $hget(cup, endsym) | goto x }
if ($3 == $gettok($hget(teams. [ $+ [ $chan ] ],$hget(teams. [ $+ [ $chan ] ],%x).item),2,32)) || ($3 == $gettok($hget(teams. [ $+ [ $chan ] ],$hget(teams. [ $+ [ $chan ] ],%x).item),3,32)) { cupmsg $chan $hget(cup, startsym) $hget(cup, maincolor) $+ Your mate is allready added to another team: ( $+ $hget(teams. [ $+ [ $chan ] ],%x).item $+ ) $hget(cup, endsym) | goto x }
inc %x
}
:y2
hinc cup. [ $+ [ $chan ] ] teamnr 1
.hadd teams. $+ $chan $2 $2 $nick $3
cupmsg $chan $hget(cup, startsym) $hget(cup, maincolor) $+ $nick has added the team: $2 $+ $+ $hget(cup, maincolor) $+ , with the player: $3 $+ $hget(cup, maincolor) $+ to the $chan 2on2 cup. Teams signed: $hget(cup. [ $+ [ $chan ] ],teamnr) $+ / $+ $hget(cup. [ $+ [ $chan ] ],slots) $hget(cup, endsym)
}
elseif ($hget(cup. [ $+ [ $chan ] ],type) == 3on3) {
if ($hget(cup. [ $+ [ $chan ] ],teamnr) == $hget(cup. [ $+ [ $chan ] ],slots)) { goto x }
if (!$4) { cupmsg $chan $hget(cup, startsym) $hget(cup, maincolor) $+ Plz enter your mate's nick, use: !add <team> <mate> <mate> $hget(cup, endsym) | goto x }
if ($3 !ison $chan) || ($4 !ison $chan) { cupmsg $chan $hget(cup, startsym) $hget(cup, maincolor) $+ Your mate's ( $+ $iif($3 !ison $chan,$3) $iif($4 !ison $chan,$4) $+ ) is not on chan, use: !add <team> <mate> <mate> $hget(cup, endsym) | goto x }
if ($hget(teams. [ $+ [ $chan ] ],$2) != $null) { cupmsg $chan $hget(cup, startsym) $hget(cup, maincolor) $+ Error: the team name ' $+ $2 $+ ' is allready in use!, plz chose another. $hget(cup, endsym) | goto x }
if ($failnick($3)) || ($failnick($4)) { cupmsg $chan $hget(cup, startsym) $hget(cup, maincolor) $+ Error: invalid nick(s) $hget(cup, endsym) | goto x }
if ($twistnick($nick $3-)) { cupmsg $chan $hget(cup, startsym) $hget(cup, maincolor) $+ Error: you cant add the same nick twice $hget(cup, endsym) | goto x }
if ($hget(cup. [ $+ [ $chan ] ],teamnr) == 0) { goto y3 }
var %x = 1, %y = $hget(cup. [ $+ [ $chan ] ],teamnr)
while (%x <= $hget(teams. [ $+ [ $chan ] ],0).item) {
if ($nick == $gettok($hget(teams. [ $+ [ $chan ] ],$hget(teams. [ $+ [ $chan ] ],%x).item),2,32)) || ($nick == $gettok($hget(teams. [ $+ [ $chan ] ],$hget(teams. [ $+ [ $chan ] ],%x).item),3,32)) { cupmsg $chan $hget(cup, startsym) $hget(cup, maincolor) $+ You are allready added to another team: ( $+ $hget(teams. [ $+ [ $chan ] ],%x).item $+ ) $hget(cup, endsym) | goto x }
if ($3 == $gettok($hget(teams. [ $+ [ $chan ] ],$hget(teams. [ $+ [ $chan ] ],%x).item),2,32)) || ($3 == $gettok($hget(teams. [ $+ [ $chan ] ],$hget(teams. [ $+ [ $chan ] ],%x).item),3,32)) || ($3 == $gettok($hget(teams. [ $+ [ $chan ] ],$hget(teams. [ $+ [ $chan ] ],%x).item),4,32)) { cupmsg $chan $hget(cup, startsym) $hget(cup, maincolor) $+ Your mate ( $+ $3 $+ ) is allready added to another team: ( $+ $hget(teams. [ $+ [ $chan ] ],%x).item $+ ) $hget(cup, endsym) | goto x }
if ($4 == $gettok($hget(teams. [ $+ [ $chan ] ],$hget(teams. [ $+ [ $chan ] ],%x).item),2,32)) || ($4 == $gettok($hget(teams. [ $+ [ $chan ] ],$hget(teams. [ $+ [ $chan ] ],%x).item),3,32)) || ($4 == $gettok($hget(teams. [ $+ [ $chan ] ],$hget(teams. [ $+ [ $chan ] ],%x).item),4,32)) { cupmsg $chan $hget(cup, startsym) $hget(cup, maincolor) $+ Your mate ( $+ $4 $+ ) is allready added to another team: ( $+ $hget(teams. [ $+ [ $chan ] ],%x).item $+ ) $hget(cup, endsym) | goto x }
inc %x
}
:y3
hinc cup. [ $+ [ $chan ] ] teamnr 1
.hadd teams. $+ $chan $2 $2 $nick $3 $4
cupmsg $chan $hget(cup, startsym) $hget(cup, maincolor) $+ $nick has added the team: $2 $+ $+ $hget(cup, maincolor) $+ , with the players: $3 and $4 $+ $hget(cup, maincolor) $+ to the $chan 3on3 cup. Teams signed: $hget(cup. [ $+ [ $chan ] ],teamnr) $+ / $+ $hget(cup. [ $+ [ $chan ] ],slots) $hget(cup, endsym)
}
elseif ($hget(cup. [ $+ [ $chan ] ],type) == 4on4) {
if ($hget(cup. [ $+ [ $chan ] ],teamnr) == $hget(cup. [ $+ [ $chan ] ],slots)) { goto x }
if (!$5) { cupmsg $chan $hget(cup, startsym) $hget(cup, maincolor) $+ Plz enter your mate's nick, use: !add <team> <mate> <mate> <mate> $hget(cup, endsym) | goto x }
if ($3 !ison $chan) || ($4 !ison $chan) || ($5 !ison $chan) { cupmsg $chan $hget(cup, startsym) $hget(cup, maincolor) $+ Your mate's ( $+ $iif($3 !ison $chan,$3) $iif($4 !ison $chan,$4) $iif($5 !ison $chan,$5) $+ ) is not on chan, use: !add <team> <mate> <mate> <mate> $hget(cup, endsym) | goto x }
if ($hget(teams. [ $+ [ $chan ] ],$2) != $null) { cupmsg $chan $hget(cup, startsym) $hget(cup, maincolor) $+ Error: the team name ' $+ $2 $+ ' is allready in use!, plz chose another. $hget(cup, endsym) | goto x }
if ($failnick($3)) || ($failnick($4)) || ($failnick($5)) { cupmsg $chan $hget(cup, startsym) $hget(cup, maincolor) $+ Error: invalid nick(s) $hget(cup, endsym) | goto x }
if ($twistnick($nick $3-)) { cupmsg $chan $hget(cup, startsym) $hget(cup, maincolor) $+ Error: you cant add the same nick twice $hget(cup, endsym) | goto x }
if ($hget(cup. [ $+ [ $chan ] ],teamnr) == 0) { goto y4 }
var %x = 1, %y = $hget(cup. [ $+ [ $chan ] ],teamnr)
while (%x <= $hget(teams. [ $+ [ $chan ] ],0).item) {
if ($nick == $gettok($hget(teams. [ $+ [ $chan ] ],$hget(teams. [ $+ [ $chan ] ],%x).item),2,32)) || ($nick == $gettok($hget(teams. [ $+ [ $chan ] ],$hget(teams. [ $+ [ $chan ] ],%x).item),3,32)) || ($nick == $gettok($hget(teams. [ $+ [ $chan ] ],$hget(teams. [ $+ [ $chan ] ],%x).item),4,32)) || ($nick == $gettok($hget(teams. [ $+ [ $chan ] ],$hget(teams. [ $+ [ $chan ] ],%x).item),5,32)) { cupmsg $chan $hget(cup, startsym) $hget(cup, maincolor) $+ You are allready added to another team: ( $+ $hget(teams. [ $+ [ $chan ] ],%x).item $+ ) $hget(cup, endsym) | goto x }
if ($3 == $gettok($hget(teams. [ $+ [ $chan ] ],$hget(teams. [ $+ [ $chan ] ],%x).item),2,32)) || ($3 == $gettok($hget(teams. [ $+ [ $chan ] ],$hget(teams. [ $+ [ $chan ] ],%x).item),3,32)) || ($3 == $gettok($hget(teams. [ $+ [ $chan ] ],$hget(teams. [ $+ [ $chan ] ],%x).item),4,32)) || ($3 == $gettok($hget(teams. [ $+ [ $chan ] ],$hget(teams. [ $+ [ $chan ] ],%x).item),5,32)) { cupmsg $chan $hget(cup, startsym) $hget(cup, maincolor) $+ Your mate ( $+ $3 $+ ) is allready added to another team: ( $+ $hget(teams. [ $+ [ $chan ] ],%x).item $+ ) $hget(cup, endsym) | goto x }
if ($4 == $gettok($hget(teams. [ $+ [ $chan ] ],$hget(teams. [ $+ [ $chan ] ],%x).item),2,32)) || ($4 == $gettok($hget(teams. [ $+ [ $chan ] ],$hget(teams. [ $+ [ $chan ] ],%x).item),3,32)) || ($4 == $gettok($hget(teams. [ $+ [ $chan ] ],$hget(teams. [ $+ [ $chan ] ],%x).item),4,32)) || ($4 == $gettok($hget(teams. [ $+ [ $chan ] ],$hget(teams. [ $+ [ $chan ] ],%x).item),5,32)) { cupmsg $chan $hget(cup, startsym) $hget(cup, maincolor) $+ Your mate ( $+ $4 $+ ) is allready added to another team: ( $+ $hget(teams. [ $+ [ $chan ] ],%x).item $+ ) $hget(cup, endsym) | goto x }
if ($5 == $gettok($hget(teams. [ $+ [ $chan ] ],$hget(teams. [ $+ [ $chan ] ],%x).item),2,32)) || ($5 == $gettok($hget(teams. [ $+ [ $chan ] ],$hget(teams. [ $+ [ $chan ] ],%x).item),3,32)) || ($5 == $gettok($hget(teams. [ $+ [ $chan ] ],$hget(teams. [ $+ [ $chan ] ],%x).item),4,32)) || ($5 == $gettok($hget(teams. [ $+ [ $chan ] ],$hget(teams. [ $+ [ $chan ] ],%x).item),5,32)) { cupmsg $chan $hget(cup, startsym) $hget(cup, maincolor) $+ Your mate ( $+ $5 $+ ) is allready added to another team: ( $+ $hget(teams. [ $+ [ $chan ] ],%x).item $+ ) $hget(cup, endsym) | goto x }
inc %x
}
:y4
hinc cup. [ $+ [ $chan ] ] teamnr 1
.hadd teams. $+ $chan $2 $2 $nick $3 $4 $5
cupmsg $chan $hget(cup, startsym) $hget(cup, maincolor) $+ $nick has added the team: $2 $+ $+ $hget(cup, maincolor) $+ , with the players: $3 $+ , $4 and $5 $+ $hget(cup, maincolor) $+ to the $chan 4on4 cup. Teams signed: $hget(cup. [ $+ [ $chan ] ],teamnr) $+ / $+ $hget(cup. [ $+ [ $chan ] ],slots) $hget(cup, endsym)
}
elseif ($hget(cup. [ $+ [ $chan ] ],type) == 5on5) {
if ($hget(cup. [ $+ [ $chan ] ],teamnr) == $hget(cup. [ $+ [ $chan ] ],slots)) { goto x }
if (!$6) { cupmsg $chan $hget(cup, startsym) $hget(cup, maincolor) $+ Plz enter your mate's nick, use: !add <team> <mate> <mate> <mate> <mate> $hget(cup, endsym) | goto x }
if ($3 !ison $chan) || ($4 !ison $chan) || ($5 !ison $chan) || ($6 !ison $chan) { cupmsg $chan $hget(cup, startsym) $hget(cup, maincolor) $+ Your mate's ( $+ $iif($3 !ison $chan,$3) $iif($4 !ison $chan,$4) $iif($5 !ison $chan,$5) $iif($6 !ison $chan,$6) $+ ) is not on chan, use: !add <team> <mate> <mate> <mate> $hget(cup, endsym) | goto x }
if ($hget(teams. [ $+ [ $chan ] ],$2) != $null) { cupmsg $chan $hget(cup, startsym) $hget(cup, maincolor) $+ Error: the team name ' $+ $2 $+ ' is allready in use!, plz chose another. $hget(cup, endsym) | goto x }
if ($failnick($3)) || ($failnick($4)) || ($failnick($5)) || ($failnick($6)) { cupmsg $chan $hget(cup, startsym) $hget(cup, maincolor) $+ Error: invalid nick(s) $hget(cup, endsym) | goto x }
if ($twistnick($nick $3-)) { cupmsg $chan $hget(cup, startsym) $hget(cup, maincolor) $+ Error: you cant add the same nick twice $hget(cup, endsym) | goto x }
if ($hget(cup. [ $+ [ $chan ] ],teamnr) == 0) { goto y5 }
var %x = 1, %y = $hget(cup. [ $+ [ $chan ] ],teamnr)
while (%x <= $hget(teams. [ $+ [ $chan ] ],0).item) {
if ($nick == $gettok($hget(teams. [ $+ [ $chan ] ],$hget(teams. [ $+ [ $chan ] ],%x).item),2,32)) || ($nick == $gettok($hget(teams. [ $+ [ $chan ] ],$hget(teams. [ $+ [ $chan ] ],%x).item),3,32)) || ($nick == $gettok($hget(teams. [ $+ [ $chan ] ],$hget(teams. [ $+ [ $chan ] ],%x).item),4,32)) || ($nick == $gettok($hget(teams. [ $+ [ $chan ] ],$hget(teams. [ $+ [ $chan ] ],%x).item),5,32)) || ($nick == $gettok($hget(teams. [ $+ [ $chan ] ],$hget(teams. [ $+ [ $chan ] ],%x).item),6,32)) { cupmsg $chan $hget(cup, startsym) $hget(cup, maincolor) $+ You are allready added to another team: ( $+ $hget(teams. [ $+ [ $chan ] ],%x).item $+ ) $hget(cup, endsym) | goto x }
if ($3 == $gettok($hget(teams. [ $+ [ $chan ] ],$hget(teams. [ $+ [ $chan ] ],%x).item),2,32)) || ($3 == $gettok($hget(teams. [ $+ [ $chan ] ],$hget(teams. [ $+ [ $chan ] ],%x).item),3,32)) || ($3 == $gettok($hget(teams. [ $+ [ $chan ] ],$hget(teams. [ $+ [ $chan ] ],%x).item),4,32)) || ($3 == $gettok($hget(teams. [ $+ [ $chan ] ],$hget(teams. [ $+ [ $chan ] ],%x).item),5,32)) || ($3 == $gettok($hget(teams. [ $+ [ $chan ] ],$hget(teams. [ $+ [ $chan ] ],%x).item),6,32)) { cupmsg $chan $hget(cup, startsym) $hget(cup, maincolor) $+ Your mate ( $+ $3 $+ ) is allready added to another team: ( $+ $hget(teams. [ $+ [ $chan ] ],%x).item $+ ) $hget(cup, endsym) | goto x }
if ($4 == $gettok($hget(teams. [ $+ [ $chan ] ],$hget(teams. [ $+ [ $chan ] ],%x).item),2,32)) || ($4 == $gettok($hget(teams. [ $+ [ $chan ] ],$hget(teams. [ $+ [ $chan ] ],%x).item),3,32)) || ($4 == $gettok($hget(teams. [ $+ [ $chan ] ],$hget(teams. [ $+ [ $chan ] ],%x).item),4,32)) || ($4 == $gettok($hget(teams. [ $+ [ $chan ] ],$hget(teams. [ $+ [ $chan ] ],%x).item),5,32)) || ($4 == $gettok($hget(teams. [ $+ [ $chan ] ],$hget(teams. [ $+ [ $chan ] ],%x).item),6,32)) { cupmsg $chan $hget(cup, startsym) $hget(cup, maincolor) $+ Your mate ( $+ $4 $+ ) is allready added to another team: ( $+ $hget(teams. [ $+ [ $chan ] ],%x).item $+ ) $hget(cup, endsym) | goto x }
if ($5 == $gettok($hget(teams. [ $+ [ $chan ] ],$hget(teams. [ $+ [ $chan ] ],%x).item),2,32)) || ($5 == $gettok($hget(teams. [ $+ [ $chan ] ],$hget(teams. [ $+ [ $chan ] ],%x).item),3,32)) || ($5 == $gettok($hget(teams. [ $+ [ $chan ] ],$hget(teams. [ $+ [ $chan ] ],%x).item),4,32)) || ($5 == $gettok($hget(teams. [ $+ [ $chan ] ],$hget(teams. [ $+ [ $chan ] ],%x).item),5,32)) || ($5 == $gettok($hget(teams. [ $+ [ $chan ] ],$hget(teams. [ $+ [ $chan ] ],%x).item),6,32)) { cupmsg $chan $hget(cup, startsym) $hget(cup, maincolor) $+ Your mate ( $+ $5 $+ ) is allready added to another team: ( $+ $hget(teams. [ $+ [ $chan ] ],%x).item $+ ) $hget(cup, endsym) | goto x }
if ($6 == $gettok($hget(teams. [ $+ [ $chan ] ],$hget(teams. [ $+ [ $chan ] ],%x).item),2,32)) || ($6 == $gettok($hget(teams. [ $+ [ $chan ] ],$hget(teams. [ $+ [ $chan ] ],%x).item),3,32)) || ($6 == $gettok($hget(teams. [ $+ [ $chan ] ],$hget(teams. [ $+ [ $chan ] ],%x).item),4,32)) || ($6 == $gettok($hget(teams. [ $+ [ $chan ] ],$hget(teams. [ $+ [ $chan ] ],%x).item),5,32)) || ($6 == $gettok($hget(teams. [ $+ [ $chan ] ],$hget(teams. [ $+ [ $chan ] ],%x).item),6,32)) { cupmsg $chan $hget(cup, startsym) $hget(cup, maincolor) $+ Your mate ( $+ $5 $+ ) is allready added to another team: ( $+ $hget(teams. [ $+ [ $chan ] ],%x).item $+ ) $hget(cup, endsym) | goto x }
inc %x
}
:y5
hinc cup. [ $+ [ $chan ] ] teamnr 1
.hadd teams. $+ $chan $2 $2 $nick $3 $4 $5 $6
cupmsg $chan $hget(cup, startsym) $hget(cup, maincolor) $+ $nick has added the team: $2 $+ $+ $hget(cup, maincolor) $+ , with the players: $3 $+ , $4 $+ , $5 $+ , and $6 $+ $hget(cup, maincolor) $+ to the $chan 5on5 cup. Teams signed: $hget(cup. [ $+ [ $chan ] ],teamnr) $+ / $+ $hget(cup. [ $+ [ $chan ] ],slots) $hget(cup, endsym)
}
if ($hget(cup. [ $+ [ $chan ] ],teamnr) == $hget(cup. [ $+ [ $chan ] ],slots)) {
.hadd cup. [ $+ [ $chan ] ] status full
cuprounds -s $chan
}
}
elseif (($1 == !del) || ($1 == .del) || ($1 == !rem) || ($1 == .rem) || ($1 == !remove) || ($1 == .remove)) && ($hget(cup. [ $+ [ $chan ] ],status) == on) {
if ($2) && ($hget(teams. [ $+ [ $chan ] ],$2)) {
var %a = $2, %b = $nick
if (%b isin $hget(teams. [ $+ [ $chan ] ],%a)) || (%b isop $chan) { .hdel teams. [ $+ [ $chan ] ] %a | .hadd cup. [ $+ [ $chan ] ] teamnr $calc($hget(cup. [ $+ [ $chan ] ],teamnr) - 1) | cupmsg $chan $hget(cup, startsym) $hget(cup, maincolor) $+ Team %a has been removed from the $chan $hget(cup. [ $+ [ $chan ] ],type) cup, Teams signed: $hget(cup. [ $+ [ $chan ] ],teamnr) $+ / $+ $hget(cup. [ $+ [ $chan ] ],slots) $hget(cup, endsym) }
}
}
elseif (($1 == !winner) || ($1 == .winner) || ($1 == !win) || ($1 == .win)) && ($hget(cup. [ $+ [ $chan ] ],status) == full) && ($2) && ($nick isop $chan) {
if (!$hget(nextteams. [ $+ [ $chan ] ],$2)) && ($hget(teams. [ $+ [ $chan ] ],$2)) {
if (!$hget(nextteams. [ $+ [ $chan ] ])) { hmake nextteams. $+ $chan $hget(cup. [ $+ [ $chan ] ],nextround) }
.hadd nextteams. [ $+ [ $chan ] ] $2 $2
hinc cup. [ $+ [ $chan ] ] nextpeople 1
if ($hget(cup. [ $+ [ $chan ] ],nextround) == 1) { cupmsg $chan $hget(cup, startsym) $hget(cup, maincolor) $+ Congratulations!, $2 $+ $+ $hget(cup, maincolor) is the winner of the $chan $hget(cup. [ $+ [ $chan ] ],type) Cup !!! $hget(cup, endsym) | cupmsg $chan $hget(cup, startsym) $hget(cup, maincolor) $+ Prize: $hget(cup. [ $+ [ $chan ] ],prize) $+ $hget(cup, endsym) | cupmsg $chan $hget(cup, startsym) $hget(cup, maincolor) $+ $iif($hget(cup,adv) != $null,$hget(cup,adv),This script is created by Jointen) $hget(cup, endsym) | hfree cup. [ $+ [ $chan ] ] | hfree teams. [ $+ [ $chan ] ] | hmake cup. $+ $chan 140 | .hadd cup. $+ $chan status off | goto x }
if ($hget(cup. [ $+ [ $chan ] ],nextround) == $hget(cup. [ $+ [ $chan ] ],nextpeople)) { cuprounds -w $chan }
else { cupmsg $chan $hget(cup, startsym) $hget(cup, maincolor) $+ $2 has been added as winner to round: $hget(cup. [ $+ [ $chan ] ],roundnr) ---> $calc($hget(cup. [ $+ [ $chan ] ],nextround) - $hget(cup. [ $+ [ $chan ] ],nextpeople)) matches left. }
}
}
elseif (($1 == !delwinner) || ($1 == .delwinner) || ($1 == !remwinner) || ($1 == .remwinner)) && ($hget(cup. [ $+ [ $chan ] ],status) == full) && ($2) && ($nick isop $chan) {
if ($hget(nextteams. [ $+ [ $chan ] ],$2)) && ($hget(teams. [ $+ [ $chan ] ],$2)) && ($hget(cup. [ $+ [ $chan ] ],nextpeople) != 0) {
.hdel nextteams. [ $+ [ $chan ] ] $2 | .hadd cup. [ $+ [ $chan ] ] nextpeople $calc(1 - $hget(cup. [ $+ [ $chan ] ],nextpeople))
cupmsg $chan $hget(cup, startsym) $hget(cup, maincolor) $+ $2 has been removed from the winner list! ---> $calc($hget(cup. [ $+ [ $chan ] ],nextround) - $hget(cup. [ $+ [ $chan ] ],nextpeople)) matches left.
}
}
:x
}
on *:nick: {
var %a = 1
while (%a <= $chan(0)) {
if (!$hget(teams. [ $+ [ $chan(%a) ] ])) { goto x }
var %b = 1
while (%b <= $hget(teams. [ $+ [ $chan(%a) ] ],0).item) {
if ($nick isin $gettok($hget(teams. [ $+ [ $chan(%a) ] ],$hget(teams. [ $+ [ $chan(%a) ] ],%b).item),2-,32)) { var %c = $hget(teams. [ $+ [ $chan(%a) ] ],%b).item | .hadd teams. $+ $chan(%a) %c $deltok($hget(teams. [ $+ [ $chan(%a) ] ],%c),$findtok($hget(teams. [ $+ [ $chan(%a) ] ],%c),$nick,32),32) | .hadd teams. $+ $chan(%a) %c $addtok($hget(teams. [ $+ [ $chan(%a) ] ],%c),$newnick,32) }
inc %b
}
:x
inc %a
}
}
on *:join:#: { if ($nick == $me) && (!$hget(cup. [ $+ [ $chan ] ])) { hmake cup. $+ $chan 140 | .hadd cup. $+ $chan status off } }
on *:part:*: {
if ($hget(cup. [ $+ [ $chan ] ],status) == on) {
if ($nick != $me) {
var %a = 1
while (%a <= $chan(0)) {
if (!$hget(teams. [ $+ [ $chan(%a) ] ])) { goto x }
var %b = 1
while (%b <= $hget(teams. [ $+ [ $chan(%a) ] ],0).item) {
if ($nick isin $gettok($hget(teams. [ $+ [ $chan(%a) ] ],$hget(teams. [ $+ [ $chan(%a) ] ],%b).item),2-,32)) { var %c = $hget(teams. [ $+ [ $chan(%a) ] ],%b).item | .hdel teams. [ $+ [ $chan(%a) ] ] %c | .hadd cup. [ $+ [ $chan(%a) ] ] teamnr $calc($hget(cup. [ $+ [ $chan(%a) ] ],teamnr) - 1) | cupmsg $chan(%a) $hget(cup, startsym) $hget(cup, maincolor) $+ Team %c has been removed from the cup!, Reason: $nick has left the chan :/ $hget(cup, endsym) }
inc %b
}
:x
inc %a
}
}
}
}
on *:kick:*: {
if ($hget(cup. [ $+ [ $chan ] ],status) == on) {
if ($knick != $me) {
var %a = 1
while (%a <= $chan(0)) {
if (!$hget(teams. [ $+ [ $chan(%a) ] ])) { goto x }
var %b = 1
while (%b <= $hget(teams. [ $+ [ $chan(%a) ] ],0).item) {
if ($knick isin $gettok($hget(teams. [ $+ [ $chan(%a) ] ],$hget(teams. [ $+ [ $chan(%a) ] ],%b).item),2-,32)) { var %c = $hget(teams. [ $+ [ $chan(%a) ] ],%b).item | .hdel teams. [ $+ [ $chan(%a) ] ] %c | .hadd cup. [ $+ [ $chan(%a) ] ] teamnr $calc($hget(cup. [ $+ [ $chan(%a) ] ],teamnr) - 1) | cupmsg $chan(%a) $hget(cup, startsym) $hget(cup, maincolor) $+ Team %c has been removed from the cup!, Reason: $knick was kicked! $hget(cup, endsym) }
inc %b
}
:x
inc %a
}
}
}
}
on *:QUIT:{
var %a = 1
while (%a <= $chan(0)) {
if ($hget(cup. [ $+ [ $chan(%a) ] ],status) == on) {
if (!$hget(teams. [ $+ [ $chan(%a) ] ])) { goto x }
var %b = 1
while (%b <= $hget(teams. [ $+ [ $chan(%a) ] ],0).item) {
if ($nick isin $gettok($hget(teams. [ $+ [ $chan(%a) ] ],$hget(teams. [ $+ [ $chan(%a) ] ],%b).item),2-,32)) { var %c = $hget(teams. [ $+ [ $chan(%a) ] ],%b).item | .hdel teams. [ $+ [ $chan(%a) ] ] %c | .hadd cup. [ $+ [ $chan(%a) ] ] teamnr $calc($hget(cup. [ $+ [ $chan(%a) ] ],teamnr) - 1) | cupmsg $chan(%a) $hget(cup, startsym) $hget(cup, maincolor) $+ Team %c has been removed from the cup!, Reason: $nick has quit irc! $hget(cup, endsym) }
inc %b
}
:x
}
inc %a
}
}
on *:load:{
if ($status == connected) {
if (!$hget(cup)) { hmake cup 100 }
.hadd cup maincolor 14
.hadd cup startsym $iif(%cup.startsym != $null,%cup.startsym,10«)
.hadd cup endsym $iif(%cup.endsym != $null,%cup.endsym,10»)
}
cuphelp
}
on *:connect:{
if (!$hget(cup)) { hmake cup 100 }
.hadd cup maincolor 14
.hadd cup startsym $iif(%cup.startsym != $null,%cup.startsym,10«)
.hadd cup endsym $iif(%cup.endsym != $null,%cup.endsym,10»)
}