Page 1 of 2
cecho/echo Alignment
Posted: Mon Jun 02, 2014 1:56 am
by icesteruk
Does Mudlet have a way to align cecho/echo to the right or center, instead of to the left as it is now?
I made a way using string.rep(" ", number) but on some screens the number is too long or, too short. Or Will I have to make some script witht he .rep function?
Re: cecho/echo Alignment
Posted: Tue Jun 03, 2014 5:28 pm
by demonnic
Re: cecho/echo Alignment
Posted: Wed Jun 04, 2014 6:25 am
by icesteruk
I seen thaat but too complicated for what I was after... and the output isnt what I was after either as I want it to be something like
[ OUTC: plantname (totalleeft) ]
Re: cecho/echo Alignment
Posted: Wed Jun 04, 2014 2:08 pm
by Akaya
Would something like this be too complicated?...
align("[ OUTC: plantname ("..total_left..") ]",{"center",})
Re: cecho/echo Alignment
Posted: Thu Jun 05, 2014 3:22 am
by icesteruk
Akaya wrote:Would something like this be too complicated?...
align("[ OUTC: plantname ("..total_left..") ]",{"center",})
Am I missing something, The above does nothing... :/
I want something simple as people who hardly know how to code will be using it, And I want to be able to move it from left, right or center depending on what the person wants
Re: cecho/echo Alignment
Posted: Thu Jun 05, 2014 3:37 am
by Akaya
If you use the script from the above link, it does exactly what you're describing in a single function.
First parameter is what you'd like to echo. Second parameter is a table of how you'd like it styled in any order. Centered and whatnot. Can't get much more simple than that

Re: cecho/echo Alignment
Posted: Thu Jun 05, 2014 4:55 am
by icesteruk
I tried but its just aligning to the left.. not center as what you posted stated ... It why im confused
cecho(calign("[ OUTC: plantname ("..total_left..") ]",{"center",}))
echo(calign("[ OUTC: plantname ("..total_left..") ]",{"center",}))
Are what I tried to use
Re: cecho/echo Alignment
Posted: Thu Jun 05, 2014 4:56 am
by demonnic
Ok, so are there any errors in the error console?
These should help us to figure out where it's breaking down.
Re: cecho/echo Alignment
Posted: Thu Jun 05, 2014 5:10 am
by icesteruk
No errors, its showing just not, alignin correctly ...
[ OUTC: plantname (377) ] is whats being shown..
Unsure if this is a issue but it looks like its followng on from the prompt before (that shouldn't be happening I guess)
8%|S:100|xp 71.4%|(m/c) [ OUTC: plantname << prompt line
(1974) ] << new line
---
0.00%] [csdb eb] |B0|E:98%|S:100|xp 71.4%|(m/c)outc slice
You remove 1 testis slice, bringing the total in the cache to 40.
Is what im trying to make align to the right, the You remove line
Re: cecho/echo Alignment
Posted: Thu Jun 05, 2014 6:08 am
by demonnic
cecho(calign("[ OUTC: plantname ("..total_left..") ]", {alignment="right"}))
or "center" etc.