This is a read-only snapshot of the ComputerCraft forums,
taken in April 2020.
Center and Font Size Question
Started by ninjastricken, 24 March 2013 - 06:14 AMPosted 24 March 2013 - 07:14 AM
OK so I have tryed to get the text to center and make the font big but it wont work. I have been able to get the font to change but when I restart the server it dosent run automaticly. I have no clue on haw to make the font and center the text. the way i want it to look is like this.http://s24.postimg.o...23_14_12_53.png and http://s8.postimg.or...23_14_13_09.png
Posted 24 March 2013 - 07:54 AM
I've made this script for you, was easy and bored:P
http://pastebin.com/jaDNwk00
If you have questions about this script please respond.
http://pastebin.com/jaDNwk00
If you have questions about this script please respond.
Posted 24 March 2013 - 07:58 AM
Ok i dont know much but i got For input string: "1DollarDonations" does that mean i have to put something there
Posted 24 March 2013 - 08:09 AM
Yes, you modify it:
And dont forget the comma, its very important!
1DollarDonations = {
[1] = "your string",
[2] = "another string",
-- Etc.
}
And dont forget the comma, its very important!
Posted 24 March 2013 - 08:18 AM
what about the For or input string: "1DollarDonations"
Posted 24 March 2013 - 08:23 AM
Is that an error or what? Explain a little bit more.what about the For or input string: "1DollarDonations"
Posted 24 March 2013 - 08:25 AM
I don't know it just says that when i try to run the program. I type Monitor Top Don (what i named it) and i get that
Posted 24 March 2013 - 08:26 AM
Here is a more user friendly code :)/>
local w, h = term.getSize()
local function center(text)
x, y = term.getCursorPos()
term.setCursorPos((w/2)-#text/2, y)
print(text)
end
center("this is where")
center("you put the text")
center("you want to center")
center("-pinksheep00")
Posted 24 March 2013 - 08:33 AM
does that stay on the screen after the server is restarted?
Posted 24 March 2013 - 08:37 AM
when the server restarts or the chucks were unloaded the computers also restarts.
To fix this. make a new program and put this :
To fix this. make a new program and put this :
shell.run("Monitor Top Don")
then save it as "startup"Posted 24 March 2013 - 08:50 AM
OK so i'm so nooby that i have no clue where to put that.
here is the code i'm editing pastebin.com/pZnrkNpL
here is the code i'm editing pastebin.com/pZnrkNpL
Posted 24 March 2013 - 09:24 AM
I have no idea where to put thatwhen the server restarts or the chucks were unloaded the computers also restarts.
To fix this. make a new program and put this :then save it as "startup"shell.run("Monitor Top Don")
also it doesn't run the program on the screen unless i type monitor top Don
Posted 24 March 2013 - 10:32 PM
Try changing the name of 1DollarDonations to asomething that doesn't start with a number. I think it's erroring because of that.
Btw engineer, 'local w,h = term.getSize()' why you getting the size of the computer and not monitor? :P/>
Btw engineer, 'local w,h = term.getSize()' why you getting the size of the computer and not monitor? :P/>
Posted 24 March 2013 - 10:36 PM
yes variables cannot start with a number…
also a good way to do center is
also a good way to do center is
term.setCursorPos( screen_width / 2 - #text / 2 + (#text % 2 == 0 and 0 or 1), y_pos)
this way the strings always look like they are in the middle whether they are an even or odd length.Posted 25 March 2013 - 12:55 AM
Try changing the name of 1DollarDonations to asomething that doesn't start with a number. I think it's erroring because of that.
Btw engineer, 'local w,h = term.getSize()' why you getting the size of the computer and not monitor? :P/>
It was late yesterday xDyes variables cannot start with a number…
also a good way to do center isthis way the strings always look like they are in the middle whether they are an even or odd length.term.setCursorPos( screen_width / 2 - #text / 2 + (#text % 2 == 0 and 0 or 1), y_pos)