Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- local args = {...}
- if #args == 1 then
- for i,v in ipairs(rs.getSides()) do
- if peripheral.getType(v) == "modem" then
- rednet.open(v)
- end
- end
- os.loadAPI("rpc")
- --rpc.setDebug(true)
- rpc.loadAPI("rom/apis/term")
- rpc.loadAPI("rom/apis/textutils")
- rpc.loadAPI("rom/apis/io")
- --[[for i,v in ipairs(fs.list("rom/apis")) do
- rpc.loadAPI("rom/apis/"..v)
- end]]
- rpc.new("write", "local args = {...} return write(args[1])")
- rpc.new("print", "local args = {...} return print(unpack(args))")
- rpc.new("read", "return read()")
- rpc.new("pullEvent", "return os.pullEvent(...)")
- rpc.new("pullEventRaw", "return os.pullEventRaw(...)")
- term.clear()
- term.setCursorPos(1,1)
- parallel.waitForAll(
- function() rednet.send(tonumber(args[1]), "connect") end,
- rpc.run)
- else
- print("USAGE: client [id]")
- end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement