Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- modem = nil
- function main()
- print("=== Starting Mine GUI ===")
- print("")
- modem = peripheral.wrap("back")
- modem.open(2)
- sendPing()
- -- local queuedRows = 0
- while true do
- print("Lisening for Mining machine...")
- local event, modemSide, senderChannel, replyChannel, message, senderDistance = os.pullEvent("modem_message")
- if message == -1 then
- print("Mining machine is offline and waiting for new jobs...")
- print("please enter the number of rows / -1 for none")
- rows = tonumber(read())
- if rows > 0 then
- modem.transmit(1,2,rows)
- else
- do return end
- end
- else
- print("Mining machine is online and has " ..message.."queued rows")
- end
- end
- end
- function sendPing()
- modem.transmit(1,2,-1)
- end
- main()
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement