Posted 01 December 2012 - 12:11 PM
Okay, here's my code:
I am using Tekkit and am running this from a disk. Sometimes there is no output, and sometimes it just displays the help. There definitely is fuel in the Mining turtle.
What am I doing wrong?
Thanks,
~JonaK
Spoiler
local function usage()
print("Your options are:")
print("mine {depth} -- Mines however many blocks specified")
print("left {blocks} -- Turns left and moves X spaces")
print("right {blocks} -- Turns right and moves X spaces")
print("forward {blocks} -- Moves forward X spaces")
print("back {blocks} -- Moves back X spaces")
print("up {blocks} -- Moves up X spaces")
print("down {blocks} -- Moves down X spaces")
print("The usage is 'minesuite [option] {args}'")
end
local args={...}
if args ~= 2 then
return usage()
end
if args[1] == mine then
term.clear()
term.setCursorPos(1,1)
print("Please put fuel in slot one")
sleep("5")
term.clear()
term.setCursorPos(1,1)
print("Press enter to continue")
read()
for d=1,tonumber(args[2]) do
if turtle.getFuelLevel() < 5 then
turtle.refuel(1)
end
turtle.digDown()
turtle.down()
end
for u=1,minedist do
if turtle.getFuelLevel() < 5 then
turtle.refuel(1)
end
turtle.up()
end
end
if args[1] == left then
print("Please remember to put fuel in the first slot!")
sleep(2)
if turtle.getFuelLevel() < 5 then
turtle.refuel(1)
end
turtle.turnLeft()
for lfwd=1,tonumber(args[2]) do
turtle.forward()
end
end
if args[1] == right then
print("Please remember to put fuel in the first slot!")
sleep(2)
if turtle.getFuelLevel() < 5 then
turtle.refuel(1)
end
turtle.turnRight()
for rfwd=1,tonumber(args[2]) do
turtle.forward()
end
end
if args[1] == forward then
print("Please remember to put fuel in the first slot!")
sleep(2)
if turtle.getFuelLevel() < 5 then
turtle.refuel(1)
end
for ffwd=1,tonumber(args[2]) do
turtle.forward()
end
end
if args[1] == back then
print("Please remember to put fuel in the first slot!")
sleep(2)
if turtle.getFuelLevel() < 5 then
turtle.refuel(1)
end
for bbck=1,tonumber(args[2]) do
turtle.back()
end
end
if args[1] == up then
print("Please remember to put fuel in the first slot!")
sleep(2)
if turtle.getFuelLevel() < 5 then
turtle.refuel(1)
end
for uup=1,tonumber(args[2]) do
turtle.up()
end
end
if args[1] == down then
print("Please remember to put fuel in the first slot!")
sleep(2)
if turtle.getFuelLevel() < 5 then
turtle.refuel(1)
end
for down=1,tonumber(args[2]) do
turtle.down()
end
end
I am using Tekkit and am running this from a disk. Sometimes there is no output, and sometimes it just displays the help. There definitely is fuel in the Mining turtle.
What am I doing wrong?
Thanks,
~JonaK