A script that aligns your text to right or centre. I got bored and made this ;s. It goes into ur remotes ofc (alt+r).
It has a menu (right click on the channel and click alignment, to set alignment to centre (c), right (r), or off. Alternatively type /ca text for centre alignment, or /ra text for right alignment.
The code is optimised for my resolution and app size, change it to fit you if you want to use it.
alias ra {
msg $active $str( $chr(32),$calc(70 - $len($1-))) $+ $1-
}
alias ca {
msg $active $str( $chr(32),$calc(35 - $calc($len($1-)/2))) $+ $1-
}
menu channel {
-
Alignment:{ set -e %align $input(What alignment do you want? (R/C/off),eo,,Off,)
echo -a $replacex(%align,c,Centre Alignment initiated!,r,Right Alignment initiated!,off,Alignment OFF!) }
}
on *:INPUT:*:{
if (%align == r || %align == c) && ($left($1,1) != /) {
noop $($+($chr(36),$replacex(ra,r,$iif(%align == c,c,r)),$chr(40),$1-,$chr(41)),2)
haltdef
}
}
Some minor things that can come in handy.
on:
say $str( $chr(32),$calc(70 - $len($1-))) $+ $1-
&
say $str( $chr(32),$calc(35 - $calc($len($1-)/2))) $+ $1-
replace it with:
msg $active $str( $chr(32),$calc(70 - $len($1-))) $+ $1-
&
msg $active $str( $chr(32),$calc(35 - $calc($len($1-)/2))) $+ $1-
Further more nice code :)