Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- term.clear()
- m = peripheral.wrap("back")
- xB1 = 1
- xB2 = 1
- m.setTextScale(1)
- m.setBackgroundColor(colors.red)
- function Reactor1()
- m.setCursorPos(2,4)
- m.write(" ")
- m.setCursorPos(2,5)
- m.write(" ")
- m.setCursorPos(2,6)
- m.write(" ")
- m.setCursorPos(2,7)
- m.write(" ")
- m.setCursorPos(2,8)
- m.write(" ")
- m.setCursorPos(2,9)
- m.write(" ")
- m.setTextColor(colors.white)
- m.setCursorPos(4,6)
- m.write("Reactor")
- m.setCursorPos(4,7)
- m.write(" 1 ")
- end
- function Reactor2()
- m.setCursorPos(18,4)
- m.write(" ")
- m.setCursorPos(18,5)
- m.write(" ")
- m.setCursorPos(18,6)
- m.write(" ")
- m.setCursorPos(18,7)
- m.write(" ")
- m.setCursorPos(18,8)
- m.write(" ")
- m.setCursorPos(18,9)
- m.write(" ")
- m.setTextColor(colors.white)
- m.setCursorPos(20,6)
- m.write("Reactor")
- m.setCursorPos(20,7)
- m.write(" 2 ")
- end
- while true do
- local cn = peripheral.getNames()
- local energy = {}
- print("h")
- for k,v in pairs(cn) do
- if peripheral.getType(v) == "BigReactors-Reactor" then
- local r = peripheral.wrap(v)
- energy[k] = r.getMaxEnergyStored()
- print("i")
- end
- end
- local u = 0
- print(reactor," / hi")
- for k,v in pairs(energy) do
- x,x,a,b = os.pullEvent("monitor_touch")
- print(u)
- if u == 0 then
- Reactor1()
- --Reactor1
- if a > 1 then
- if a < 13 then
- if b > 3 then
- if b < 10 then
- if xB1== 0 then
- xB1 = 1
- m.setBackgroundColor(colors.red)
- else
- xB1 = 0
- m.setBackgroundColor(colors.green)
- rs.setOutput("right", true)
- end
- Reactor1()
- end
- end
- end
- end
- elseif u == 1 then
- Reactor2()
- --Reactor2
- if a > 17 then
- if a < 29 then
- if b > 3 then
- if b < 10 then
- if xB2== 0 then
- xB2 = 1
- m.setBackgroundColor(colors.red)
- rs.setOutput("left", false)
- else
- xB2 = 0
- m.setBackgroundColor(colors.green)
- rs.setOutput("left", true)
- end
- Reactor2()
- end
- end
- end
- end
- end
- end
- end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement