Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- local mon = peripheral.wrap("right")
- local net = peripheral.wrap("left")
- local cube = peripheral.wrap("mekanism_machine_1")
- local monx, mony = mon.getSize()
- os.loadAPI("bundleAPI")
- net.open(11)
- mon.clear()
- --%%%%%%%%config%%%%%%%%%--
- --Bar Position
- local barx = 1
- local bary = 19
- --%%%%%%%%%%%%%%%%%%%%%%%--
- mon.setCursorPos(1,1)
- mon.setTextColor(colors.blue)
- mon.write("Quarry: ")
- mon.setCursorPos(1,3)
- mon.write("Reaktor: ")
- mon.setCursorPos(1,5)
- mon.write("AutoReaktor: ")
- mon.setCursorPos(1,7)
- mon.write("Farm: ")
- mon.setCursorPos(1,9)
- mon.write("XP-Farm: ")
- mon.setCursorPos(1,17)
- mon.write("Energy-Status: ")
- mon.setBackgroundColor(8)
- mon.setTextColor(colors.white)
- mon.setCursorPos(1,2)
- mon.write(" <> ")
- mon.setCursorPos(1,4)
- mon.write(" <> ")
- mon.setCursorPos(1,6)
- mon.write(" <> ")
- mon.setCursorPos(1,8)
- mon.write(" <> ")
- mon.setCursorPos(1,10)
- mon.write(" <> ")
- mon.setBackgroundColor(colors.black)
- function round(num, idp)
- local mult = 10^(idp or 0)
- return math.floor(num * mult + 0.5) / mult
- end
- while true do
- Reaktor = peripheral.wrap("BigReactors-Reactor_1").getActive()
- if bundleAPI.getInput("bottom", "white") == true then --Quarry
- mon.setTextColor(colors.green)
- mon.setBackgroundColor(colors.green)
- mon.setCursorPos(17,1)
- mon.write("---")
- mon.setBackgroundColor(colors.black)
- mon.setCursorPos(14,1)
- mon.write(" AN")
- net.transmit(11,12, "Quarryan")
- elseif bundleAPI.getInput("bottom", "white") == false then
- mon.setTextColor(colors.red)
- mon.setBackgroundColor(colors.red)
- mon.setCursorPos(17,1)
- mon.write("---")
- mon.setBackgroundColor(colors.black)
- mon.setCursorPos(14,1)
- mon.write("AUS")
- net.transmit(11,13, "Quarryaus")
- end
- if Reaktor == true then
- mon.setTextColor(colors.green)
- mon.setBackgroundColor(colors.green)
- mon.setCursorPos(17,3)
- mon.write("---")
- mon.setBackgroundColor(colors.black)
- mon.setCursorPos(14,3)
- mon.write(" AN")
- net.transmit(11,14, "Reaktoran")
- elseif Reaktor == false then
- mon.setTextColor(colors.red)
- mon.setBackgroundColor(colors.red)
- mon.setCursorPos(17,3)
- mon.write("---")
- mon.setBackgroundColor(colors.black)
- mon.setCursorPos(14,3)
- mon.write("AUS")
- net.transmit(11,15, "Reaktoraus")
- end
- if bundleAPI.getInput("bottom", "green") == true then --ReaktorPC
- mon.setTextColor(colors.green)
- mon.setBackgroundColor(colors.green)
- mon.setCursorPos(17,5)
- mon.write("---")
- mon.setBackgroundColor(colors.black)
- mon.setBackgroundColor(colors.gray)
- mon.setTextColor(colors.white)
- mon.setCursorPos(1,4)
- mon.write(" <> ")
- mon.setBackgroundColor(colors.black)
- mon.setTextColor(colors.green)
- mon.setCursorPos(14,5)
- mon.write(" AN")
- net.transmit(11,16, "Reaktorpcan")
- elseif bundleAPI.getInput("bottom", "green") == false then
- mon.setTextColor(colors.red)
- mon.setBackgroundColor(colors.red)
- mon.setCursorPos(17,5)
- mon.write("---")
- mon.setBackgroundColor(colors.black)
- mon.setBackgroundColor(8)
- mon.setTextColor(colors.white)
- mon.setCursorPos(1,4)
- mon.write(" <> ")
- mon.setBackgroundColor(colors.black)
- mon.setTextColor(colors.red)
- mon.setCursorPos(14,5)
- mon.write("AUS")
- net.transmit(11,17, "Reaktorpcaus")
- end
- if bundleAPI.getInput("bottom", "blue") == true then --Quarry
- mon.setTextColor(colors.green)
- mon.setBackgroundColor(colors.green)
- mon.setCursorPos(17,7)
- mon.write("---")
- mon.setBackgroundColor(colors.black)
- mon.setCursorPos(14,7)
- mon.write(" AN")
- net.transmit(11,18, "Farman")
- elseif bundleAPI.getInput("bottom", "blue") == false then
- mon.setTextColor(colors.red)
- mon.setBackgroundColor(colors.red)
- mon.setCursorPos(17,7)
- mon.write("---")
- mon.setBackgroundColor(colors.black)
- mon.setCursorPos(14,7)
- mon.write("AUS")
- net.transmit(11,19, "Farmaus")
- end
- if bundleAPI.getInput("bottom", "red") == true then --Quarry
- mon.setTextColor(colors.green)
- mon.setBackgroundColor(colors.green)
- mon.setCursorPos(17,9)
- mon.write("---")
- mon.setBackgroundColor(colors.black)
- mon.setCursorPos(14,9)
- mon.write(" AN")
- net.transmit(11,20, "Xpfarman")
- elseif bundleAPI.getInput("bottom", "red") == false then
- mon.setTextColor(colors.red)
- mon.setBackgroundColor(colors.red)
- mon.setCursorPos(17,9)
- mon.write("---")
- mon.setBackgroundColor(colors.black)
- mon.setCursorPos(14,9)
- mon.write("AUS")
- net.transmit(11,21, "Xpfarmaus")
- end
- --%%%%%%%%%%%%%%%%%%%%%%%%--
- a = cube.getEnergyStored()
- b = cube.getMaxEnergy()
- c = a/b*100
- monx, mony = mon.getSize()
- length = monx/10
- if c > 0 and c <= 10 then
- mon.setCursorPos(1,bary)
- mon.setBackgroundColor(colors.red)
- mon.write(string.rep(" ", 1*length))
- mon.setCursorPos(length,bary)
- mon.setBackgroundColor(colors.black)
- mon.write(string.rep(" ", monx-1*length))
- end
- if c > 10 and c <= 20 then
- mon.setCursorPos(1,bary)
- mon.setBackgroundColor(colors.red)
- mon.write(string.rep(" ", 2*length))
- mon.setCursorPos(2*length,bary)
- mon.setBackgroundColor(colors.black)
- mon.write(string.rep(" ", monx-2*length))
- end
- if c > 20 and c <= 30 then
- mon.setCursorPos(1,bary)
- mon.setBackgroundColor(colors.orange)
- mon.write(string.rep(" ", 3*length))
- mon.setCursorPos(3*length,bary)
- mon.setBackgroundColor(colors.black)
- mon.write(string.rep(" ", monx-3*length))
- end
- if c > 30 and c <= 40 then
- mon.setCursorPos(1,bary)
- mon.setBackgroundColor(colors.orange)
- mon.write(string.rep(" ", 4*length))
- mon.setCursorPos(4*length,bary)
- mon.setBackgroundColor(colors.black)
- mon.write(string.rep(" ", monx-4*length))
- end
- if c > 40 and c <= 50 then
- mon.setCursorPos(1,bary)
- mon.setBackgroundColor(colors.orange)
- mon.write(string.rep(" ", 5*length))
- mon.setCursorPos(5*length,bary)
- mon.setBackgroundColor(colors.black)
- mon.write(string.rep(" ", monx-5*length))
- end
- if c > 50 and c <= 60 then
- mon.setCursorPos(1,bary)
- mon.setBackgroundColor(colors.lime)
- mon.write(string.rep(" ", 6*length))
- mon.setCursorPos(6*length,bary)
- mon.setBackgroundColor(colors.black)
- mon.write(string.rep(" ", monx-6*length))
- end
- if c > 60 and c <= 70 then
- mon.setCursorPos(1,bary)
- mon.setBackgroundColor(colors.lime)
- mon.write(string.rep(" ", 7*length))
- mon.setCursorPos(7*length,bary)
- mon.setBackgroundColor(colors.black)
- mon.write(string.rep(" ", monx-7*length))
- end
- if c > 70 and c <= 80 then
- mon.setCursorPos(1,bary)
- mon.setBackgroundColor(colors.lime)
- mon.write(string.rep(" ", 8*length))
- mon.setCursorPos(8*length,bary)
- mon.setBackgroundColor(colors.black)
- mon.write(string.rep(" ", monx-8*length))
- end
- if c > 80 and c <= 90 then
- mon.setCursorPos(1,bary)
- mon.setBackgroundColor(colors.lime)
- mon.write(string.rep(" ", 9*length))
- mon.setCursorPos(9*length,bary)
- mon.setBackgroundColor(colors.black)
- mon.write(string.rep(" ", monx-9*length))
- end
- if c > 90 and c <= 100 then
- mon.setCursorPos(1,bary)
- mon.setBackgroundColor(colors.lime)
- mon.write(string.rep(" ", 10*length))
- mon.setBackgroundColor(colors.black)
- end
- if c >= 0 and c <=33.99 then
- mon.setTextColor(colors.red)
- elseif c>=34 and c<= 66.99 then
- mon.setTextColor(colors.orange)
- elseif c>= 67 and c<= 100 then
- mon.setTextColor(colors.lime)
- end
- mon.setCursorPos(7,bary-1)
- mon.write(round(c, 2))
- mon.setCursorPos(13,bary-1)
- mon.write("%")
- net.transmit(11,22,c)
- mon.setBackgroundColor(colors.black)
- sleep(0.5)
- end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement