burnin_aura

[CC] [Radar Monitor] [WORKING]

May 28th, 2016
382
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Lua 1.52 KB | None | 0 0
  1. --[[Skynet Nuclear ABM Defense Program by Andrew2060]]--
  2.  
  3. --[[Radar Target Handler Display]]--        
  4. term.setBackgroundColor(colors.blue)
  5. term.clear()
  6.  
  7. print("===================================================")
  8. print("         SKYNET AERIAL DEFENSE SYSTEMS             ")
  9. print("===================================================")
  10. print("===================================================")
  11. print("        ENHANCED RADAR HANDLING ENABLED            ")
  12. print("===================================================")
  13. while true do
  14. maptab = peripheral.call("back","getEntities")
  15.         maptxt = textutils.serialize(maptab)
  16.         if maptxt ~= "{}" then
  17.                 allDat = 0
  18.                 for num in pairs(maptab) do
  19.                         allDat = allDat+1
  20.                 end
  21.                 targets = allDat/3
  22.                 for i=0,targets-1 do
  23.                    --Place Origin Coordinates Here--
  24.                       local x2 = 2194
  25.                       local y2 = 57
  26.                       local z2 = 1221
  27.                    --Do not Touch, these create the Distance of the Missiles--
  28.                       local x1 = math.floor(tonumber(maptab["x_"..i])/1)
  29.                       local y1 = math.floor(tonumber(maptab["y_"..i])/1)
  30.                       local z1 = math.floor(tonumber(maptab["z_"..i])/1)
  31.                       local d = math.sqrt((x2-x1)^2 + (y2-y1)^2 + (z2-z1)^2)
  32.  
  33.                           print("Incoming Missile #"..i.." Distance:"..d)
  34.  
  35.  
  36. sleep(0)
  37. end
  38. sleep(0)
  39. end
  40. sleep(0)
  41. end
Add Comment
Please, Sign In to add comment