1. get estimate of porn folders
2. work on phil
3. work on 331
;-==========================================
;$MoveTok(text,N,D,C)
; text is string of tokens
; N is number of token to be moved
; D is (where to be moved)
; C is thing
; property: .realitive
; -D represents how many positions to move (positive moves right, negitive movies left)
; (1.2.3.4.5,3,4
alias -l MoveTok {
if ($prop == realitive) {
var %d = $calc($2 + $3)
if (%d < 1) { var %d = 1 }
}
else { var %d = $3 }
return $instok($deltok($1,$2,$4),$gettok($1,$2,$4),%d,$4)
}
; $addLove(nick,change,reason)
alias -l addLove {
var %lNs = %~~LoveNicks
var %lAs = %~~LoveAmnts
if $istok(%lNs,$1,124) {
var %n = $findtok(%lNs,$1,1,124)
var %c = $calc($gettok(%lAs,%n,124) + $2)
var %lAs = $puttok(%lAs,%c,%n,124)
var %x = $2
if (%x > 0) { var %x = + $+ $int($2) }
lvMsg : Love Points $+($1,%x,=,%c) $3
var %resort = %n
}
else {
var %lNs = $addtok(%lNs,$1,124)
var %lAs = $addtok(%lAs,$2,124)
lvMsg : $1 now has $2 Love Points! $3
var %resort = $numtok(%lNs,124)
}
set %~~LoveNicks %lNs
set %~~LoveAmnts %lAs
resortLove %resort
}
alias -l resortLove {
var %n = $1
var %lAs = %~~LoveAmnts
var %c = $gettok(%lAs,%n,124)
;check move left (subtracting)
var %x = %n
while (%x > 0) {
dec %x
if ($gettok(%lAs,%x,124) > %c) {
break
}
}
inc %x
if (%x == %n) {
var %z = $numtok(%lAs,124)
while (%x <= %z) {
inc %x
if ($gettok(%lAs,%x,124) < %c) {
break
}
}
dec %x
}
if (%n != %x) { if $loveMovBoth(%n,%x) { } }
}
; $loveMovBoth(token pos,new pos)
; you'd need to reset local variables
alias -l loveMovBoth {
set %~~LoveNicks $MoveTok(%~~LoveNicks,$1,$2,124)
set %~~LoveAmnts $MoveTok(%~~LoveAmnts,$1,$2,124)
}
alias -l lvMsg {
if ($chan != $null) {
describe $chan $1-
}
else {
echo -a LOVEMSG: $1-
}
}
;===============================
; BELOW ARE THE ONES YOU USE
;usage /love <Name> <change> [<reason>]
alias love {
;using if as noop
if $addLove($1,$2,$3-) { }
}
;usage /removelove <Name>
alias removeLove {
var %lNs = %~~LoveNicks
if $istok(%lNs,$1,124) {
var %n = $findtok(%lNs,$1,1,124)
set %~~LoveNicks $deltok(%lNs,%n,124)
set %~~LoveAmnts $deltok(%~~LoveAmnts,%n,124)
echo -a $1 removed from Love List
}
else {
echo -a ERROR: /removeLove: Nick not found
}
}
alias outputLove {
if ($nick != $null) { var %c = notice $nick }
else { var %c = echo -a }
%c LOVE POINTS
%c $str(=-,13)
var %lNs = %~~LoveNicks
var %lAs = %~~LoveAmnts
if ($numtok(%lNs,124) != $numtok(%lAs,124)) { echo -a ERROR Love: Nicks and Amounts lengths don't match up }
var %x = 1
while (%x <= $numtok(%lNs,124)) {
%c $gettok(%lNs,%x,124) $gettok(%lAs,%x,124)
inc %x
}
%c $str(=-,13)
}
on 1:text:!<3:*: { outputLove }