Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- os.loadAPI("lib/net.lua")
- PROTO = "INV"
- HOST_NAME = "inv-mgmt-01"
- CUE = "get"
- INPUT_SIDE = "top"
- function serve()
- while(true) do
- clientID, msg = net.listen(PROTO)
- if msg == CUE then
- msg = rs.getBundledInput(INPUT_SIDE)
- -- give the client time to listen
- os.sleep(2)
- rednet.send(clientID, msg, PROTO)
- end
- end
- end
- -- setup
- print("initializing inventory server...")
- net.connect()
- rednet.host(PROTO, HOST_NAME)
- serve()
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement