Align Script

By frishy on Dec 19, 2008

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
  }
}

Comments

Sign in to comment.
frishy   -  Jan 08, 2009

o right thanks :$, i still say it shud be spelt allign :P

 Respond  
KronicDreamer   -  Jan 08, 2009

align *

 Respond  
Vox91   -  Dec 20, 2008

NNScript theme system ^^ :P it changes the color index ;)

 Respond  
frishy   -  Dec 19, 2008

oh right yeah forgot to delete that lol ;x dont see why u cudnt see it though, it shows up pink not black ;s. Anyway changed it to msg $active, i still prefer say myself ;p.

 Respond  
Vox91   -  Dec 19, 2008

sorry msg $active ^^'

And ya I know but it looks more prof ;)
and get rit of the collors on "Settings done" cause I have a black background so I can not read the text :P

 Respond  
frishy   -  Dec 19, 2008

thanks man :).

why replace it, say does exactly the same as msg $active doesnt it ;x

 Respond  
Vox91   -  Dec 19, 2008

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 :)

 Respond  
Are you sure you want to unfollow this person?
Are you sure you want to delete this?
Click "Unsubscribe" to stop receiving notices pertaining to this post.
Click "Subscribe" to resume notices pertaining to this post.