- alias correction {
- if ($1 == ADD) {
- if ($3) {
- var %ù 1
- while ($read(correction.txt,%ù)) {
- if ($gettok($ifmatch,1,32) == $2) { echo -a [3Correction] Le mot $+(",$2,") est déjà dans la liste. | halt }
- inc %ù
- }
- write correction.txt $2-
- echo -a [3Correction] Le mot $+(",$2,") sera désormais remplacé par $+(",$3-,")
- }
- else { echo -a [3Correction] Syntaxe : /correction ADD Mot a remplacer Remplacer par... }
- }
- elseif ($1 == DEL) {
- if ($2 && !$3) {
- var %o 1
- while ($read(correction.txt,%o)) {
- if ($gettok($ifmatch,1,32) == $2) { write $+(-dl,%o) correction.txt | echo -a [4Correction] Le mot $+(",$2,") a été supprimé de la liste. | halt }
- inc %o
- }
- echo -a [4Correction] Le mot $+(",$2,") est introuvable dans la liste.
- }
- else { echo -a [4Correction] Syntaxe : /correction DEL Mot }
- }
- elseif ($1 == LIST) {
- if (!$2) {
- echo -a [12Correction] Liste des mots corrigés...
- var %^ 1
- while ($read(correction.txt,%^)) { echo -a [12Correction] Le mot $+(",$gettok($ifmatch,1,32),") est remplacé par $+(",$gettok($ifmatch,2-,32),") | inc %^ }
- echo -a [12Correction] Fin de la liste des mots corrigés.
- }
- else { echo -a [12Correction] Syntaxe : /correction LIST }
- }
- elseif ($1 == STATUS) {
- if ($istok(0.1,$2,46) && !$3) {
- $iif($2,set,unset) %correction 1
- echo -a [7Correction] La correction est maintenant $iif($2,activée,désactivée.)
- }
- else { echo -a [7Correction] Syntaxe : /correction STATUS 0|1 }
- }
- }
- alias corrige {
- var %a = $1-, %e = 1
- while ($gettok(%a,%e,32)) {
- if ($read(correction.txt,s,$ifmatch)) { var %a = $puttok(%a,$ifmatch,%e,32) }
- inc %e $iif($numtok($ifmatch,32) > 1,$calc($numtok($ifmatch,32) + 1))
- }
- return %a
- }
- on *:INPUT:#:{
- if (%correction && $left($1-,1) !isin /!.) { msg $active $corrige($1-) | halt }
- }
alias correction {
if ($1 == ADD) {
if ($3) {
var %ù 1
while ($read(correction.txt,%ù)) {
if ($gettok($ifmatch,1,32) == $2) { echo -a [3Correction] Le mot $+(",$2,") est déjà dans la liste. | halt }
inc %ù
}
write correction.txt $2-
echo -a [3Correction] Le mot $+(",$2,") sera désormais remplacé par $+(",$3-,")
}
else { echo -a [3Correction] Syntaxe : /correction ADD Mot a remplacer Remplacer par... }
}
elseif ($1 == DEL) {
if ($2 && !$3) {
var %o 1
while ($read(correction.txt,%o)) {
if ($gettok($ifmatch,1,32) == $2) { write $+(-dl,%o) correction.txt | echo -a [4Correction] Le mot $+(",$2,") a été supprimé de la liste. | halt }
inc %o
}
echo -a [4Correction] Le mot $+(",$2,") est introuvable dans la liste.
}
else { echo -a [4Correction] Syntaxe : /correction DEL Mot }
}
elseif ($1 == LIST) {
if (!$2) {
echo -a [12Correction] Liste des mots corrigés...
var %^ 1
while ($read(correction.txt,%^)) { echo -a [12Correction] Le mot $+(",$gettok($ifmatch,1,32),") est remplacé par $+(",$gettok($ifmatch,2-,32),") | inc %^ }
echo -a [12Correction] Fin de la liste des mots corrigés.
}
else { echo -a [12Correction] Syntaxe : /correction LIST }
}
elseif ($1 == STATUS) {
if ($istok(0.1,$2,46) && !$3) {
$iif($2,set,unset) %correction 1
echo -a [7Correction] La correction est maintenant $iif($2,activée,désactivée.)
}
else { echo -a [7Correction] Syntaxe : /correction STATUS 0|1 }
}
}
alias corrige {
var %a = $1-, %e = 1
while ($gettok(%a,%e,32)) {
if ($read(correction.txt,s,$ifmatch)) { var %a = $puttok(%a,$ifmatch,%e,32) }
inc %e $iif($numtok($ifmatch,32) > 1,$calc($numtok($ifmatch,32) + 1))
}
return %a
}
on *:INPUT:#:{
if (%correction && $left($1-,1) !isin /!.) { msg $active $corrige($1-) | halt }
}