Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- -- Awake
- print("Chatty turtle awake: Hello World!")
- -- Setup wireless
- local modem = peripheral.wrap("left")
- modem.open(11)
- modem.open(12)
- print("Channel 11 and 12 are open")
- --Setup Chatbox
- local chatbox = peripheral.wrap("right")
- -- Setup receiving wireless messages
- function WaitForMessage(messageCompare)
- while true do
- local a,b,c,d,e,f = os.pullEvent("modem_message")
- print("Message received: ")
- print(e)
- if(e == messageCompare) then
- print("Message accepted")
- break
- end
- end
- end
- local cycleTracker = 0
- -- Mine loop
- while true do
- print("Waiting for start of next cycle")
- WaitForMessage("_StartNextCycle")
- textOut = os.date() .. " >> Mine cycle: " .. tostring(cycleTracker)
- print(textOut)
- chatbox.sendMessage(textOut)
- cycleTracker = cycleTracker + 1
- print(">>")
- print(">>")
- print(">>")
- end
- print("Goodbye >>")
- read()
Add Comment
Please, Sign In to add comment