alias alphainvert {
[color:green]; save into a variable for easy editing[/color]
set %templine $1-
var %i = 1
[color:green]; we're gonna do this 13 times (13 couples)[/color]
while (%i <= 13) {
[color:green]; define first letter[/color]
var %first = $calc(96 + %i)
[color:green]; define second letter[/color]
var %last = $calc(123 - %i)
[color:green]; replace letter 1 with a dummy character[/color]
%templine = $replace(%templine,$chr(%first),@)
[color:green]; replace letter 2 with letter 1[/color]
%templine = $replace(%templine,$chr(%last),$chr(%first))
[color:green]; replace dummy character with letter 1[/color]
%templine = $replace(%templine,@,$chr(%last))
inc %i
}
[color:green]; this echoes the inputted text[/color]
echo -a $1-
[color:green]; this returns the changed text to the script[/color]
return %templine
}