Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- mon = peripheral.wrap("monitor_6")
- tank = peripheral.wrap("rcsteeltankvalvetile_2")
- ECell = peripheral.wrap("cofh_thermalexpansion_energycell_1")
- AESystem = peripheral.wrap("appeng_me_tilecontroller_0")
- zbiornik = false
- system = false
- energyc = false
- lava = false
- function systems()
- while system do
- drukkolorowy(AESystem.getStoredItemTypes()-1 .. " ", 24, 5, 32)
- drukkolorowy(AESystem.getUnusedBytes() .. " ", 24, 9, 32)
- drukkolorowy(AESystem.getStoredItemCount() .. " ", 24, 11, 32)
- break
- end
- while energyc do
- mon.setBackgroundColor(colors.black)
- drukkolorowy(ECell.getMaxEnergyStored("all")*100/100 .. " ", 24, 3, 32)
- drukkolorowy(ECell.getEnergyStored("all")*100/100 .. " ", 24, 5, 32)
- break
- end
- while lava do
- drukkolorowy(tankinf[1]["amount"]/1000 .. " ", 16, 5, 32)
- drukkolorowy(tankinf[1]["capacity"]/1000 .. " B", 16, 7, 32)
- break
- end
- end
- function aesystem()
- mon.clear()
- menu(0, 2)
- menu(0, 4)
- menu(0, 6)
- menu(0, 8)
- menu(0, 10)
- menu(0, 12)
- menu(22, 0)
- drukkolorowy("TOTAL ITEM TYPES", 3, 3, 8)
- drukkolorowy("STORED ITEM TYPES", 3, 5, 8)
- drukkolorowy("TOTAL BYTES", 3, 7, 8)
- drukkolorowy("USED BYTES", 3, 9, 8)
- drukkolorowy("STORED ITEM COUNT", 3, 11, 8)
- powrot = true
- system = true
- wroc()
- drukkolorowy(AESystem.getTotalBytes() .. " ", 24, 7, 32)
- drukkolorowy(AESystem.getTotalItemTypes() .. " ", 24, 3, 32)
- end
- function energys()
- mon.clear()
- drukkolorowy("MAX ENERGY STORED", 3, 3, 8)
- drukkolorowy("ENERGY STORED", 3, 5, 8)
- menu(0, 4)
- menu(0, 6)
- menu(0, 2)
- menu(22, 0)
- wroc()
- powrot = true
- energyc = true
- drukkolorowy("RF", 34, 3, 32)
- drukkolorowy("RF", 34, 5, 32)
- end
- function wroc()
- term.redirect(mon)
- local back = window.create(term.current(), 1, 25, 13, 3)
- back.setBackgroundColor(1)
- back.setTextColor(colors.black)
- back.clear()
- mon.setCursorPos(5, 26.5)
- mon.write("back")
- mon.setBackgroundColor(colors.black)
- end
- function tanks()
- mon.clear()
- --mon.setBackgroundColor(colors.black)
- mon.setTextColor(8)
- mon.setTextScale(1)
- mon.setCursorPos(3, 3)
- mon.write("TYPE")
- mon.setCursorPos(3, 5)
- mon.write("AMOUNT")
- mon.setCursorPos(3, 7)
- mon.write("CAPACITY")
- powrot = true
- lava = true
- menu(14, 0)
- menu(0, 4)
- menu(0, 6)
- menu(0, 8)
- menu(0, 2)
- wroc()
- mon.setBackgroundColor(colors.black)
- drukkolorowy(tankinf[1]["rawName"], 16, 3, 32)
- mon.setTextScale(1)
- drukkolorowy("B", 21, 5, 32)
- end
- function menu(dlugosc, wysokosc)
- mon.setTextColor(1)
- for i = 1, 80 do
- mon.setCursorPos(dlugosc, i)
- mon.write("|")
- mon.setCursorPos(i, wysokosc)
- mon.write("-")
- end
- mon.setTextColor(2)
- end
- function drukkolorowy(tekst1, x, y, color)
- mon.setCursorPos(x, y)
- mon.setTextColor(color)
- mon.write(tekst1)
- end
- function testowan()
- while true do
- systems()
- tankinf = tank.getTankInfo("unknown")
- sleep(0.05)
- end
- end
- function start1()
- powrot = false
- lava = false
- energyc = false
- system = false
- mon.setBackgroundColor(colors.black)
- mon.setTextScale(1)
- mon.clear()
- mon.clear()
- mon.clear()
- sleep(1)
- mon.clear()
- menu(14, 6)
- menu(28, 12)
- menu(42, 18)
- menu(56, 24)
- menu(70, 30)
- drukkolorowy("AE SYSTEM", 3, 3, 2)
- drukkolorowy("TANKS", 19, 3, 2)
- drukkolorowy("ENERGY STORED", 29, 3, 2)
- parallel.waitForAll(testowan, dotykz)
- end
- function dotyk(xPos1, xPos2, yPos1, yPos2, funkcja)
- event, button, xPos, yPos = os.pullEvent("monitor_touch")
- if xPos > xPos1 and xPos < xPos2 and yPos > yPos1 and yPos < yPos2 then
- funkcja()
- end
- end
- function dotykz()
- while true do
- dotyk(14, 28, 1, 6, tanks)
- dotyk(28, 42, 1, 6, energys)
- dotyk(0, 14, 1, 6, aesystem)
- while powrot == true do
- dotyk(1, 14, 24, 27, start1)
- end
- end
- end
- start1()
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement