Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- os.loadAPI("button")
- mon = peripheral.wrap("top")
- mon.clear()
- function createButtons()
- button.setTable("Fuel", fuel, 2,17,1,3)
- button.setTable("Charcoal", char, 2,17,5,7)
- button.setTable("Lava", lava, 2,17,9,11)
- button.setTable("Redstone", rstone, 2,17,13,15)
- button.setTable("Ender Pearl", ender, 2,17,17,19)
- button.screen()
- end
- function getClick()
- event,side,x,y = os.pullEvent("monitor_touch")
- button.checkxy(x,y)
- end
- function fuel()
- button.toggleButton("Fuel")
- if redstone.getOutput("left") then
- redstone.setOutput("left", false)
- else
- redstone.setOutput("left", true)
- end
- end
- function char()
- button.toggleButton("Charcoal")
- if redstone.getOutput("back") then
- redstone.setOutput("back", false)
- else
- redstone.setOutput("back", true)
- end
- end
- function lava()
- button.toggleButton("Lava")
- if redstone.getOutput("right") then
- redstone.setOutput("right", false)
- else
- redstone.setOutput("right", true)
- end
- end
- function rstone()
- button.toggleButton("Redstone")
- if redstone.getOutput("bottom") then
- redstone.setOutput("bottom", false)
- else
- redstone.setOutput("bottom", true)
- end
- end
- function ender()
- button.toggleButton("Ender Pearl")
- if redstone.getOutput("front") then
- redstone.setOutput("front", false)
- else
- redstone.setOutput("front", true)
- end
- end
- createButtons()
- while true do
- getClick()
- end
Add Comment
Please, Sign In to add comment