;VARIABLES LIST FOR !SORT
;%a = Points Output Local
;%b = End Trigger For Checking For .
;%c = Increase For $right And $left
;%d = Name Output Local
;%e = Points Output Global
;%f = Name Output Global
;%x = Loop
on *:TEXT:!sort*:#: {
if (!$2) {
var %x $lines(exp.txt)
while (%x) {
var %e 0
var %c 1
var %b 0
while (%b != 1) {
var %a $right($read(exp.txt,%x),%c))
inc %c
if (. isin $right($read(exp.txt,%x),%c)) { var %b 1 }
}
var %c 1
var %b 0
while (%b != 1) {
var %d $left($read(exp.txt,%x),%c))
inc %c
if (. isin $left($read(exp.txt,%x),%c)) { var %b 1 }
}
if ( %a > %e) {
var %e %a
var %f %d
}
msg # %e %a
dec %x
}
msg # First place is %f with a score of %e $+ .
}
; elseif ($2 >= 1) {
; var %x $lines(exp.txt)
; while (%x) {
; var %c 1
; var %b 0
; while (%b != 1) {
; var %a $right($read(exp.txt,%x),%c))
; inc %c
; if (. isin $right($read(exp.txt,%x),%c)) { var %b 1 }
; }
; var %c 1
; var %b 0
; while (%b != 1) {
; var %d $left($read(exp.txt,%x),%c))
; inc %c
; if (. isin $left($read(exp.txt,%x),%c)) { var %b 1 }
; }
; dec %x
; }
; msg # First place is %f with a score of %e $+ .
; }
}
on *:TEXT:*:#: {
unset %exp.*
;if ($($+(%,flood.,$nick),2)) { return }
;set -u30 %flood. $+ $nick On
var %x $lines(exp.txt)
while (%x) {
if ($nick isin $read(exp.txt,%x)) {
inc %exp.search
set %exp.return $addtok(%exp.return,%x,32)
}
dec %x
}
if (!%exp.search) { .write exp.txt $nick $+ . $+ 1 }
elseif (%exp.search == 1) {
var %a $read(exp.txt,%exp.return)
var %b $remove(%a,$nick $+ .)
var %b $calc(%b + 1)
.write -dl $+ %exp.return exp.txt
.write exp.txt $nick $+ . $+ %b
}
unset %exp.*
}