Posted 24 December 2015 - 12:34 AM
So i'm trying to make a monitor in my main base where it will ask the computer user questions on if certain things are yes or no, then change the text after about 3 questions that are similar and display text for other users to see when they log in. Here is the code i came up with, but if somebody could take a look and clean up. I also get the error : string 26, '=' is expected.
Thanks.
http://pastebin.com/F3vwkbYB
Thanks.
http://pastebin.com/F3vwkbYB
--Welcome to test
--local vars
local side = "left"--CHANGE THIS TO MONITOR SIDE
intro()
--FUNCTIONS
--Intro and program
function intro()
term.clear()
term.setCursorPos(1,1)
term.write("Welcome to Status Message")
askc()
sleep(1)
askq()
sleep(1)
status()
end
--Cart Status
function askc()
term.clear()
term.setCursorPos(1,1)_
term.write("Is the cart running?")
cart = read()
if cart == "yes" then
local scart = "Cart: Mining"
else
local scart = "Cart: OFF"
end
end
--Quarry Status
function askq()
term.clear()
term.setCursorPos(1,1)
term.write("Is the Quarry on?")
quarry = read()
if quarry == "yes" then
local squarry = "Quarry: ON"
else
local squarry = "Quary: OFF"
end
end
--Status Begin
function status()
mon = peripheral.wrap(side)
mon.clear()
mon.setTextSize(2)
mon.setCursorPos(1,1)
mon.write(scart)
mon.write(squarry)
mon.write(sneed)
end