monitor = peripheral.wrap("monitor_1")
function pos(...) return term.setCursorPos(...) end
function cls(...) return term.clear() end
function tCol(...) return term.setTextColor(...) end
function bCol(...) return term.setBackgroundColor(...) end
function box(...) return paintutils.drawFilledBox(...) end
function line(...) return paintutils.drawLine(...) end
function write(...) return term.write(...) end
term.redirect(monitor)
w, h = monitor.getSize()
function getSize() w,h = monitor.getSize() end
tCol(colors.white)
local darkmode = true
local darkmodec
local boolArray = {false,false,false,false,false,false,false,false}
local function basics()
monitor.setTextScale(1.5)
getSize()
cls()
if darkmode then
darkmodec = colours.black
else
darkmodec = colours.blue
end
box(1,1,w,h,darkmodec)
pos(w/2-#"BASICS"/2,1)
write("BASICS")
pos(5,3)
write("Andesite Casing")
if boolArray[1]==false then
box(23,3,26,3,colors.red) else box(23,3,26,3,colors.lime)
end
pos(5,5)
bCol(darkmodec)
write("Copper Casing")
if boolArray[2]==false then
box(23,5,26,5,colors.red) else box(23,5,26,5,colors.lime)
end
pos(5,7)
bCol(darkmodec)
write("Brass Casing")
if boolArray[3]==false then
box(23,7,26,7,colors.red) else box(23,7,26,7,colors.lime)
end
pos(5,9)
bCol(darkmodec)
write("Basic Machine F.")
if boolArray[4]==false then
box(23,9,26,9,colors.red) else box(23,9,26,9,colors.lime)
end
pos(5,11)
bCol(darkmodec)
write("Advanced Machine F")
if boolArray[5]==false then
box(23,11,26,11,colors.red) else box(23,11,26,11,colors.lime)
end
pos(5,13)
bCol(darkmodec)
write("Shaft")
if boolArray[6]==false then
box(23,13,26,13,colors.red) else box(23,13,26,13,colors.lime)
end
pos(5,15)
bCol(darkmodec)
write("S. Cog")
if boolArray[7]==false then
box(23,15,26,15,colors.red) else box(23,15,26,15,colors.lime)
end
pos(5,17)
bCol(darkmodec)
write("L. Cog")
if boolArray[8]==false then
box(23,17,26,17,colors.red) else box(23,17,26,17,colors.lime)
end
pos(1,h)
bCol(colors.black)
write("EXIT")
while true do
local event, button, mx, my = os.pullEvent()
if event == "monitor_touch" then
if mx >= 1 and mx <= (1+#"EXIT") and my == h then
return "menu"
elseif mx >= 23 and mx<= 26 and my == 3 then
boolArray[1] = not boolArray[1]
basics()
elseif mx >= 23 and mx<= 26 and my == 5 then
boolArray[2] = not boolArray[2]
basics()
elseif mx >= 23 and mx<= 26 and my == 7 then
boolArray[3] = not boolArray[3]
basics()
elseif mx >= 23 and mx<= 26 and my == 9 then
boolArray[4] = not boolArray[4]
basics()
elseif mx >= 23 and mx<= 26 and my == 11 then
boolArray[5] = not boolArray[5]
basics()
elseif mx >= 23 and mx<= 26 and my == 13 then
boolArray[6] = not boolArray[6]
basics()
elseif mx >= 23 and mx<= 26 and my == 15 then
boolArray[7] = not boolArray[7]
basics()
elseif mx >= 23 and mx<= 26 and my == 17 then
boolArray[8] = not boolArray[8]
basics()
elseif mx >= w/2-#"BASICS"/2 and mx <= w/2+#"BASICS"/2 and my == 1 then
darkmode = not darkmode
basics()
end
end
end
end
return {basics = basics}