Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- local b = require("button")
- local m = peripheral.find("monitor")
- local r = peripheral.find("BigReactors-Reactor")
- local c = peripheral.find("minecraft:chest")
- local ins = {peripheral.find("bigreactors:tileentityreactoraccessport")}
- local rin = ins[1]
- local rout = ins[2]
- ----*peripheral check(--------
- if not m then
- local otc = term.getBackgroundColor()
- term.setBackgroundColor(colors.black)
- error("you dont have a monitor attached !", 0)
- term.setBackgroundColor(otc)
- end
- if not r then
- m.setCursorPos(2, 5)
- m.setTextColor(colors.white)
- m.setBackgroundColor(colors.black)
- m.clear()
- m.setTextScale(2)
- m.write("you dont have a reactor attached !")
- error("no detected reactor !", 0)
- end
- if not c then
- m.setCursorPos(2, 5)
- m.setTextColor(colors.white)
- m.setBackgroundColor(colors.black)
- m.clear()
- m.setTextScale(1)
- m.write("you dont have a chest attached !")
- error("no chest detected !", 0)
- end
- if not rin then
- m.setCursorPos(2, 5)
- m.setTextColor(colors.white)
- m.setBackgroundColor(colors.black)
- m.clear()
- m.setTextScale(1)
- m.write("no input/output port detected !")
- error("no ports detected !", 0)
- end
- if (not rout) and rin then
- m.setCursorPos(2, 5)
- m.setTextColor(colors.white)
- m.setBackgroundColor(colors.black)
- m.clear()
- m.setTextScale(1)
- m.write("no or 1 input/output port detected !")
- error("no or 1 port detected !", 0)
- end
- ----*peripheral check)--------
- local mname = peripheral.getName(m)
- m.setTextScale(0.5)
- m.clear()
- m.setBackgroundColor(colors.cyan)
- b.frame(mname, 3, 19, 97, 18, "white", "cyan", false)
- b.frame(mname, 30, 20, 40, 5, "white", "red", true)
- m.setCursorPos(42, 20)
- m.blit("reakt by 9551", string.rep("1", 13), string.rep("7", 13))
- m.setCursorPos(37, 21)
- m.blit("reactor control program", string.rep("1", 23), string.rep("7", 23))
- m.setCursorPos(38, 28)
- m.write("default peripherals used \25")
- m.setBackgroundColor(colors.red)
- m.setCursorPos(36, 29)
- m.write("reactor: " .. peripheral.getName(r))
- m.setCursorPos(36, 30)
- m.write("monitor: " .. peripheral.getName(m))
- m.setCursorPos(36, 31)
- m.write("chest: " .. peripheral.getName(c))
- local function topline()
- b.frame(mname, 5, 6, 70, 1, "black", "black")
- m.setCursorPos(6, 6)
- m.write("yes")
- m.setCursorPos(10, 6)
- m.write("test")
- end
- local function setcol(x, text)
- local oldcol = m.getBackgroundColor()
- m.setBackgroundColor(colors.gray)
- m.setCursorPos(x + 1, 6)
- m.write(text)
- m.setBackgroundColor(oldcol)
- end
- local function maincard(x, text)
- topline()
- local oldcol = m.getBackgroundColor()
- m.setBackgroundColor(colors.cyan)
- b.frame(mname, 5, 22, 70, 14, "black", "gray", true)
- m.setBackgroundColor(colors.gray)
- b.frame(mname, x + 2, 8, #text - 1, 1, "gray", "gray")
- setcol(x, text)
- m.setBackgroundColor(oldcol)
- end
- local function menuButtons()
- local click = b.timetouch(1, mname)
- b.menu(mname, click, 1, 81, 7, "black", "red", "yes", "yes", true, 5)
- b.menu(mname, click, 2, 81, 8, "black", "red", "test", "test", true, 9)
- b.menu(mname, click, 3, 81, 9, "black", "red", "idk", "idk", true, 1)
- b.menu(mname, click, 4, 81, 10, "black", "red", "idk", "idk", true, 1)
- b.menu(mname, click, 5, 81, 11, "black", "red", "idk", "idk", true, 1)
- b.menu(mname, click, 6, 81, 12, "black", "red", "idk", "idk", true, 1)
- local out = b.menudata()
- if (type(out[2]) == "number") and (out[1]) then
- maincard(out[2], out[1])
- end
- end
- sleep(1)
- local function clears()
- local oldcol = m.getBackgroundColor()
- m.setBackgroundColor(colors.cyan)
- m.clear()
- m.setBackgroundColor(oldcol)
- end
- local function basemenu()
- m.setBackgroundColor(colors.cyan)
- b.frame(mname, 3, 20, 97, 18, "black", "cyan", true)
- b.frame(mname, 80, 20, 15, 15, "black", "cyan", true)
- b.frame(mname, 80, 20, 15, 15, "white", "cyan", true)
- b.frame(mname, 81, 29, 13, 5, "red", "black", false)
- m.setCursorPos(81, 24)
- m.blit("settings", "rrrrrrrr", "eeeeeeee")
- end
- basemenu()
- topline()
- while true do
- menuButtons()
- end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement