Skip to content
kreezxil edited this page Jul 23, 2018 · 2 revisions

Description

Tell your turtle to go back once or a number of times. usage: b [x]

Instructions

Inspired by MIZE, this program allows you to tell your turtle to go back once or a number of times.

usage: b [x]

Installation

  1. pastebin get CEuzpJii back
  2. b [x]

Code

-- inspired by MIZE
-- allows a turtle to be told to go back once or a number of times
-- usage:
-- b [x]

local tArgs = { ... }
local dist = 1
if #tArgs ~= 1 then
    dist = 1
    else
	dist = tonumber( tArgs[1] )
end

--Check fuel and refuel if nessesary
--Code source: sethbling http://www.youtube.com/watch?v=DSsx4VSe-Uk&feature=share&list=SP2Qvl4gaBge02Eh4AqtDSWg3sojt3jeRO
if turtle.getFuelLevel() < 200 then
	turtle.select(1)
	turtle.refuel(1)
end

-- Move Up one or more
for n=1,dist do
	if turtle.back() then
		print( "True" )
		else
		print( "False" )
	end
end