Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- local cobblestone = 0
- local iron = 0
- local other = 0
- term.clear()
- term.setCursorPos(1, 1)
- monitor.clear()
- monitor.setCursorPos(1, 1)
- function newline()
- cx, cy = monitor.getCursorPos()
- monitor.setCursorPos(1, cy + 1)
- end
- function splitS(str, index)
- counter = 0
- returned = false
- for i in string.gmatch(str, "%S+") do
- if counter == index
- then
- returned = true
- return i
- else
- counter = counter + 1
- end
- end
- if not returned
- then
- return str
- end
- end
- function drawInfo()
- monitor.write("Cobblestone: "..cobblestone)
- newline()
- monitor.write("Iron: "..iron)
- newline()
- monitor.write("Other: "..other)
- end
- function startMiner()
- modem.transfer(3, 1, "start")
- end
- function stopMiner()
- modem.transfer(3, 1, "stop")
- end
- if tArgs[1] == "stop"
- then
- stopMiner()
- elseif tArgs[1] == "start"
- then
- startMiner()
- end
- modem.open(3)
- while true do
- event, modemSide, senderChannel, replyChannel,
- message, senderDist = os.pullEvent("modem_message")
- monitor.write("Mined "..message.." items")
- newline()
- end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement