xavierlebel

mine

Mar 4th, 2014
113
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. os.loadAPI("button")
  2. m = peripheral.wrap("left")
  3. m.clear()
  4.  
  5. function fillTable()
  6.    button.setTable("UP", test1, 2,10,4,4)
  7.    button.setTable("DOWN", test2, 2,10,6,6)
  8.    button.setTable("LEFT", test3, 2,10,8,8)
  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.  
  20. function test1()
  21.    button.toggleButton("UP")
  22.    rs.setBundledOutput("top", colors.blue)
  23.    sleep(0.2)
  24.    rs.setBundledOutput("top", 0)
  25.    sleep(0.2)
  26. end
  27.  
  28. function test2()
  29.    button.toggleButton("DOWN")
  30.    rs.setBundledOutput("top", colors.green)
  31.    sleep(0.2)
  32.    rs.setBundledOutput("top", 0)
  33.    sleep(0.2)
  34. end
  35.  
  36. function test3()
  37.    button.toggleButton("LEFT")
  38.    rs.setBundledOutput("top", colors.purple)
  39.    sleep(0.2)
  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
Advertisement
Add Comment
Please, Sign In to add comment