Advertisement
burnin_aura

[CC] [iCBM] [RetaliationPC]

Jun 23rd, 2016
139
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Lua 1.12 KB | None | 0 0
  1. --[[Retaliation Computer]]--
  2.    --[[By: Andrew2070]]--
  3.  
  4. --[[Main Settings]]--
  5. local armed = true
  6.  
  7. --[[Initialization]]--
  8. local silos, curSilo = {}, 1
  9. peripheral.find("modem", rednet.open)
  10. term.setBackgroundColor(colors.blue)
  11. local masterID
  12. --[[Main Functions]]--
  13. local function clear()
  14. term.clear()
  15. term.setCursorPos(1, 1)
  16. end
  17.  
  18.  
  19. --[[Main Program]]--
  20. while true do
  21.   print("Waiting For A Retaliation Message From Server")
  22.   id, msg, distance = rednet.receive(masterID)
  23.  
  24.   if (msg == "Retaliate") then
  25.     print("  master=", id)
  26.       masterID = id;
  27.         rednet.send(masterID, "RetaliationCheck")
  28.  
  29.         elseif type(msg2) == "table" and id == masterID then
  30.         if type(msg2.x) == "number" and type(msg2.y) == "number" and type(msg2.z) == "number" then
  31.  
  32.          print("  Retaliating At x=" .. msg2.x .. ", y=" .. msg2.y .. ", z=" .. msg2.z)
  33.          icbm.setTarget(msg2.x, msg2.y, msg2.z)
  34.         if (armed) then
  35.         peripheral.call("back","launch")
  36.       end
  37.     else
  38.    print("  invalid table command")
  39.   end
  40. else
  41. print("  invalid msg '", msg, "' from '", id, "', distance=", distance)
  42. end
  43. end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement