rendered paste bodyon *:text:.reg *:#: {
if (@ $+ $nick $+ @ isin %users.allow) {
if ($2) {
write komandos.txt $2 0
msg $chan Uzregistruota komanda $2
}
else { msg $nick Neivestas komandos pavadinimas }
}
else { msg $nick Jums nesuteikta teise naudoti sia komanda }
}
on *:text:.rem *:#: {
if (@ $+ $nick $+ @ isin %users.allow) {
write -ds $+ $2 komandos.txt
msg $chan Istrinta komanda $2
}
else { msg $nick Jums nesuteikta teise naudoti sia komanda }
}
on *:text:.suzaide *:#: {
if (@ $+ $nick $+ @ isin %users.allow) {
var %kom1 $gettok($3,1,58)
var %kom2 $gettok($3,2,58)
if ($2) && ($4) && (%kom1 isnum 0-16) && (%kom2 isnum 0-16) {
if (%kom1 == 15) && (%kom2 == 15) {
write -s $+ $2 komandos.txt $2 $calc($read(komandos.txt,s,$2)+2)
write -s $+ $4 komandos.txt $4 $calc($read(komandos.txt,s,$4)+2)
halt
}
if (%kom1 > %kom2) {
write -s $+ $2 komandos.txt $2 $calc($read(komandos.txt,s,$2)+3)
write -s $+ $4 komandos.txt $4 $calc($read(komandos.txt,s,$4)+1)
}
else {
write -s $+ $2 komandos.txt $2 $calc($read(komandos.txt,s,$2)+1)
write -s $+ $4 komandos.txt $4 $calc($read(komandos.txt,s,$4)+3)
}
}
}
else { msg $nick Jums nesuteikta teise naudoti sia komanda }
}
on *:text:.vieta *:#: {
var %pts $read(komandos.txt,s,$2)
if (%pts) {
var %vieta 1
var %tmp 1
var %lin
while (%tmp <= $lines(komandos.txt)) {
%lin = $read(komandos.txt,%tmp)
if ($gettok(%lin,2,32) > %pts) { inc %vieta }
inc %tmp
}
msg $chan $chr(35) $+ %vieta $2 ( $+ %pts $+ ).
}
else { msg $nick Neegzistuojanti komanda }
}
on *:text:.top3:#: {
var %top1 0
var %top2 0
var %top3 0
var %msg1, %msg2, %msg3, %lin, %tpts, %tkom
var %tmp 1
while (%tmp <= $lines(komandos.txt)) {
%lin = $read(komandos.txt,%tmp)
%tpts = $gettok(%lin,2,32)
%tkom = $gettok(%lin,1,32)
echo -a %tpts - %tkom
if (%tpts >= %top1) {
if (%tpts == %top1) {
%msg1 = $replace(%msg1,.,$chr(44)) %tkom ( $+ %tpts $+ ).
}
else {
%top3 = %top2 | %msg3 = %msg2
%top2 = %top1 | %msg2 = %msg1
%top1 = %tpts | %msg1 = %tkom ( $+ %tpts $+ ).
}
}
elseif (%tpts >= %top2) {
if (%tpts == %top2) {
%msg2 = $replace(%msg2,.,$chr(44)) %tkom ( $+ %tpts $+ ).
}
else {
%top3 = %top2 | %msg3 = %msg2
%top2 = %tpts | %msg2 = %tkom ( $+ %tpts $+ ).
}
}
elseif (%tpts >= %top3) {
if (%tpts == %top3) {
%msg3 = $replace(%msg3,.,$chr(44)) %tkom ( $+ %tpts $+ ).
}
else { %top3 = %tpts | %msg3 = %tkom ( $+ %tpts $+ ). }
}
inc %tmp
}
msg $chan Pirma vieta: $iif(%msg1,%msg1,Nera!)
msg $chan Antra vieta: $iif(%msg2,%msg2,Nera!)
msg $chan Trecia vieta: $iif(%msg3,%msg3,Nera!)
}