Skip to content

Instantly share code, notes, and snippets.

@bananasov
Last active May 30, 2022 12:59
Show Gist options
  • Save bananasov/a2c0d08911d925778a1673f2ad9a5eff to your computer and use it in GitHub Desktop.
Save bananasov/a2c0d08911d925778a1673f2ad9a5eff to your computer and use it in GitHub Desktop.
Beer client
local modem = peripheral.find("modem") or error("No modem attached", 0)
modem.open(80)
print("Opened to port 80")
modem.transmit(81, 80, "client_request")
while true do
local event, side, channel, replyChannel, message, distance = os.pullEvent("modem_message")
if channel == 80 then
print("Received a reply: " .. tostring(message))
end
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment