Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- rednet.open("right")
- local client
- function split(s)
- local t = {}
- for v in string.gmatch(s,"[^%s]+") do
- t[#t+1]=v
- end
- return t
- end
- while true do
- local id,msg = rednet.receive()
- local cmd,args=string.gmatch(msg,"(.-) (.*)$")()
- if args then
- args=split(args)
- print(args[1])
- ret = shell.run(cmd,unpack(args))
- else
- ret = shell.run(cmd)
- end
- rednet.send(id,tostring(ret))
- rednet.send(id,"end")
- end
- rednet.close("right")
Advertisement
Add Comment
Please, Sign In to add comment