Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- ------------------------------
- -- Created By: --
- -- Noobular --
- -- Creation Date: --
- -- June 03, 2018 --
- -- Last Update: --
- -- June 03, 2018 --
- -- Details: --
- -- 4 tall, 7 wide --
- ------------------------------
- function textSetBase()
- m.setBackgroundColor(colors.black)
- m.setTextColor(colors.white)
- m.setTextScale(1.2)
- end
- function textSetStatus()
- m.setBackgroundColor(colors.blue)
- m.setTextColor(colors.white)
- m.setTextScale(1.2)
- end
- function textSetNav()
- m.setBackgroundColor(colors.blue)
- m.setTextColor(colors.black)
- m.setTextScale(1.2)
- end
- function fixscreen()
- for i=2,25 do
- m.setBackgroundColor(colors.black)
- m.setCursorPos(1,i)
- m.write(" ")
- end
- end
- function NavigationBar()
- writeHeight = 1
- if m then
- textSetNav()
- m.setCursorPos(1,writeHeight)
- m.write(" ")
- m.setCursorPos(1,writeHeight)
- m.write("N00B.OS - By Noobular")
- m.setBackgroundColor(colors.black)
- end
- end
- function drawcolumn(xpos,color)
- if m then
- for i=1,25 do
- m.setBackgroundColor(color)
- m.setCursorPos(xpos, i)
- m.write(" ")
- m.setBackgroundColor(colors.black)
- end
- end
- end
- function drawheader(x,y,bgcolor,txtcolor,text)
- m.setBackgroundColor(bgcolor)
- m.setTextColor(txtcolor)
- m.setCursorPos(x,y)
- m.write(text)
- m.setBackgroundColor(colors.black)
- end
- function drawgui()
- NavigationBar()
- updateStatus("Idle...")
- fixscreen()
- drawheader(3,2,colors.purple,colors.white,"Machines")
- drawheader(25,2,colors.purple,colors.white,"Most Items")
- drawheader(49,2,colors.purple,colors.white,"Lowest Items")
- drawcolumn(1,colors.blue)
- drawcolumn(23,colors.blue)
- drawcolumn(47,colors.blue)
- drawcolumn(71,colors.blue)
- end
- function updateStatus(status)
- writeHeight = 26
- if m then
- textSetStatus()
- m.setCursorPos(1,writeHeight)
- m.write(" ")
- m.setCursorPos(1,writeHeight)
- m.write("Status: "..status)
- end
- end
- function setPeripherals()
- m = peripheral.find("monitor") -- display
- s = peripheral.find("powered_tile") -- storage
- if m then
- m.clear()
- drawgui()
- end
- if s then
- updateStatus("ME System Found...")
- storage = s.getAvaliableItems()
- end
- end
- function showItems()
- for i=0, #storage do
- m.setCursorPos(48,i+1)
- print(storage[i]["name"] .. " = " .. storage[i]["qty"])
- end
- end
- function startup()
- setPeripherals()
- showItems()
- end
- startup()
Add Comment
Please, Sign In to add comment