on *:TEXT:@register*:#findclan-cod2: {
if (!$hget(players,$nick)) {
if ($2) {
hadd -u604800 players $nick $2
notice $nick You registered in the $2 category. Your registration will expire in 7 days, if you find a team before then, please notify an admin.
}
else { msg $chan Please specify a league. (@register CAL-m) }
}
else { msg $chan Your nickname already exists in the $upper($hget(players,$nick)) database. }
}
on *:TEXT:@status*:#findclan-cod2: {
if ($nick ison $chan) {
if (($2 == cal-o) || ($2 == cal-m) || ($2 == cal-i)) || ($2 == other) {
var %x 1
while (%x <= $hget(players,0).item) {
if ($hget(players,%x).data == $2) {
set %results %results $hget(players,%x).item
}
inc %x
}
msg $chan $+(,$upper($2) Players:) %results
unset %results
}
if ($2 == detail) {
msg $chan Registered Players:
msg $chan CAL-O: $hfind(players,cal-o,0).data
msg $chan CAL-M: $hfind(players,cal-m,0).data
msg $chan CAL-I: $hfind(players,cal-i,0).data
msg $chan OTHER: $hfind(players,other,0).data
}
msg $chan Total Registered: $hget(players,0).item
}
}
ON *:TEXT:@detail*:#findclan-cod2: {
if ($2) {
if ($hget(players,$nick)) {
set %x $hfind(details,$2, N, M)
msg $chan $2 $+ 's Details: $hget(details,%x).data
}
else { msg $chan $2 is not in the database! }
}
else { msg $chan Please specify a name! }
}
ON *:TEXT:@mydetail*:#findclan-cod2: {
if ($2) {
if ($hget(players,$nick)) {
hadd details $nick $2-
msg $chan $nick $+ 's details has been set to: $2-
}
if (!$2) && ($hget(players,$nick)) {
msg $chan $nick $ 's Details: ($hget(details,$nick))
}
else { msg $chan You have no details set. }
}
else { msg $chan You are not registered! }
}
ON *:TEXT:@del*:#findclan-cod2: {
if ($2) && ($nick isop $chan) {
if ($hget(players,$2)) {
hdel players $2
hdel details $2
msg $chan Deleted $2 from the database.
}
else { msg $chan $2 is not in the database! }
}
else { msg $chan Please specify a name! }
}
ON *:TEXT:@commands*:#findclan-cod2: {
if ($hget(players,$nick)) {
msg $chan Commands: @register - use to register your nick and league in the database - Only CAL-o, CAL-m, CAL-I, or OTHER can be specified as your league (i.e. @register cal-m)
msg $chan @status - use to view player names of whos looking for a team - @status detail for more detail (i.e @status cal-m)
msg $chan @mydetail - use to set or view your detail - leaving @mydetail blank will show your detail, adding stuff after it sets your detail (i.e @mydetail Past Teams: compLexity Contact: AIM-chickenEater)
msg $chan @note - use to send notes to someone in the database. (i.e @note wonder Tryout for us, pm me in #skippyfx)
msg $chan @credits - use to view credits!
}
if (!$hget(players,$nick)) {
msg $chan Commands: @register use to register with the bot (@register cal-m) - Other commands can be given once registered.
}
}
ON *:TEXT:@credits*:#findclan-cod2: {
msg $chan Coding - wonder and snang
msg $chan Idea - Twista
msg $chan Version - 1.0
}
on *:TEXT:@note *:#findclan-cod2: {
if ($hget(players,$2)) {
if ($2 ison $chan) { .msg $2 Note from $nick $+ : $3- | .notice $nick Note delivered to $2 $+ . }
else {
if ($hget($2)) {
hadd $2 $calc($hget($2,0).item + 1) $nick $3-
.notice $nick Note successfully added for $2 $+ . The note will be delivered ASAP.
}
else {
hmake -s $2 20
hadd $2 $calc($hget($2,0).item + 1) $nick $3-
.notice $nick Note successfully added for $2 $+ . The note will be delivered ASAP.
}
}
}
}
on *:JOIN:#findclan-cod2: {
if ($hget($nick)) {
if ($hget($nick,0).item > 0) {
.notice $nick Notice: You have $hget($nick,0).item $iif($hget($nick,0).item == 1,note,notes) waiting. To read, PM the bot with "@notes".
}
}
}
on *:TEXT:@del *:?: {
if ($hget($nick)) {
if ($2 isnum) {
hdel $nick $2
.msg $nick Deleted note $2 $+ .
}
elseif ($2 == all) { hfree $nick | msg $nick Deleted all notes. }
}
}
on *:TEXT:@notes:?: {
if ($hget($nick)) {
if ($hget($nick,0).item > 0) {
.msg $nick Listing all notes:
var %x 1
while (%x <= $hget($nick,0).item) {
.msg $nick $chr(91) $+ $hget($nick,%x).item $+ $chr(93) $gettok($hget($nick,%x).data,1,32) $+ : $gettok($hget($nick,%x).data,2-,32)
inc %x
}
.msg $nick Use: @del <number> (eg: @del 1) to delete notes, or @del all to delete them all.
}
}
}