cecho/echo Alignment

icesteruk
Posts: 287
Joined: Sun Jan 20, 2013 9:16 pm

cecho/echo Alignment

Post 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?

User avatar
demonnic
Posts: 886
Joined: Sat Dec 05, 2009 3:19 pm

Re: cecho/echo Alignment

Post by demonnic »


icesteruk
Posts: 287
Joined: Sun Jan 20, 2013 9:16 pm

Re: cecho/echo Alignment

Post 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) ]

User avatar
Akaya
Posts: 414
Joined: Thu Apr 19, 2012 1:36 am

Re: cecho/echo Alignment

Post by Akaya »

Would something like this be too complicated?...
Code: [show] | [select all] lua
align("[ OUTC: plantname ("..total_left..") ]",{"center",})

icesteruk
Posts: 287
Joined: Sun Jan 20, 2013 9:16 pm

Re: cecho/echo Alignment

Post by icesteruk »

Akaya wrote:Would something like this be too complicated?...
Code: [show] | [select all] lua
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

User avatar
Akaya
Posts: 414
Joined: Thu Apr 19, 2012 1:36 am

Re: cecho/echo Alignment

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

icesteruk
Posts: 287
Joined: Sun Jan 20, 2013 9:16 pm

Re: cecho/echo Alignment

Post 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
Last edited by icesteruk on Thu Jun 05, 2014 4:58 am, edited 1 time in total.

User avatar
demonnic
Posts: 886
Joined: Sat Dec 05, 2009 3:19 pm

Re: cecho/echo Alignment

Post by demonnic »

Ok, so are there any errors in the error console?

These should help us to figure out where it's breaking down.

icesteruk
Posts: 287
Joined: Sun Jan 20, 2013 9:16 pm

Re: cecho/echo Alignment

Post 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

User avatar
demonnic
Posts: 886
Joined: Sat Dec 05, 2009 3:19 pm

Re: cecho/echo Alignment

Post by demonnic »

Code: [show] | [select all] lua
cecho(calign("[ OUTC: plantname ("..total_left..") ]", {alignment="right"}))
or "center" etc.

Post Reply