Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- local function bastion()
- local modem = peripheral.find("modem") or error("No modem attached", 0)
- modem.open(15) -- Open 43 so we can receive replies
- -- And wait for a reply
- local event, side, channel, replyChannel, message, distance
- repeat
- event, side, channel, replyChannel, message, distance = os.pullEvent("modem_message")
- until channel == 15
- -- Process the received message based on its content
- if message == "Recal" then
- print("Recalling Player...")
- modem.transmit(43, 15, "Recalling Player...")
- turtle.forward()
- os.sleep(1) -- Keep the signal for 1 seconds
- turtle.back()
- print("Back")
- end
- end
- term.clear()
- term.setCursorPos(1, 1)
- print("Bastion Network Online!")
- -- Main loop
- while true do
- bastion()
- end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement