Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- os.loadAPI("button")
- m = peripheral.wrap("monitor_2")
- p = peripheral.wrap("back")
- bank = peripheral.wrap("blockcapacitorbank_3")
- m.clear()
- energy = bank.getEnergyStored("left")
- mj = bank.getMJStored("left")
- mjmax = bank.getMaxMJReceived("left")
- function fillTable()
- button.setTable("Refuel",refuel,3,17,1,3)
- button.setTable("Cancel",cancel,3,17,5,7)
- button.screen()
- end
- function getClick()
- event,side,x,y = os.pullEvent("monitor_touch")
- button.checkxy(x, y)
- end
- function pulse()
- redstone.setOutput("back", true)
- end
- function pulse1()
- redstone.setOutput("back", true)
- sleep(0,5)
- redstone.setOutput("back", false)
- end
- function refuel()
- button.toggleButton("Refuel")
- p.setFreq(301)
- pulse1()
- end
- function cancel()
- button.toggleButton("Cancel")
- p.setFreq(302)
- pulse1()
- end
- fillTable()
- while true do
- getClick()
- m.setTextColor(colors.white)
- m.write("POWER MANAGEMENT V3")
- m.setCursorPos(1,3)
- m.write("RF:" ..energy)
- m.setCursorPos(1,5)
- end
Advertisement
Add Comment
Please, Sign In to add comment