m = peripheral.wrap("top")
local text = m.setTextScale(5)
local color = m.setTextColor(colors.yellow)
input
while redstone.getInput("front")==false then do
sleep(1)
redstone.getInput("front")
if redstone.getInput("front")==true then
clear()
text
color
m.setCursorPos(2,2)
m.write("Forestry")
sleep(1)
m.setCursorPos(2,4)
m.write("Breeding")
sleep(1)
m.setCursorPos(2,6)
m.write("Tutorial")
sleep(1)
redstone.setOutput("back", true)
end
You need to comment "input", "text", and "color" at lines 6, 17, and 18 with a "–".
if he used – the computer will ignore that lines so it will not set the text size or change the text color to yellow so back to the thread:
if you are starting use any commands in functions not in variables because for what i thing variables is used in commands for example(Correct me pls if im wrong want to learn more):
local test = print("Hello")
test -- this will give you a error
test() --this will also give a error because it an undefined function
local test = "Hello"
print(test) -- this will work because you are printing the variable test
function test1()
print("Hello World")
end
test() --this will work too because you are calling the function test1
so i fixed some bugs of that type and there is the final code:
m = peripheral.wrap("top")
function formating() --creating a function to format the text here
m.setTextScale(5)
m.setTextColor(colors.yellow)
end
while redstone.getInput("front") == false do
sleep(1)
redstone.getInput("front")
if redstone.getInput("front") == true then
clear()
formating() --im calling the function here
m.setCursorPos(2,2)
m.write("Forestry")
sleep(1)
m.setCursorPos(2,4)
m.write("Breeding")
sleep(1)
m.setCursorPos(2,6)
m.write("Tutorial")
sleep(1)
redstone.setOutput("back", true)
end
end