Lion4ever

advaned command pc duo

Mar 16th, 2015
301
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Lua 0.64 KB | None | 0 0
  1. local function rev()
  2. local o = {os.pullEvent("modem_message")}
  3. if type(o[4]) == "string" then
  4. local p = loadstring("return "..o[4])
  5. if p then
  6. return p()
  7. end
  8. end
  9. return nil
  10. end
  11. local m = peripheral.find("modem")
  12. m.open(1)
  13.  
  14. local function snd(...)
  15. local s = textutils.serialize({...})
  16. m.transmit(1,1,s)
  17. end
  18.  
  19. if commands then
  20. commands.setblock("~","~4","~","minecraft:grass")
  21. while true do
  22. snd(commands.exec(unpack(rev())))
  23. end
  24. else
  25. local l= peripheral.find"computer"
  26. l.turnOn()
  27. local function ex(...)
  28. snd(...)
  29. return rev()
  30. end
  31. commands = setmetatable({exec=ex},{__index=function(t,k) return function(...) ex(k,...) end end})
  32. end
Advertisement
Add Comment
Please, Sign In to add comment