1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
|
on *:LOAD: {
hmake Cupbot
hmake Maps
hmake aslots
}
on *:Text:*:#ziNus: {
if ( $1 == !startcup ) && ( $2 != $null ) && ( $3 != $null ) && ( $hget(cupbot,$chan) != on ) {
hadd Cupbot $chan on
writeini cupbot.ini $chan slots $3
writeini cupbot.ini $chan type $2
hadd maps $chan TBA
hadd aslots $chan 0
msg $chan New Cup has been started! $readini(cupbot.ini, $chan, type) slots: $readini(cupbot.ini, $chan, slots)
}
if ( $1 == !stopcup ) && ( $hget(cupbot,$chan) == on ) {
hadd Cupbot $chan off
hfree Maps $chan
hfree aslots $chan
.remini cupbot.ini $chan
msg $chan Cup has Been Stopped.
}
;sets map and says which map is set.;
if ($1 == !map) {
if ( $2 != $null ) && ( $nick isop $chan ) && ( $hget(cupbot,$chan) == on ) {
hadd Maps $chan $2-
msg $chan Next Map: $2-
}
elseif ( $2 == $null ) && ( $hget(maps,$chan) != $null ) {
msg $chan Current map is $hget(maps,$chan)
}
}
if ($1 == !prize) {
if ($2 != $null) && ($nick isop $chan) && ($hget(cupbot,$chan) == on) {
writeini cupbot.ini $chan prize $2-
msg $chan Prize: $2-
}
elseif ( $2 == $null ) && ( $readini(cupbot.ini, $chan, prize) != $null ) {
msg $chan Prize for current cup is $readini(cupbot.ini, $chan, prize)
}
}
if ( $1 == !add ) && ($hget(cupbot,$chan) == on) {
if ($readini(cupbot.ini,$chan,type) == 1on1) {
.writeini teams.ini $chan $nick $address($nick,3)
msg $chan Signed up: $nick
hinc aslots $chan
}
if ($readini(cupbot.ini,$chan,type) != 1on1) && ($2 ison $chan) {
.writeini teams.ini $chan $address($nick,3) $3-
msg $chan Signed up Team: $3- Players: $Nick & $2
hinc aslots $chan
}
}
if ( $1 == !signups ) && ($hget(cupbot,$chan) == on) {
if ($readini(cupbot.ini,$chan,type) == 1on1) {
var %x 1
while (%x <= $hget(aslots,$chan)) {
var %c1 0,1
var %c2 4,1
set %1on1 $addtok(%1on1, %c1 $ini(teams.ini, $chan, %x) $+ %c2 ,44)
inc %x
}
msg $chan Signed up Players: %1on1
.unset %1on1
}
if ($readini(cupbot.ini,$chan,type) != 1on1) {
var %x 1
while (%x <= $hget(aslots,$chan)) {
var %c1 0,1
var %c2 4,1
set %teams $addtok(%teams, %c1 $gettok($ini(teams.ini,$chan,%x),1,32) $+($chr(40),$gettok($ini(teams.ini,$chan,%x),2-,32),$chr(41)) $+ %c2 ,44)
inc %x
}
msg $chan Signed up Teams: %teams
.unset %teams
}
}
if ( $1 == !kickoff ) && ($hget(cupbot,$chan) == on) {
;;;; starts to say who vs who
}
if ( $1 == !win ) && ($hget(cupbot,$chan) == on) {
;;;; sets a win for the player / or team if its a teamgame
;;;; when all wins are done it says again who .vs. who <-- the players/teams that go to next round ofc
}
;lists commands;
if ( $1 == !help ) {
notice $nick the commands are: * !startcup <1on1/2on2/3on3/4on4> <slots> * !stopcup * !prize (prize) * !map (map) * !add <team> <player2> * !teams * !rounds * !lost team *
}
}
|