946ben

Untitled

Nov 24th, 2012
114
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Lua 0.45 KB | None | 0 0
  1. rednet.open("left")
  2. while(true)
  3. do
  4.  os.loadAPI("split")
  5.  id,commandline,dis = rednet.receive()
  6.  local cmd = split.split(commandline,";")
  7.  print(cmd[1].." - "..cmd[2].." - "..cmd[3])
  8.  if(cmd[1] == "close") then break end
  9.  if(cmd[1] == "fire")
  10.  then
  11.   print("Ziel: "..cmd[2].." - "..cmd[3])
  12.   p = peripheral.wrap("back")
  13.   p.setTarget(tonumber(cmd[2]),0,tonumber(cmd[3]))
  14.   p.launch()
  15.   print("Rakete abgefeuert!")
  16.  end
  17. end
  18. rednet.close()
Advertisement
Add Comment
Please, Sign In to add comment