Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- os.loadAPI("button")
- m = peripheral.wrap("left")
- m.clear()
- function fillTable()
- button.setTable("UP", test1, 2,10,4,4)
- button.setTable("DOWN", test2, 2,10,6,6)
- button.setTable("LEFT", test3, 2,10,8,8)
- button.setTable("RIGHT", test4, 2,10,10,10)
- button.setTable("MINE x1", test5, 2,12,14,14)
- button.setTable("MINE x10", test6, 2,12,16,16)
- button.screen()
- end
- function getClick()
- event,side,x,y = os.pullEvent("monitor_touch")
- button.checkxy(x,y)
- end
- function test1()
- button.toggleButton("UP")
- rs.setBundledOutput("top", colors.blue)
- sleep(0.2)
- rs.setBundledOutput("top", 0)
- sleep(0.2)
- end
- function test2()
- button.toggleButton("DOWN")
- rs.setBundledOutput("top", colors.green)
- sleep(0.2)
- rs.setBundledOutput("top", 0)
- sleep(0.2)
- end
- function test3()
- button.toggleButton("LEFT")
- rs.setBundledOutput("top", colors.purple)
- sleep(0.2)
- rs.setBundledOutput("top", 0)
- sleep(0.2)
- end
- function test4()
- button.toggleButton("RIGHT")
- rs.setBundledOutput("top", colors.cyan)
- sleep(0.2)
- rs.setBundledOutput("top", 0)
- sleep(0.2)
- end
- function test5()
- button.toggleButton("MINE x1")
- rs.setBundledOutput("top", colors.yellow)
- sleep(0.2)
- rs.setBundledOutput("top", 0)
- sleep(0.2)
- end
- fillTable()
- while true do
- getClick()
- end
Advertisement
Add Comment
Please, Sign In to add comment