AssossaGPB

[RcTurtle] Turtle

Oct 27th, 2014
188
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Lua 0.44 KB | None | 0 0
  1. --+------------+--
  2. --|  Rc Turtle |--
  3. --| By Assossa |--
  4. --+------------+--
  5.  
  6. rednet.open("right")
  7.  
  8. local args = {...}
  9. local id = 1
  10.  
  11. if args[1] ~= nil then
  12.     id = tonumber(args[1])
  13. end
  14.  
  15. while true do
  16.     local i,m,d = rednet.receive()
  17.  
  18.     if i == id then
  19.         local s,e = pcall(loadstring(m))
  20.  
  21.         if not s then
  22.             print("Error: "..e..", Trying To Execute: "..m)
  23.             rednet.send(id,"!"..e)
  24.         else
  25.             print("Executed: "..m)
  26.         end
  27.     end
  28. end
Advertisement
Add Comment
Please, Sign In to add comment