I got tired if using my previous acronym addon so i made one that is very customize able and can be used in any script by just using the alias with the ini file
menu nicklist,channel,menubar {
-
Acronyms
.$iif($group(#acro) == on,Turn Acronyms Off,Turn Acronyms On) {
if ($group(#acro) == on) {
.disable #acro
echo -a -> Acronyms Are Now Off
}
else {
.enable #acro
echo -a -> Acronyms Are Now On
}
}
.-
.Add an acronym {
var %a $$?="Please enter the acronym: (Ex: lol)"
if (!$readini(Acro.ini,Acronyms,%a)) {
writeini Acro.ini Acronyms %a $$?="Please enter the meening of you acronym: (Ex: laughing out loud)"
echo -a Added %a to the acronym list.
}
else {
echo -a Sorry, %a is already in the acronym list.
}
}
.Delete an acronym {
var %d $$?="Please enter the acronym: (Ex: lol)"
if ($readini(Acro.ini,Acronyms,%d)) {
remini Acro.ini Acronyms %d
echo -a Remove %d from acronym list.
}
else -a Sorry, %d wasn't in the acronym list.
}
}
#acro off
on *:input:*: {
if ($left($1,1) != $chr(47)) {
msg $active $acro($1-)
halt
}
}
#acro end
alias acro {
var %ax $1-
var %ay $numtok(%ax,32)
while (%ay) {
if ($gettok(%ax,%ay,32) isalnum) {
if ($readini(Acro.ini,Acronyms,$gettok(%ax,%ay,32))) {
%ax = $reptokmcs(%ax,$gettok(%ax,%ay,32),$readini(Acro.ini,Acronyms,$gettok(%ax,%ay,32)),32)
}
}
dec %ay
}
tokenize 32 %ax
return $+($upper($left($1,1)),$mid($1-,2))
}
alias reptokmcs {
var %t $1,%k $2,%r $3,%x $4,%f $findtok($1,$2,0,$4)
while (%f) {
%t = $reptok(%t,%k,%r,%f,%x)
dec %f
}
return %t
}