SHOW:
|
|
- or go back to the newest paste.
| 1 | os.loadAPI("button")
| |
| 2 | - | m = peripheral.wrap("top")
|
| 2 | + | m = peripheral.wrap("left")
|
| 3 | m.clear() | |
| 4 | ||
| 5 | function fillTable() | |
| 6 | - | button.setTable("Thaumium", test1, 2,16,4,4)
|
| 6 | + | button.setTable("UP", test1, 2,10,4,4)
|
| 7 | - | button.setTable("Nitor", test2, 2,16,6,6)
|
| 7 | + | button.setTable("DOWN", test2, 2,10,6,6)
|
| 8 | - | button.setTable("Alumentum", test3, 2,16,8,8)
|
| 8 | + | button.setTable("LEFT", test3, 2,10,8,8)
|
| 9 | - | button.setTable("Tallow", test4, 2,16,10,10)
|
| 9 | + | button.setTable("RIGHT", test4, 2,10,10,10)
|
| 10 | button.setTable("MINE x1", test5, 2,12,14,14)
| |
| 11 | button.setTable("MINE x10", test6, 2,12,16,16)
| |
| 12 | button.screen() | |
| 13 | end | |
| 14 | ||
| 15 | function getClick() | |
| 16 | event,side,x,y = os.pullEvent("monitor_touch")
| |
| 17 | button.checkxy(x,y) | |
| 18 | end | |
| 19 | - | button.toggleButton("Thaumium")
|
| 19 | + | |
| 20 | - | print("1")
|
| 20 | + | |
| 21 | button.toggleButton("UP")
| |
| 22 | rs.setBundledOutput("top", colors.blue)
| |
| 23 | sleep(0.2) | |
| 24 | - | button.toggleButton("Nitor")
|
| 24 | + | rs.setBundledOutput("top", 0)
|
| 25 | - | print("2")
|
| 25 | + | sleep(0.2) |
| 26 | end | |
| 27 | ||
| 28 | function test2() | |
| 29 | - | button.toggleButton("Alumentum")
|
| 29 | + | button.toggleButton("DOWN")
|
| 30 | - | print("3")
|
| 30 | + | rs.setBundledOutput("top", colors.green)
|
| 31 | sleep(0.2) | |
| 32 | rs.setBundledOutput("top", 0)
| |
| 33 | sleep(0.2) | |
| 34 | - | button.toggleButton("Tallow")
|
| 34 | + | |
| 35 | - | print("4")
|
| 35 | + | |
| 36 | function test3() | |
| 37 | button.toggleButton("LEFT")
| |
| 38 | rs.setBundledOutput("top", colors.purple)
| |
| 39 | - | --button.heading("Demo Button Prog")
|
| 39 | + | sleep(0.2) |
| 40 | - | button.label(2,2,"Materials") |
| 40 | + | rs.setBundledOutput("top", 0)
|
| 41 | sleep(0.2) | |
| 42 | end | |
| 43 | ||
| 44 | function test4() | |
| 45 | button.toggleButton("RIGHT")
| |
| 46 | rs.setBundledOutput("top", colors.cyan)
| |
| 47 | sleep(0.2) | |
| 48 | rs.setBundledOutput("top", 0)
| |
| 49 | sleep(0.2) | |
| 50 | end | |
| 51 | ||
| 52 | function test5() | |
| 53 | button.toggleButton("MINE x1")
| |
| 54 | rs.setBundledOutput("top", colors.yellow)
| |
| 55 | sleep(0.2) | |
| 56 | rs.setBundledOutput("top", 0)
| |
| 57 | sleep(0.2) | |
| 58 | end | |
| 59 | ||
| 60 | ||
| 61 | fillTable() | |
| 62 | ||
| 63 | while true do | |
| 64 | getClick() | |
| 65 | end |