Advertisement
Guest User

RAttack

a guest
Sep 18th, 2019
114
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Lua 0.75 KB | None | 0 0
  1. function AttackGo(F)
  2.   while (F>0) do
  3.     if not turtle.forward() then
  4.       turtle.attack()
  5.     else
  6.       F=F-1
  7.     end
  8.   end
  9. end
  10.  
  11. function AttackLeft(F,L)
  12.   while(F>0) do
  13.     if not turtle.forward() then
  14.       turtle.dig()
  15.     else
  16.       F=F-1
  17.     end  
  18.   end
  19.  
  20.   turtle.turnLeft()
  21.  
  22.   while (L>0) do
  23.     if not turtle.forward() then
  24.       turtle.attack()
  25.       turtle.dig()
  26.     else
  27.       L=L-1  
  28.     end
  29.   end
  30.  
  31. end
  32.  
  33. function AttackRight(F,R)
  34.   while(F>0) do
  35.     if not turtle.forward() then
  36.       turtle.dig()
  37.     else
  38.       F=F-1
  39.     end  
  40.   end
  41.  
  42.   turtle.turnRight()
  43.  
  44.   while (R>0) do
  45.     if not turtle.forward() then
  46.       turtle.attack()
  47.       turtle.dig()
  48.     else
  49.       R=R-1
  50.     end
  51.   end
  52. end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement