Jump to content
  • Sky
  • Blueberry
  • Slate
  • Blackcurrant
  • Watermelon
  • Strawberry
  • Orange
  • Banana
  • Apple
  • Emerald
  • Chocolate
  • Charcoal

PHOBOSS98

Members
  • Content Count

    30
  • Joined

  • Last visited

Posts posted by PHOBOSS98

  1. So... I'm back...you know radars are expensive... that makes radar upgrades for each drone more expensive...which defeats the purpose of having a dispensable army. This is my attempt at fixing this issue:

    Instead of having each of your drone fly around with equipment worth half of the US military budget, why not have a single radar and a computer to tell the swarm where to buzz around?.

    Here's the new stuff that you need:

    a Waypoint block named "yeet" -- or something else if you want, just don't forget to change it in the code

    Radar block --from computronics

    a computer-- preferably a server or something that can give you a portable interface to type in your commands

    atleast a tier 2 drone --for the survivalists note: they run out of power fast if you dont give them the right upgrades tho... thats why I prefer creative cases

    1 Navigation upgrade for each drone

    and the code:

    this goes into your computer:

    1. local component = require("component")
    2. local event = require("event")
    3. local serialization= require("serialization")
    4. local computer= require("computer")
    5. local radar = component.radar
    6. local modem = component.modem
    7.  
    8. modem.open(2412)
    9. modem.broadcast(2412,"n= component.proxy(component.list('navigation')())")
    10. modem.broadcast(2412,"d= component.proxy(component.list('drone')())")
    11. modem.broadcast(2412,"rbt= component.proxy(component.list(‘robot’)())")
    12. 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")
    13.  
    14. local function sleep(timeout) checkArg(1, timeout, "number", "nil") local deadline = computer.uptime() + (timeout or 0) repeatcomputer.pullSignal(deadline - computer.uptime()) until computer.uptime() >= deadline
    15. end
    16.  
    17. while true do
    18. local cmd=io.read()
    19.  if not cmd then return
    20.  end
    21.  
    22.  if cmd=="BZZ" then
    23.    print("Target: ") tag=io.read()
    24.    print("Drone No.: ") srm=io.read()
    25.      repeat
    26.       local cmd=select(1,event.pull(1))
    27.  
    28.   for k, v in ipairs(radar.getEntities()) do
    29.     if v.name==tag then
    30.         x= v.x  y=v.y  z=v.z
    31.     end
    32.     if v.y>0 then y=v.y+1
    33.     end
    34.   end  
    35.   modem.broadcast(2412,"for k, v in ipairs (n.findWaypoints(100)) do if v.label=='yeet' and d.name()=='"..srm.."' then a=-v.position[1]-'"..x.."'+ math.random(-3,3) math.abs(a) if ( -v.position[1]>"..x..") then a=-a elseif(-v.position[1]<="..x..")then a=math.abs(a)  end b=-v.position[2]-'"..y.."'+ math.random(-3,3) math.abs(b) if ( -v.position[2]>"..y..") then b=-b elseif(-v.position[2]<="..y..")then b=math.abs(b)  end c=-v.position[3]-'"..z.."'+ math.random(-3,3) math.abs(c) if ( -v.position[3]>"..z..") then c=-c elseif(-v.position[3]<="..z..")then c=math.abs(c)  end  d.move(a,b,c) end end")
    36.  
    37. print (x,y,z)sleep(0.5)
    38.  
    39.     until cmd=="key_down"
    40.   end
    41.  
    42.  if cmd=="SWARM" then
    43.    print("Target: ") tag=io.read()
    44.      repeat
    45.       local cmd=select(1,event.pull(1))
    46.  
    47.   for k, v in ipairs(radar.getEntities()) do
    48.     if v.name==tag then
    49.         x= v.x  y=v.y  z=v.z
    50.     end
    51.     if v.y>0 then y=v.y+1
    52.     end
    53.   end  
    54. modem.broadcast(2412,"for k, v in ipairs (n.findWaypoints(100)) do if v.label=='yeet' then a=-v.position[1]-'"..x.."'+ math.random(-3,3) math.abs(a) if ( -v.position[1]>"..x..") then a=-a elseif(-v.position[1]<="..x..")then a=math.abs(a)  end b=-v.position[2]-'"..y.."'+ math.random(-3,3) math.abs(b) if ( -v.position[2]>"..y..") then b=-b elseif(-v.position[2]<="..y..")then b=math.abs(b)  end c=-v.position[3]-'"..z.."'+ math.random(-3,3) math.abs(c) if ( -v.position[3]>"..z..") then c=-c elseif(-v.position[3]<="..z..")then c=math.abs(c)  end  d.move(a,b,c) end end")
    55.  
    56. print (x,y,z)sleep(0.5)
    57.  
    58.     until cmd=="key_down"
    59.   end
    60.  
    61.  if cmd=="RETURN" then
    62.    print("Target: ") tag=io.read()
    63.      repeat
    64.       local cmd=select(1,event.pull(1))
    65.  
    66.   for k, v in ipairs(radar.getEntities()) do
    67.     if v.name==tag then
    68.         x= v.x  y=v.y  z=v.z
    69.     end
    70.     if v.y>0 then y=v.y+1
    71.     end
    72.   end  
    73. modem.broadcast(2412,"for k, v in ipairs (n.findWaypoints(100)) do if v.label=='yeet' then a=-v.position[1]-'"..x.."' math.abs(a) if ( -v.position[1]>"..x..") then a=-a elseif(-v.position[1]<="..x..")then a=math.abs(a)  end b=-v.position[2]-'"..y.."' math.abs(b) if ( -v.position[2]>"..y..") then b=-b elseif(-v.position[2]<="..y..")then b=math.abs(b)  end c=-v.position[3]-'"..z.."' math.abs(c) if ( -v.position[3]>"..z..") then c=-c elseif(-v.position[3]<="..z..")then c=math.abs(c)  end  d.move(a,b,c) end end")
    74.  
    75. print (x,y,z)sleep(0.5)
    76.  
    77.     until cmd=="key_down"
    78.   end
    79.  
    80.   print(select(6, event.pull(3, "modem_message")))
    81.  
    82. end

    and for the drone (nothing really changed):

    1. local m=component.proxy(component.list("modem")())
    2. local d=component.proxy(component.list("drone")())
    3. d.setLightColor(0x00FFE8)               -- the first character 's' of the method should have been in lower case
    4. d.setStatusText(d.name())                -- same here... my bad
    5. m.open(2412)
    6. m.setWakeMessage("RISE")
    7. local function respond(...)
    8.   local args=table.pack(...)
    9.   pcall(function() m.broadcast(2412, table.unpack(args)) end)
    10. end
    11. local function receive()
    12.   while true do
    13.     local evt,_,_,_,_,cmd=computer.pullSignal()
    14.     if evt=="modem_message" then return load(cmd) end
    15.   end
    16. end
    17. while true do
    18.   local result,reason=pcall(function()
    19.     local result,reason=receive()
    20.     if not result then return respond(reason) end
    21.     respond(result())
    22.   end)
    23.   if not result then respond(reason) end
    24. end

    Back in the days where everything was simple, like when I made the original code, each drone had a Radar upgrade that tells it where everybody is relative to the drone itself... this had to change...

    The drones have to rely on a reference point to know where they are in space. With the waypoint block pointed to the radar block the drones can know their relative distance from the radar. (It should work wherever you place it, just have the side with the particle effects touch the radar block)

    475876196_ScreenShot2019-03-25at9_12_38pm.jpg.eed0d0c55255490c99a9b08a54f3ae28.jpg

    With the radar knowing where entities are in space relative to the itself the computer can tell the drones where an entity is from the radars perspective. With some quick maths the drones know where an entity is relative to themselves.... and thats how science works...

    COMMANDS SO FAR:

    BZZ -- call a drone to fly randomly around you or another entity note: energy drains really fast when you let it fly around too long...

    SWARM -- calls the whole swarm to do the same thing

    RETURN -- calls the whole swarm to your feet. Much easier than going on a scavenger hunt for your lost drones

    have F.U.N.

    PS: the drones should all be powered on before running the program

  2. On 11/29/2018 at 8:35 AM, ajacobs said:

    Im just using your code as is on the latest version of opencomputers

    ok buddy Im back about the lightcolors thing I finally had time too look into it and found what might be the problem:

    let me know if it works

    Le BRAIN.lua (this goes in the drone)
    1. local m=component.proxy(component.list("modem")())
    2. local d=component.proxy(component.list("drone")())
    3. d.setLightColor(0x00FFE8)               -- the first character 's' of the method should have been in lower case
    4. d.setStatusText(d.name())                -- same here... my bad
    5. m.open(2412)
    6. m.setWakeMessage("RISE")
    7. local function respond(...)
    8.   local args=table.pack(...)
    9.   pcall(function() m.broadcast(2412, table.unpack(args)) end)
    10. end
    11. local function receive()
    12.   while true do
    13.     local evt,_,_,_,_,cmd=computer.pullSignal()
    14.     if evt=="modem_message" then return load(cmd) end
    15.   end
    16. end
    17. while true do
    18.   local result,reason=pcall(function()
    19.     local result,reason=receive()
    20.     if not result then return respond(reason) end
    21.     respond(result())
    22.   end)
    23.   if not result then respond(reason) end
    24. end
  3. On 11/29/2018 at 8:35 AM, ajacobs said:

    Im just using your code as is on the latest version of opencomputers

    yeah about that... I might have forgotten to document the version I used for this... I haven't even checked if my code even works on the latest version... its going to take me a while to sort this out actually... so you might want to start tweaking the code a bit while I can't...

  4. On 11/19/2018 at 11:27 PM, ajacobs said:

    I'm a total noob so I'm sure it's something I'm doing wrong but I keep getting nil value errors on my drones (lightcolor).
    Would it be possible for anyone to help? Thank you so much in advance!

    Hi, sorry for the late reply, are you using your own code or my code above. it would really help if you could show us the part code you edited...

  5. Hi, are you tired of your mundane minions? do you have a s@$# ton of drones and have no idea what to do with them? are you tired of havi- you know what here's the code for your Drone Army (I don't know what else to say to convince you that this is a program worth playing with):

    Le client.lua (this goes in your tablet):

    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
     
    Le BRAIN.lua (this goes in the drone)
    1. local m=component.proxy(component.list("modem")())
    2. local d=component.proxy(component.list("drone")())
    3. d.setLightColor(0x00FFE8)            -- Edit the first character of the method should have been in lowercase
    4. d.setStatusText(d.name())            -- Same here my B
    5. m.open(2412)
    6. m.setWakeMessage("RISE")
    7. local function respond(...)
    8.   local args=table.pack(...)
    9.   pcall(function() m.broadcast(2412, table.unpack(args)) end)
    10. end
    11. local function receive()
    12.   while true do
    13.     local evt,_,_,_,_,cmd=computer.pullSignal()
    14.     if evt=="modem_message" then return load(cmd) end
    15.   end
    16. end
    17. while true do
    18.   local result,reason=pcall(function()
    19.     local result,reason=receive()
    20.     if not result then return respond(reason) end
    21.     respond(result())
    22.   end)
    23.   if not result then respond(reason) end
    24. end
     
    here you'll also need these to work with:
    atleast 64 TNT blocks
    atleast 64 redstone torches
    atleast 64 building materials (blocks preferably)
    Creative drone Case (sorry survivalists, I couldn't find a way to put it all in a T2 case :(
    Computronics 1.6.6 for 1.12.2 Radar upgrade heres: a link to the add-on:https://files.vexatos.com/?dir=Computronics/dev
    (ps: you need to go into the computronics config file and set the radar range to atleast 50 blocks and set it to return coordinates to true)
    5X T3 Battery upgrade (or you can use less if you use more solar upgrades)
    Inventory upgrade
    Inventory controller upgrade
    T3 CPU
    2X T3.5 Memory
    wireless network card

    (you'll need atleast 14 of these drones named from '1' to '14' )

    and a creative tablet (might as well... or if your upto it, you can use a regular tablet)

    oh yeah I almost forgot:


    some of the commands:
    FLW-- # call a specific drone to follow (randomly flys about)

    1384979405_doneswarm.png.caefb7ac10b1c689370b2589366104bb.png
    ALLFLW-- # all follow ( they all randomly fly about)
    MOV-- # call a specific drone to move
    ALLMOV-- # all move
    GOTO-- # call a specific drone to converge at a target
    ALLGOTO--# all will converge at target
    STK-- # call a specific drone to stalk a target (its default is to follow a target 15 blocks above)
    PLANT--# have atleast 1 redstone torch at inventory slot 2 and 1 TNT block at slot 3...

    BOMB.png.51102845862be66226e8cafec6eb93fa.png

    BUNKERBUST --# does the samething as PLANT but throws it in a loop yeah, you need more redstone torches and TNT...
    HUSH --# kill command
    RISE--# wake message (you need to restart client after using this command)

    ---for the following type in 'X' to re-center drones and 'OK' to break out of 'SET' (you'll know what I mean ;) )--- 
    SET8--# make 8 drones from swarm converge at target position, used to set up fort and other stuff that I have yet to think about. 
        PORTAFORT--# 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))

    FORT.png.06958a5ca0827a4864f731f7a688e324.png

    SET9--# 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.
        MAT --#covers a 33X33 area with 9 drones
        SETPLANT--# have atleast 1 redstone torch at inventory slot 2 and 1 TNT block at slot 3 for each drone...

    mat3.png.b30f3b78c1e0891f70cc1c3ff2718183.png

    have fun causing Havoc and chaos :) 

    and this might be the first and last time I write a program for opencomputers... Byeeeee :)

  6. well thats odd... apparently the drone tries to broadcast twice, I tweaked the code a small bit:

     

    local computer=require("computer")
    local component=require("component")

    local d= component.proxy(component.list("drone")())
    local m= component.proxy(component.list("modem")())
    local r= component.proxy(component.list("radar")())
    m.open(1)

    while true do
    local_,_,_,_,_,rtable,mov,x,y,z = computer.pullSignal()
        if mov=="follow" then
            for k, v in pairs(r.getEntities()) do
                m.broadcast(1,"rreeeee") - - #Le tweak
            end
        end
    end

     

    and then got this:
    adsfasfsdfssdffsdsfdasf.thumb.png.41351a5748233005cb15834199676f93.png

    but when it tries to broadcast the 'v' entries it does this:

    coordinate.thumb.png.f700b202fb5536282f79d7b4fe601866.png

    then shuts down...

    maybe thats what's causing it to crash?(I'm just guessing here)... it doesn't happen outside the "for k,v in pairs()..." line:

     

    local computer=require("computer")
    local component=require("component")

    local d= component.proxy(component.list("drone")())
    local m= component.proxy(component.list("modem")())
    local r= component.proxy(component.list("radar")())
    m.open(1)

    while true do
    local_,_,_,_,_,rtable,mov,x,y,z = computer.pullSignal()
        if mov=="follow" then
            m.broadcast(1,"skrrrrra") - - #does it once
            for k, v in pairs(r.getEntities()) do
                m.broadcast(1,"ka") - - #does it twice
            end
            m.broadcast(1,"pa pa ka") - -#does it once
        end
    end

     

    see:

    kaka.thumb.png.a301fbdf05dc56e07a0cd048216fde4c.png

  7. what, do I just smack the drone with it?:

     

     

     

    I don' think that the radar would give out a nil value I tried broadcasting the 'v' entries from the drone with this code:

     

    local d= component.proxy(component.list("drone")())
    local m= component.proxy(component.list("modem")())
    local r= component.proxy(component.list("radar")())
    m.open(1)

    while true do
    local_,_,_,_,_,rtable,mov,x,y,z = computer.pullSignal()
        if mov=="follow" then
            for k, v in pairs(r.getEntities()) do
                m.broadcast(1,v.name,v.distance,v.x,v.y,v.z)
            end
        end
    end

     

    I got this in return:

     

    ...before the drone fainted

    again

  8. so for context I tested this code on some bots:

    local component = require("component")
    local event = require("event")
    local robot = require("robot")
    component.modem.open(1)

    local function b(_,_,_,_,_,mov)
        if mov=="follow" then
            for k,v in pairs(component.radar.getEntities()) do
                if v.name=="PHOBOSS" then

                        if v.y<-1 then
                            for i=0,v.y,-1 do robot.down() end
                        end
                        if v.y>-1 then
                            for i=0,v.y, 1 do robot.up() end
                        end
                        if v.y==-1 then
                            print("level") --just for %!@$ and giggles
                        end
                end
            end
        end
    end

    event.listen("modem_message", b)

    with the radar upgrade installed I made them track my movement and told them to follow me moving up and down ( I just did this to test out my code)

    it worked as long as you keep broadcasting "follow"

    now I tried implementing this to a drone (cause its cool and way easier to set its movements):

     

    local d= component.proxy(component.list("drone")())
    local m= component.proxy(component.list("modem")())
    local r= component.proxy(component.list("radar")())
    m.open(1)

    when true do
    local_,_,_,_,_,rtable,mov,x,y,z = computer.pullSignal()
        if mov=="follow" then
            for k, v in pairs(r.getEntities()) do   - - # for clarification, here's an example: r.getEntities() = { {distance=3.008877656445322,name="PHOBOSS",x=7,z=0,y=0} , {name="Chicken",distance=5.7886764534321234,z=5,y=3,x=-2}... } 
                if v.name=="PHOBOSS" then
                    d.move(v.x,v.y,v.z)
                end
            end
        end
    end

     

    but the moment that it would read:

    for k, v in pairs(r.getEntities()) do
                if v.name=="PHOBOSS" then
                    d.move(v.x,v.y,v.z)

    the drone shuts off...

    pls holp XD

  9. I do need a loop that can stop by a modem event.. but you see when I tried the code you sent me (with a few changes):

    local component = require("component")
    local event = require("event")
    local m = component.modem
    m.open(1)
    
    repeat
    print("hello") --#the thing
      local cmd = select(6, event.pull("modem_message"))
    until cmd == "stop" 
    

    it did end the program when I sent it the message but it doesn't print it repeatedly it just does this: 

    cro.thumb.png.74d5a8838dc98b1da9abe6040dfafa3f.png

    and so I tried and tested something and changed the code:

    local component = require("component")
    local event = require("event")
    local m = component.modem
    m.open(1)
    
    repeat
      print("hello")
      local cmd = select(6, event.pull("modem_message"))
      print("hi")--#the new thing
    until cmd == "stop"

    and ended up with this:
    sdf.png.69c4332d32c8e2c1213f0db0d55a3437.png

    (note: i didn't end the program this time)

    it seems that the loop stops at 

    local cmd = select(6, event.pull("modem_message"))

    but still thinks it's running since when I broadcasted the stop command it did this:

    asdasdsfdfsad.png.63e42430e108661dda909cf4cc44976e.png

     

  10. local component=require("component")
    for k,v in pairs(component.radar.getEntities())
    do
        if v.name=="PHOBOSS" --entity name
            then print (k,v.x,v.y,v.z) -- coordinates
        end
    end

    no errors when used on a computer

    but on a robot...

    bot.png.42c445019b3b8cefa2a4d77eed8d668a.png

  11. I have this code

    It works on a computer:

    1. for k,v in pairs(component.radar.getEntities())
    2. do
    3.     if v.name=="PHOBOSS" --entity name
    4.         then print (k,v.x,v.y,v.z) -- coordinates
    5.     end
    6. end
    but it screws up in my bot:
    stack traceback:
     machine:756: in function '__index '
    ...
     
    is this suppose to be normal?
    is this also a thing for drones?
    if it is a way around this would be greatly appreciated :)
    (note: I used the lua program in running this and the radar component comes from Computronics)
     
    furthermore:
    so while I was waiting I decided to try and move the process to the computer instead of the bot/drone... I got a bot to broadcast its radars data repeatedly again using the lua program:
    1. while true do
    2. component.modem.broadcast(001, serialization.serialize(component.radar.getEntities())) end
    then I had the computer/server do this:
    1. local component=require("component")
    2. local event.require("event")
    3. local serialization.require("serialization")
    4. component.modem.open(001)
    5.  
    6. local function a(_,_,_,_,_msg)
    7. seialization.unserialize(msg)
    8. end
    9. event.listen("modem_message", a)
    10.  
    11. for k,v in pairs(esrialization.unserialize(msg))
    12. do
    13.     if v.name=="PHOBOSS" then
    14.         print (v.name,k,v.x,v.y,v.z) 
    15.     end
    16. end
    but instead it does this:
    err.png.f177b26e21281d39d20dc6f83303622e.png
     
    well I shouldn't be complaining since it did what I want but I need this to be running in a loop and I just also want to know what the error means
    again any help is appreciated :)
×
×
  • Create New...

Important Information

By using this site, you agree to our Terms of Use and Privacy Policy.