NMDanny

Landmark mining turtle

Jul 16th, 2013
61
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Lua 0.65 KB | None | 0 0
  1. local modem = peripheral.wrap("right")
  2. modem.open(6421)
  3. local function transmit(msg)
  4.     modem.transmit(6421,6421,msg)
  5. end
  6.  
  7. while true do
  8.     local nvm,nvm2,sChannel,rChannel,msg,nvm3=os.pullEvent("modem_message")
  9.     if(sChannel==6421 and msg=="break_and_placemark") then
  10.         if(turtle.detect()==true) then
  11.             turtle.dig()
  12.             sleep(1)
  13.             turtle.place()
  14.             sleep(1)
  15.             turtle.back()
  16.             sleep(5)
  17.             turtle.forward()
  18.             turtle.suck()
  19.             sleep(15)
  20.             turtle.suck()
  21.         elseif(turtle.detect()==false) then
  22.             turtle.place()
  23.             sleep(0.6)
  24.             turtle.back()
  25.             sleep(5)
  26.             turtle.forward()
  27.             turtle.suck()
  28.             sleep(15)
  29.             turtle.suck()
  30.         end
  31.     end
  32. end
Advertisement
Add Comment
Please, Sign In to add comment