Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- function dig
- x = 0
- y = 0
- turtle.refuel()
- x = x+1
- while x == 1 do
- print("Refueled for the 1st time")
- while x == 2 do
- print("Refueled for the 2nd time")
- while x == 3 do
- print("Refueled for the 3rd time")
- while x == x>3 do
- print("Refueled for the "..x.."th time")
- end
- while turtle.detect() do
- turtle.dig()
- y = y+1
- turtle.forward()
- end
- while turtle.detect() == false do
- turtle.right()
- turtle.forward()
- turtle.right()
- end
- print("Your turtle has refueled "..x.." times!")
- print("Your turtle has dug "..y.." blocks!")
- end
- This is the other way i tried it: (I still got the same error, which one should i use to make it more efficient)
- function dig
- x = 0
- y = 0
- turtle.refuel()
- x = x+1
- if x == 1 then print("Refueled for the 1st time")
- if x == 2 then print("Refueled for the 2nd time")
- if x == 3 then print("Refueled for the 3rd time")
- if x == x>3 then print("Refueled for the "..x.."th time")
- end
- while turtle.detect() do
- turtle.dig()
- y = y+1
- turtle.forward()
- end
- while turtle.detect() == false do
- turtle.right()
- turtle.forward()
- turtle.right()
- end
- print("Your turtle has refueled "..x.." times!")
- print("Your turtle has dug "..y.." blocks!")
- end
Advertisement
Add Comment
Please, Sign In to add comment