Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- os.loadAPI("button")
- m = peripheral.wrap("top")
- m.clear()
- function fillTable()
- button.setTable("SPAWN1", test1, 2,16,4,4)
- button.setTable("SPAWN2", test2, 2,16,6,6)
- button.setTable("SPAWN3", test3, 2,16,8,8)
- button.setTable("STOP", test4, 2,16,10,10)
- button.screen()
- end
- function getClick()
- event,side,x,y = os.pullEvent("monitor_touch")
- button.checkxy(x,y)
- end
- function test1()
- button.toggleButton("SPAWN1")
- rednet.open("right")
- rednet.broadcast("SP1")
- sleep(0.1)
- rednet.broadcast(" ")
- end
- function test2()
- button.toggleButton("SPAWN2")
- rednet.open("right")
- rednet.broadcast("SP2")
- sleep(0.1)
- rednet.broadcast(" ")
- end
- function test3()
- button.toggleButton("SPAWN3")
- rednet.open("right")
- rednet.broadcast("SP3")
- sleep(0.1)
- rednet.broadcast(" ")
- end
- function test4()
- button.toggleButton("STOP")
- rednet.open("right")
- rednet.broadcast("STOP")
- sleep(0.1)
- rednet.broadcast(" ")
- end
- fillTable()
- --button.heading("Demo Button Prog")
- button.label(2,2,"Materials")
- while true do
- getClick()
- end
Advertisement
Add Comment
Please, Sign In to add comment