Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- funtion digger()
- senderID, message, distance = rednet.receive ()
- if senderID == mccID then
- command = string.sub (message, 1, 3)
- waitTime = tonumber (string.sub (message, -2))
- if command == "dig" then
- print ("Message received to dig.")
- turtle.select (1)
- turtle.place ()
- os.sleep (waitTime)
- drop()
- turtle.select (1)
- turtle.dig ()
- rednet.send (mccID, "complete")
- print ("Digging complete.")
- else
- print (senderID.."said '"..message.."'")
- end
- else
- print (senderID.." said'"..message"'")
- end
- end
- function drop()
- empty - false
- while not empty do
- for i = 1, 16 do
- turtle.select (i)
- turtle.dropDown ()
- end
- empty = true
- for i = 1, 16 do
- if turtle.getItemCount(i) > 0 then
- empty = false
- end
- end
- end
- end
- mccId = 45
- rednet.open ("right)
- while true do
- digger()
- end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement