Last active
May 30, 2022 12:59
-
-
Save bananasov/a2c0d08911d925778a1673f2ad9a5eff to your computer and use it in GitHub Desktop.
Beer client
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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