ROMVoid

rom

Jun 1st, 2019
82
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 21.86 KB | None | 0 0
  1. local component = require("component")
  2. local event = require("event")
  3. local serialization= require("serialization")
  4. local computer= require("computer")
  5. local modem = component.modem
  6. modem.open(2412)
  7. modem.broadcast(2412,"r= component.proxy(component.list('radar')())")
  8. modem.broadcast(2412,"n= component.proxy(component.list('navigation')())")
  9. modem.broadcast(2412,"d= component.proxy(component.list('drone')())")
  10. modem.broadcast(2412,"function sleep(timeout) checkArg(1, timeout, 'number', 'nil') local deadline = computer.uptime() + (timeout or 0) repeat computer.pullSignal(deadline - computer.uptime()) until computer.uptime() >= deadline end")
  11.  
  12. local function sleep(timeout) checkArg(1, timeout, "number", "nil") local deadline = computer.uptime() + (timeout or 0) repeat computer.pullSignal(deadline - computer.uptime()) until computer.uptime() >= deadline end
  13.  
  14. while true do
  15. local cmd=io.read()
  16. if not cmd then return end
  17.  
  18. if cmd=="ALLFLW" then -- # all follow
  19. print("Target: ") tag=io.read()
  20. repeat
  21. local cmd=select(1,event.pull(1))
  22. modem.broadcast(2412,"for k, v in ipairs(r.getEntities()) do if v.name== '" ..tag.. "' then x= v.x + math.random(-3,3) y=v.y + math.random(-3,3) z=v.z + math.random(-3,3) d.move(x,y,z) end end") sleep(0.5)
  23. until cmd=="key_down"
  24. end
  25.  
  26. if cmd=="FLW" then -- # specific drone
  27. print("Target: ") tag=io.read()
  28. print("Drone No.: ") srm=io.read()
  29. repeat
  30. local cmd=select(1,event.pull(1))
  31. modem.broadcast(2412,"for k, v in ipairs(r.getEntities()) do if v.name== '" ..tag.. "' and d.name()== '"..srm.."' then x= v.x + math.random(-3,3) y=v.y + math.random(-3,3) z=v.z + math.random(-3,3) d.move(x,y,z) end end") sleep(0.5)
  32. until cmd=="key_down"
  33. end
  34.  
  35. if cmd=="ALLMOV" then --# all move
  36. print("x: ") x=io.read()
  37. print("y: ") y=io.read()
  38. print("z: ") z=io.read()
  39. modem.broadcast(2412," d.move("..x..","..y..","..z..")")
  40. end
  41.  
  42. if cmd=="MOV" then --# specific drone
  43. print("Drone No.: ") srm=io.read()
  44. print("x: ") x=io.read()
  45. print("y: ") y=io.read()
  46. print("z: ") z=io.read()
  47. modem.broadcast(2412,"if d.name()== '"..srm.."' then d.move("..x..","..y..","..z..") end")
  48. end
  49.  
  50. if cmd=="STK" then -- # stalk
  51. print("Target: ") tag=io.read()
  52. print("Drone No.: ") srm=io.read()
  53. repeat
  54. local cmd=select(1,event.pull(1))
  55. modem.broadcast(2412,"for k, v in ipairs(r.getEntities()) do if v.name== '"..tag.. "' and d.name()== '"..srm.."' then x= v.x + 15*((math.random(1,2)*2)-3) y=v.y + 15 z=v.z + 15*((math.random(1,2)*2)-3) d.move(x,y,z) sleep(0.5) end end")
  56. until cmd=="key_down"
  57. end
  58.  
  59. if cmd=="GOTO" then --# converge at target position
  60. print("Target: ") tag=io.read()
  61. print("Drone No.: ") srm=io.read()
  62. modem.broadcast(2412,"for k, v in ipairs(r.getEntities()) do if v.name== '" ..tag.. "' and d.name()== '"..srm.. "' then d.move(v.x,v.y,v.z) end end")
  63. end
  64.  
  65. if cmd=="ALLGOTO" then -- # all converge at target position
  66. print("Target: ") tag=io.read()
  67. modem.broadcast(2412,"for k, v in ipairs(r.getEntities()) do if v.name== '" ..tag.. "' then d.move(v.x,v.y,v.z) end end")
  68. end
  69.  
  70. if cmd=="SET8" then --# make 8 drones from swarm converge at target position, used to set up shield and other stuff that I have yet to think about.
  71. print("Target: ") tag=io.read()
  72. t={1,2,3,4,5,6,7,8,9,10,11,12,13,14}
  73. local n = #t
  74. while n >= 2 do
  75. local k = math.random(n) t[n], t[k] = t[k], t[n] n = n - 1
  76. end
  77. modem.broadcast(2412,"for k, v in ipairs(r.getEntities()) do if v.name=='"..tag.."' and d.name()== '"..t[1].."' then d.move(v.x,v.y,v.z) end end") sleep(0.5)
  78. modem.broadcast(2412,"for k, v in ipairs(r.getEntities()) do if v.name=='"..tag.."' and d.name()== '"..t[2].."' then d.move(v.x,v.y,v.z) end end") sleep(0.5)
  79. modem.broadcast(2412,"for k, v in ipairs(r.getEntities()) do if v.name=='"..tag.."' and d.name()== '"..t[3].."' then d.move(v.x,v.y,v.z) end end") sleep(0.5)
  80. modem.broadcast(2412,"for k, v in ipairs(r.getEntities()) do if v.name=='"..tag.."' and d.name()== '"..t[4].."' then d.move(v.x,v.y,v.z) end end") sleep(0.5)
  81. modem.broadcast(2412,"for k, v in ipairs(r.getEntities()) do if v.name=='"..tag.."' and d.name()== '"..t[5].."' then d.move(v.x,v.y,v.z) end end") sleep(0.5)
  82. modem.broadcast(2412,"for k, v in ipairs(r.getEntities()) do if v.name=='"..tag.."' and d.name()== '"..t[6].."' then d.move(v.x,v.y,v.z) end end") sleep(0.5)
  83. modem.broadcast(2412,"for k, v in ipairs(r.getEntities()) do if v.name=='"..tag.."' and d.name()== '"..t[7].."' then d.move(v.x,v.y,v.z) end end") sleep(0.5)
  84. modem.broadcast(2412,"for k, v in ipairs(r.getEntities()) do if v.name=='"..tag.."' and d.name()== '"..t[8].."' then d.move(v.x,v.y,v.z) end end") sleep(0.5)
  85.  
  86. while true do
  87.  
  88. print("What Is Thy Bidding?") bid=io.read()
  89. if bid=="X" then --# use this to adjust drone alignment
  90. modem.broadcast(2412,"for k, v in ipairs(r.getEntities()) do if v.name=='"..tag.."' and d.name()== '"..t[1].."' then d.move(v.x,v.y,v.z) end end") sleep(0.5)
  91. modem.broadcast(2412,"for k, v in ipairs(r.getEntities()) do if v.name=='"..tag.."' and d.name()== '"..t[2].."' then d.move(v.x,v.y,v.z) end end") sleep(0.5)
  92. modem.broadcast(2412,"for k, v in ipairs(r.getEntities()) do if v.name=='"..tag.."' and d.name()== '"..t[3].."' then d.move(v.x,v.y,v.z) end end") sleep(0.5)
  93. modem.broadcast(2412,"for k, v in ipairs(r.getEntities()) do if v.name=='"..tag.."' and d.name()== '"..t[4].."' then d.move(v.x,v.y,v.z) end end") sleep(0.5)
  94. modem.broadcast(2412,"for k, v in ipairs(r.getEntities()) do if v.name=='"..tag.."' and d.name()== '"..t[5].."' then d.move(v.x,v.y,v.z) end end") sleep(0.5)
  95. modem.broadcast(2412,"for k, v in ipairs(r.getEntities()) do if v.name=='"..tag.."' and d.name()== '"..t[6].."' then d.move(v.x,v.y,v.z) end end") sleep(0.5)
  96. modem.broadcast(2412,"for k, v in ipairs(r.getEntities()) do if v.name=='"..tag.."' and d.name()== '"..t[7].."' then d.move(v.x,v.y,v.z) end end") sleep(0.5)
  97. modem.broadcast(2412,"for k, v in ipairs(r.getEntities()) do if v.name=='"..tag.."' and d.name()== '"..t[8].."' then d.move(v.x,v.y,v.z) end end") sleep(0.5)
  98. end
  99.  
  100. if bid=="OK" then
  101. break
  102. end
  103.  
  104. if bid=="PORTAFORT" then--# builds a simple 5X2X5 wall (complete with small entrances/exits) around the set center with any block in the drones inventory slot 1, you need atleast 30 blocks (that's atleast 4 for each drone (technically 2 of them only need 3 blocks but you don't need to bother with that))
  105. modem.broadcast(2412,"if d.name()== '"..t[1].."' then d.move(2,2,0) end") sleep(0.5)
  106. modem.broadcast(2412,"if d.name()== '"..t[1].."' then repeat local dis=select(2, d.detect(0)) d.move(0,-1,0) until dis=='solid' d.move(0,5,0) sleep(0.00005) d.select(1) sleep(0.00005) d.place(0) sleep(0.00005) d.move(0,0,1) sleep(0.00005) d.place(0) sleep(0.00005) d.move(0,1,0) sleep(0.00005) d.place(0) sleep(0.00005) d.move(0,0,-1) sleep(0.00005) d.place(0) end") sleep(0.5)
  107.  
  108. modem.broadcast(2412,"if d.name()== '"..t[2].."' then d.move(2,2,-2) end") sleep(0.5)
  109. modem.broadcast(2412,"if d.name()== '"..t[2].."' then repeat local dis=select(2, d.detect(0)) d.move(0,-1,0) until dis=='solid' d.move(0,5,0) sleep(0.00005) d.select(1) sleep(0.00005) d.place(0) sleep(0.00005) d.move(0,0,1) sleep(0.00005) d.place(0) sleep(0.00005) d.move(0,1,0) sleep(0.00005) d.place(0) sleep(0.00005) d.move(0,0,-1) sleep(0.00005) d.place(0) end") sleep(3)
  110.  
  111. modem.broadcast(2412,"if d.name()== '"..t[6].."' then d.move(-2,2,2) end") sleep(0.5)
  112. modem.broadcast(2412,"if d.name()== '"..t[6].."' then repeat local dis=select(2, d.detect(0)) d.move(0,-1,0) until dis=='solid' d.move(0,5,0) sleep(0.00005) d.select(1) sleep(0.00005) d.place(0) sleep(0.00005) d.move(0,0,-1) sleep(0.00005) d.place(0) sleep(0.00005) d.move(0,1,0) sleep(0.00005) d.place(0) sleep(0.00005) d.move(0,0,1) sleep(0.00005) d.place(0) end") sleep(0.5)
  113.  
  114. modem.broadcast(2412,"if d.name()== '"..t[4].."' then d.move(-2,2,0) end") sleep(0.5)
  115. modem.broadcast(2412,"if d.name()== '"..t[4].."' then repeat local dis=select(2, d.detect(0)) d.move(0,-1,0) until dis=='solid' d.move(0,5,0) sleep(0.00005) d.select(1) sleep(0.00005) d.place(0) sleep(0.00005) d.move(0,0,-1) sleep(0.00005) d.place(0) sleep(0.00005) d.move(0,1,0) sleep(0.00005) d.place(0) sleep(0.00005) d.move(0,0,1) sleep(0.005) d.place(0) end") sleep(4)
  116.  
  117. modem.broadcast(2412,"if d.name()== '"..t[3].."' then d.move(2,2,2) end") sleep(0.5)
  118. modem.broadcast(2412,"if d.name()== '"..t[3].."' then repeat local dis=select(2, d.detect(0)) d.move(0,-1,0) until dis=='solid' d.move(0,5,0) sleep(0.00005) d.select(1) sleep(0.00005) d.place(0) sleep(0.00005) d.move(-1,0,0) sleep(0.3) d.place(0) sleep(0.00005) d.move(0,1,0) sleep(0.00005) d.move(1,0,0) sleep(0.3) d.place(0) end") sleep(0.5)
  119.  
  120. modem.broadcast(2412,"if d.name()== '"..t[5].."' then d.move(-2,2,-2) end") sleep(0.5)
  121. modem.broadcast(2412,"if d.name()== '"..t[5].."' then repeat local dis=select(2, d.detect(0)) d.move(0,-1,0) until dis=='solid' d.move(0,5,0) sleep(0.00005) d.select(1) sleep(0.00005) d.place(0) sleep(0.00005) d.move(1,0,0) sleep(0.3) d.place(0) sleep(0.00005) d.move(0,1,0) sleep(0.00005) d.move(-1,0,0) sleep(0.3) d.place(0) end") sleep(3)
  122.  
  123. modem.broadcast(2412,"if d.name()== '"..t[7].."' then d.move(0,2,-2) end") sleep(0.5)
  124. modem.broadcast(2412,"if d.name()== '"..t[7].."' then repeat local dis=select(2, d.detect(0)) d.move(0,-1,0) until dis=='solid' d.move(0,5,0) sleep(0.00005) d.select(1) sleep(0.00005) d.place(0) sleep(0.00005) d.move(1,0,0) sleep(0.2) d.place(0) sleep(0.00005) d.move(0,1,0) sleep(0.2) d.place(0) sleep(0.00005) d.move(-1,0,0) sleep(0.2) d.place(0) end") sleep(0.5)
  125.  
  126. modem.broadcast(2412,"if d.name()== '"..t[8].."' then d.move(0,2,2) end") sleep(0.5)
  127. modem.broadcast(2412,"if d.name()== '"..t[8].."' then repeat local dis=select(2, d.detect(0)) d.move(0,-1,0) until dis=='solid' d.move(0,5,0) sleep(0.00005) d.select(1) sleep(0.00005) d.place(0) sleep(0.00005) d.move(-1,0,0) sleep(0.2) d.place(0) sleep(0.00005) d.move(0,1,0) sleep(0.2) d.place(0) sleep(0.00005) d.move(1,0,0) sleep(0.2) d.place(0) end") sleep(0.5)
  128. end
  129.  
  130. end
  131. end
  132.  
  133. if cmd=="SET9" then --# make 9 drones from swarm converge at target position, used to set up carpet bombing and other stuff that I have yet to think about.
  134. print("Target: ") tag=io.read()
  135. t={1,2,3,4,5,6,7,8,9,10,11,12,13,14}
  136. local n = #t
  137. while n >= 2 do
  138. local k = math.random(n) t[n], t[k] = t[k], t[n] n = n - 1
  139. end
  140. modem.broadcast(2412,"for k, v in ipairs(r.getEntities()) do if v.name=='"..tag.."' and d.name()== '"..t[1].."' then d.move(v.x,v.y,v.z) end end") sleep(0.5)
  141. modem.broadcast(2412,"for k, v in ipairs(r.getEntities()) do if v.name=='"..tag.."' and d.name()== '"..t[2].."' then d.move(v.x,v.y,v.z) end end") sleep(0.5)
  142. modem.broadcast(2412,"for k, v in ipairs(r.getEntities()) do if v.name=='"..tag.."' and d.name()== '"..t[3].."' then d.move(v.x,v.y,v.z) end end") sleep(0.5)
  143. modem.broadcast(2412,"for k, v in ipairs(r.getEntities()) do if v.name=='"..tag.."' and d.name()== '"..t[4].."' then d.move(v.x,v.y,v.z) end end") sleep(0.5)
  144. modem.broadcast(2412,"for k, v in ipairs(r.getEntities()) do if v.name=='"..tag.."' and d.name()== '"..t[5].."' then d.move(v.x,v.y,v.z) end end") sleep(0.5)
  145. modem.broadcast(2412,"for k, v in ipairs(r.getEntities()) do if v.name=='"..tag.."' and d.name()== '"..t[6].."' then d.move(v.x,v.y,v.z) end end") sleep(0.5)
  146. modem.broadcast(2412,"for k, v in ipairs(r.getEntities()) do if v.name=='"..tag.."' and d.name()== '"..t[7].."' then d.move(v.x,v.y,v.z) end end") sleep(0.5)
  147. modem.broadcast(2412,"for k, v in ipairs(r.getEntities()) do if v.name=='"..tag.."' and d.name()== '"..t[8].."' then d.move(v.x,v.y,v.z) end end") sleep(0.5)
  148. modem.broadcast(2412,"for k, v in ipairs(r.getEntities()) do if v.name=='"..tag.."' and d.name()== '"..t[9].."' then d.move(v.x,v.y,v.z) end end") sleep(0.5)
  149.  
  150. while true do
  151. print("What Is Thy Bidding?") bid=io.read()
  152. if bid=="X" then --# use this to adjust drone alignment
  153. modem.broadcast(2412,"for k, v in ipairs(r.getEntities()) do if v.name=='"..tag.."' and d.name()== '"..t[1].."' then d.move(v.x,v.y,v.z) end end") sleep(0.5)
  154. modem.broadcast(2412,"for k, v in ipairs(r.getEntities()) do if v.name=='"..tag.."' and d.name()== '"..t[2].."' then d.move(v.x,v.y,v.z) end end") sleep(0.5)
  155. modem.broadcast(2412,"for k, v in ipairs(r.getEntities()) do if v.name=='"..tag.."' and d.name()== '"..t[3].."' then d.move(v.x,v.y,v.z) end end") sleep(0.5)
  156. modem.broadcast(2412,"for k, v in ipairs(r.getEntities()) do if v.name=='"..tag.."' and d.name()== '"..t[4].."' then d.move(v.x,v.y,v.z) end end") sleep(0.5)
  157. modem.broadcast(2412,"for k, v in ipairs(r.getEntities()) do if v.name=='"..tag.."' and d.name()== '"..t[5].."' then d.move(v.x,v.y,v.z) end end") sleep(0.5)
  158. modem.broadcast(2412,"for k, v in ipairs(r.getEntities()) do if v.name=='"..tag.."' and d.name()== '"..t[6].."' then d.move(v.x,v.y,v.z) end end") sleep(0.5)
  159. modem.broadcast(2412,"for k, v in ipairs(r.getEntities()) do if v.name=='"..tag.."' and d.name()== '"..t[7].."' then d.move(v.x,v.y,v.z) end end") sleep(0.5)
  160. modem.broadcast(2412,"for k, v in ipairs(r.getEntities()) do if v.name=='"..tag.."' and d.name()== '"..t[8].."' then d.move(v.x,v.y,v.z) end end") sleep(0.5)
  161. modem.broadcast(2412,"for k, v in ipairs(r.getEntities()) do if v.name=='"..tag.."' and d.name()== '"..t[9].."' then d.move(v.x,v.y,v.z) end end") sleep(0.5)
  162. end
  163.  
  164. if bid=="OK" then
  165. break
  166. end
  167.  
  168. if bid=="SETPLANT" then --# have atleast 1 redstone torch at inventory slot 2 and 1 TNT block at slot 3 for each drone...
  169. modem.broadcast(2412,"if d.name()=='"..t[1].."' then while select(2,d.detect(0))=='air' do local dis=select(2,d.detect(0)) d.move(0,-1,0) sleep(0.00005) if dis~='air' then break end end sleep(0.5) if select(2,d.detect(0))=='solid' then d.move(0,1,0) d.select(2) d.place(0) d.select(3) d.place(0) d.select(1) end end")
  170. modem.broadcast(2412,"if d.name()=='"..t[2].."' then while select(2,d.detect(0))=='air' do local dis=select(2,d.detect(0)) d.move(0,-1,0) sleep(0.00005) if dis~='air' then break end end sleep(0.5) if select(2,d.detect(0))=='solid' then d.move(0,1,0) d.select(2) d.place(0) d.select(3) d.place(0) d.select(1) end end")
  171. modem.broadcast(2412,"if d.name()=='"..t[3].."' then while select(2,d.detect(0))=='air' do local dis=select(2,d.detect(0)) d.move(0,-1,0) sleep(0.00005) if dis~='air' then break end end sleep(0.5) if select(2,d.detect(0))=='solid' then d.move(0,1,0) d.select(2) d.place(0) d.select(3) d.place(0) d.select(1) end end")
  172. modem.broadcast(2412,"if d.name()=='"..t[4].."' then while select(2,d.detect(0))=='air' do local dis=select(2,d.detect(0)) d.move(0,-1,0) sleep(0.00005) if dis~='air' then break end end sleep(0.5) if select(2,d.detect(0))=='solid' then d.move(0,1,0) d.select(2) d.place(0) d.select(3) d.place(0) d.select(1) end end")
  173. modem.broadcast(2412,"if d.name()=='"..t[5].."' then while select(2,d.detect(0))=='air' do local dis=select(2,d.detect(0)) d.move(0,-1,0) sleep(0.00005) if dis~='air' then break end end sleep(0.5) if select(2,d.detect(0))=='solid' then d.move(0,1,0) d.select(2) d.place(0) d.select(3) d.place(0) d.select(1) end end")
  174. modem.broadcast(2412,"if d.name()=='"..t[6].."' then while select(2,d.detect(0))=='air' do local dis=select(2,d.detect(0)) d.move(0,-1,0) sleep(0.00005) if dis~='air' then break end end sleep(0.5) if select(2,d.detect(0))=='solid' then d.move(0,1,0) d.select(2) d.place(0) d.select(3) d.place(0) d.select(1) end end")
  175. modem.broadcast(2412,"if d.name()=='"..t[7].."' then while select(2,d.detect(0))=='air' do local dis=select(2,d.detect(0)) d.move(0,-1,0) sleep(0.00005) if dis~='air' then break end end sleep(0.5) if select(2,d.detect(0))=='solid' then d.move(0,1,0) d.select(2) d.place(0) d.select(3) d.place(0) d.select(1) end end")
  176. modem.broadcast(2412,"if d.name()=='"..t[8].."' then while select(2,d.detect(0))=='air' do local dis=select(2,d.detect(0)) d.move(0,-1,0) sleep(0.00005) if dis~='air' then break end end sleep(0.5) if select(2,d.detect(0))=='solid' then d.move(0,1,0) d.select(2) d.place(0) d.select(3) d.place(0) d.select(1) end end")
  177. modem.broadcast(2412,"if d.name()=='"..t[9].."' then while select(2,d.detect(0))=='air' do local dis=select(2,d.detect(0)) d.move(0,-1,0) sleep(0.00005) if dis~='air' then break end end sleep(0.5) if select(2,d.detect(0))=='solid' then d.move(0,1,0) d.select(2) d.place(0) d.select(3) d.place(0) d.select(1) end end")
  178.  
  179. end
  180.  
  181. if bid=="MAT" then --#covers a 33X33 area with 9 drones
  182. print("N,S,E,W") dir=io.read()
  183. if dir=="N" then -- #-Z
  184. modem.broadcast(2412,"if d.name()== '"..t[1].."' then d.move(0,0,-20) end") sleep(0.5)
  185. modem.broadcast(2412,"if d.name()== '"..t[2].."' then d.move(-10,0,-20) end") sleep(0.5)
  186. modem.broadcast(2412,"if d.name()== '"..t[3].."' then d.move(10,0,-20) end") sleep(0.5)
  187. modem.broadcast(2412,"if d.name()== '"..t[4].."' then d.move(0,0,-30) end") sleep(0.5)
  188. modem.broadcast(2412,"if d.name()== '"..t[5].."' then d.move(-10,0,-30) end") sleep(0.5)
  189. modem.broadcast(2412,"if d.name()== '"..t[6].."' then d.move(10,0,-30) end") sleep(0.5)
  190. modem.broadcast(2412,"if d.name()== '"..t[7].."' then d.move(0,0,-40) end") sleep(0.5)
  191. modem.broadcast(2412,"if d.name()== '"..t[8].."' then d.move(10,0,-40) end") sleep(0.5)
  192. modem.broadcast(2412,"if d.name()== '"..t[9].."' then d.move(-10,0,-40) end") sleep(0.5)
  193. end
  194. if dir=="S" then -- #Z
  195. modem.broadcast(2412,"if d.name()== '"..t[1].."' then d.move(0,0,20) end") sleep(0.5)
  196. modem.broadcast(2412,"if d.name()== '"..t[2].."' then d.move(-10,0,20) end") sleep(0.5)
  197. modem.broadcast(2412,"if d.name()== '"..t[3].."' then d.move(10,0,20) end") sleep(0.5)
  198. modem.broadcast(2412,"if d.name()== '"..t[4].."' then d.move(0,0,30) end") sleep(0.5)
  199. modem.broadcast(2412,"if d.name()== '"..t[5].."' then d.move(-10,0,30) end") sleep(0.5)
  200. modem.broadcast(2412,"if d.name()== '"..t[6].."' then d.move(10,0,30) end") sleep(0.5)
  201. modem.broadcast(2412,"if d.name()== '"..t[7].."' then d.move(0,0,40) end") sleep(0.5)
  202. modem.broadcast(2412,"if d.name()== '"..t[8].."' then d.move(10,0,40) end") sleep(0.5)
  203. modem.broadcast(2412,"if d.name()== '"..t[9].."' then d.move(-10,0,40) end") sleep(0.5)
  204. end
  205. if dir=="E" then -- #+X
  206. modem.broadcast(2412,"if d.name()== '"..t[1].."' then d.move(20,0,-10) end") sleep(0.5)
  207. modem.broadcast(2412,"if d.name()== '"..t[2].."' then d.move(20,0,10) end") sleep(0.5)
  208. modem.broadcast(2412,"if d.name()== '"..t[3].."' then d.move(20,0,0) end") sleep(0.5)
  209. modem.broadcast(2412,"if d.name()== '"..t[4].."' then d.move(30,0,-10) end") sleep(0.5)
  210. modem.broadcast(2412,"if d.name()== '"..t[5].."' then d.move(30,0,10) end") sleep(0.5)
  211. modem.broadcast(2412,"if d.name()== '"..t[6].."' then d.move(30,0,0) end") sleep(0.5)
  212. modem.broadcast(2412,"if d.name()== '"..t[7].."' then d.move(40,0,-10) end") sleep(0.5)
  213. modem.broadcast(2412,"if d.name()== '"..t[8].."' then d.move(40,0,10) end") sleep(0.5)
  214. modem.broadcast(2412,"if d.name()== '"..t[9].."' then d.move(40,0,0) end") sleep(0.5)
  215. end
  216. if dir=="W" then -- #+X
  217. modem.broadcast(2412,"if d.name()== '"..t[1].."' then d.move(-20,0,-10) end") sleep(0.5)
  218. modem.broadcast(2412,"if d.name()== '"..t[2].."' then d.move(-20,0,10) end") sleep(0.5)
  219. modem.broadcast(2412,"if d.name()== '"..t[3].."' then d.move(-20,0,0) end") sleep(0.5)
  220. modem.broadcast(2412,"if d.name()== '"..t[4].."' then d.move(-30,0,-10) end") sleep(0.5)
  221. modem.broadcast(2412,"if d.name()== '"..t[5].."' then d.move(-30,0,10) end") sleep(0.5)
  222. modem.broadcast(2412,"if d.name()== '"..t[6].."' then d.move(-30,0,0) end") sleep(0.5)
  223. modem.broadcast(2412,"if d.name()== '"..t[7].."' then d.move(-40,0,-10) end") sleep(0.5)
  224. modem.broadcast(2412,"if d.name()== '"..t[8].."' then d.move(-40,0,10) end") sleep(0.5)
  225. modem.broadcast(2412,"if d.name()== '"..t[9].."' then d.move(-40,0,0) end") sleep(0.5)
  226. end
  227. end
  228. end
  229. end
  230.  
  231. if cmd=="PLANT" then --# have atleast 1 redstone torch at inventory slot 2 and 1 TNT block at slot 3...
  232. print("Drone No.: ") srm=io.read()
  233. modem.broadcast(2412,"if d.name()=='"..srm.."' then while select(2,d.detect(0))=='air' do local dis=select(2,d.detect(0)) d.move(0,-1,0) sleep(0.00005) if dis~='air' then break end end sleep(0.5) if select(2,d.detect(0))=='solid' then d.move(0,1,0) d.select(2) d.place(0) d.select(3) d.place(0) d.select(1) end end")
  234. end
  235.  
  236. if cmd=="BUNKERBUST" then --# yeah, you need more redstone torches and TNT...
  237. print("Drone No.: ") srm=io.read()
  238. repeat
  239. local cmd= select(1,event.pull(3))
  240. modem.broadcast(2412,"if d.name()=='"..srm.."' then while select(2,d.detect(0))=='air' do local dis=select(2,d.detect(0)) d.move(0,-1,0) sleep(0.00005) if dis~='air' then break end end sleep(0.5) if select(2,d.detect(0))=='solid' then d.move(0,1,0) d.select(2) d.place(0) d.select(3) d.place(0) d.select(1) end end") sleep(0.5)
  241. until cmd=="key_down"
  242. end
  243.  
  244. if cmd=="HUSH" then--# kill command
  245. modem.broadcast(2412," computer.shutdown()")
  246. end
  247.  
  248. if cmd=="RISE" then --# wake message, you need to restart client after using this command
  249. modem.broadcast(2412,"RISE")
  250. end
  251.  
  252. print(select(6, event.pull(3, "modem_message")))
  253. end
Add Comment
Please, Sign In to add comment