Advertisement
SolidSnake96AS

EngineActivator - Controller

Sep 3rd, 2013
199
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Lua 1.61 KB | None | 0 0
  1. os.loadAPI("button")
  2.  
  3. local i,ended
  4. local rs_in={}
  5.  
  6. rednet.open("left")
  7.  
  8. local function But1()
  9.     rs_in[1]=not rs_in[1]
  10.    
  11.     rednet.send(34,tostring(rs_in[1]))
  12. end
  13.  
  14. local function But2()
  15.     rs_in[2]=not rs_in[2]
  16.    
  17.     rednet.send(33,tostring(rs_in[2]))
  18. end
  19.  
  20. local function But3()
  21.     rs_in[3]=not rs_in[3]
  22.    
  23.     rednet.send(32,tostring(rs_in[3]))
  24. end
  25.  
  26. local function But4()
  27.     rs_in[4]=not rs_in[4]
  28.    
  29.     rednet.send(31,tostring(rs_in[4]))
  30. end
  31.  
  32. local function But5()
  33.     rs_in[5]=not rs_in[5]
  34.    
  35.     rednet.send(27,tostring(rs_in[5]))
  36. end
  37.  
  38. local function But6()
  39.     rs_in[6]=not rs_in[6]
  40.    
  41.     rednet.send(28,tostring(rs_in[6]))
  42. end
  43.  
  44. local function But7()
  45.     rs_in[7]=not rs_in[7]
  46.    
  47.     rednet.send(29,tostring(rs_in[7]))
  48. end
  49.  
  50. local function But8()
  51.     rs_in[8]=not rs_in[8]
  52.    
  53.     rednet.send(30,tostring(rs_in[8]))
  54. end
  55.  
  56. local function End()
  57.   ended=true
  58. end
  59.  
  60. for i=1, 8
  61. do
  62.   rs_in[i]=false
  63. end
  64.  
  65. button.setTable("Engine 1", But1, 4,14,3,5, true)
  66. button.setTable("Engine 2", But2, 4,14,7,9, true)
  67. button.setTable("Engine 3", But3, 4,14,11,13, true)
  68. button.setTable("Engine 4", But4, 4,14,15,17, true)
  69.  
  70. button.setTable("Engine 5", But5, 17,27,3,5, true)
  71. button.setTable("Engine 6", But6, 17,27,7,9, true)
  72. button.setTable("Engine 7", But7, 17,27,11,13, true)
  73. button.setTable("Engine 8", But8, 17,27,15,17, true)
  74.  
  75. button.setTable("X", End, 27,29,18,20, false)
  76.  
  77. while(true)
  78. do
  79.   button.heading("Program")
  80.   button.screen()
  81.  
  82.   local event, side, x, y= os.pullEvent("monitor_touch")
  83.  
  84.   button.checkxy(x,y)
  85.  
  86.   if (ended)
  87.   then
  88.     button.stop()
  89.     return
  90.   end
  91. end
  92.  
  93. --script by SolidSnake96AS
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement