hevohevo

SurelyForward()

Jul 2nd, 2014
450
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Lua 0.51 KB | None | 0 0
  1. function surelyFwd()
  2.   for i=1,4 do
  3.     if turtle.forward() then return true end -- success!
  4.     while turtle.dig() do print("dig") end -- face to a normal block or a sand(gravel) hill
  5.     if turtle.forward() then return true end -- success!
  6.  
  7.     if not turtle.attack() then
  8.       -- face to sand-blocks which is dropping long time
  9.       os.sleep(5) -- probably, adjustment is required
  10.     else
  11.       -- face to monster-mob
  12.       while turtle.attack() do end
  13.     end
  14.   end
  15.   return false
  16. end
  17.  
  18. surelyFwd()
Advertisement
Add Comment
Please, Sign In to add comment