Cupbot

Do you have script in mind but no ability to make it, type in what it should do, and you might be lucky.

Cupbot

Postby ziNus » Tue Apr 22, 2008 9:50 pm

-!startcup = <1on1/ or teams> <slots>
(first check if there is a cup running already)
=========================================================================
-!stopcup = stops the current cup
(first check if there is a cup running or not to stop it)
=========================================================================
-!add = if its a 1on1 ofc // !add <teamname>
(first check if the player or teamname are already added)
=========================================================================
-!remove = removed from the signup list
=========================================================================
-!signups = shows a list of *players or teams* who signed up
example 1on1 game: Signed up Players: nickname1, nickname2, nickname3, and so on
example team game: Signed up Teams: Teamname1 (nickname), Teamname2 (nickname), Teamname3 (nickname), and so on
=========================================================================
-!setprize = sets a prize
=========================================================================
-!prize = shows what the prize is
=========================================================================
-!setmap = sets up a mapname
=========================================================================
-!map = shows the current mapname
=========================================================================
-!kickoff = starts with Round1
(must have protection that they dont type twice !kickoff)
example 1on1 game:
Round 1
Nickname1 .vs. Nickname2
Nickname3 .vs. Nickname4
Map: <map>
example team game:
Round 1
Teamname1 (nickname) .vs. Teamname2 (nickname)
Teamname3 (nickname) .vs. Teamname4 (nickname)
Map: <map>
=========================================================================
-!win =
( first looks if the *player or teamname* are actully signed up )
( than it looks if the *player or teamname* dont have been setted to !win twice )
sets a win for *player or teamname*
when all wins are set it starts automatic with the next round
so imagine if its a 4Slots game
there need to be 2 winners.
when u give 2 *players or teams* a win
it starts with next round automatic
=========================================================================
-!whois [ must work only for a teamgame ] it returns who made that team
example: !whois Diamond
returns: Team Diamond = <nickname who made that team>
=========================================================================
on quit: protection than they get removed from the signuplist
on part: protection than they get removed from the signuplist
on kick: protection than they get removed from the signuplist

would be very nice if the bot could be working in multi channels at same time
ziNus
 

Re: Cupbot

Postby Cristian » Sat Apr 26, 2008 12:48 pm

I'm not saying that I will make it, but I will be here to help if needed.

I don't know your scripting experience, but of all scripts the one you make yourself is the best.
Cristian
proof of advance
proof of advance
 
Posts: 282
Joined: Sun Nov 04, 2007 3:02 pm
Location: Denmark
Authnick: Sumsar

Re: Cupbot

Postby Lukemob » Sat May 24, 2008 11:07 am

Hello,

I think if he would have any experience... he wouldn't be asking here to help.

Anyway, I think the solution also would be for you to download already coded script... and the parts you would want to change, paste here, and we will help.

Gl
Lukemob
 

Re: Cupbot

Postby sauK » Fri Aug 15, 2008 2:55 pm

Maybe you are looking for same that this:

http://mysauk.es/2tmcupbot.zip
sauK
 

Re: Cupbot

Postby Lukemob » Fri Aug 15, 2008 5:58 pm

So, try the script sauK gave you. One more thing, coding a cupbot takes a bit more time, so, it's more complicated to get to coding it.
Lukemob
 

Re: Cupbot

Postby ziNus » Sun Oct 05, 2008 2:34 am

i tried the 2tmbot 2 years ago i guess.

and for almost 1 year i'm tryin to make a cupbot that i just posted what it needs.
i really cant make it. if i could i would have done it.

this was the last time i tried --> http://script.quakenet.org/paste/9507 u can see the date

everytime i failed to make 1 it rlly drived me nuts;p..

i would be very happy if you guys could make it

thx allot guys
ziNus
 

Re: Cupbot

Postby Lukemob » Mon Dec 01, 2008 1:14 pm

Cup scripts mostly include a difficult system, which you must think of at first place. It's many lines of code, and from last experience no one will code a script like that for free on request. It gets worse day by day :/

Some coders may have done a script like that, so try to get one like that and use it. If it doesn't fit your requirements ask for a permission to edit a code a bit and then we could help you. I think this would be the best solution for both sides

Regards
Lukemob
 

Re: Cupbot

Postby Futz0r » Mon Jul 20, 2009 3:38 pm

Commands for bot comes with the same loader you script ..

It can run 1on1, 2on2, 3on3, 4on4 and 5on5 Cups and can handle 2, 4, 8, 16, 32, 64, 128 and 256 Slots

It could also hold several cups at the same time on multiple chan:)

Yes, and then there are the anti-flood script in it! its cant flood off

You can change the symbols ( 'and') by typing "/startsym" and "/endsym" in bot ..

btw: its no my script! - i found it!

ENJOY! :)

Code: Select all
;;;;;;;;;;;;;;;;;;;;;;;;
;; ;;
;; -=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»)
}
Futz0r
 


Return to Mirc Scripting Request

Who is online

Users browsing this forum: No registered users and 0 guests