Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- turtle.refuel() -- might as well, :P
- while true do -- loop
- local action = math.random(1,9) -- Random movement generator
- if action == 1 then -- forward
- for i = 1,5 do
- turtle.forward()
- end
- end
- if action == 2 then -- forward
- for i = 1,5 do
- turtle.forward()
- end
- end
- if action == 7 then -- forward
- for i = 1,5 do
- turtle.forward()
- end
- end
- if action == 8 then -- forward
- for i = 1,5 do
- turtle.forward()
- end
- end
- if action == 9 then -- forward
- for i = 1,5 do
- turtle.forward()
- end
- end
- if action == 3 then -- up
- turtle.up()
- end
- if action == 4 then -- down
- turtle.digDown()
- turtle.down()
- end
- if action == 5 then -- left
- turtle.turnLeft()
- end
- if action == 6 then -- right
- turtle.turnRight()
- end
- sleep(0.5)
- end -- end loop
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement