Posted 21 March 2013 - 05:58 AM
[Resolved] Make sure your pastebin code is set to public in order for minecraft to use it, otherwise it will throw this error.
I recently started playing Feed the Beast and discovered mining turtles.
After using its default program of tunnel, I decided to make my own program that would create a 3x3 tunnel, along with branches while placing torches along the way.
I lightly modified the basic tunnel program and added in a branch program that I found on the internet, copied it into pastebin and loaded it into my turtle.
I named the program fullMine and upon running fullMine I received the following error message:
bios:338: [string "fullMine"]:1: '=' expected
This is the pastebin of my code: http://pastebin.com/CYNDyW0D
And this is the code :
I recently started playing Feed the Beast and discovered mining turtles.
After using its default program of tunnel, I decided to make my own program that would create a 3x3 tunnel, along with branches while placing torches along the way.
I lightly modified the basic tunnel program and added in a branch program that I found on the internet, copied it into pastebin and loaded it into my turtle.
I named the program fullMine and upon running fullMine I received the following error message:
bios:338: [string "fullMine"]:1: '=' expected
This is the pastebin of my code: http://pastebin.com/CYNDyW0D
And this is the code :
Spoiler
--Creates a 3x3 Horizontal Mine Shaft of desired length with torches every 8 blocks
--Creates branches of desired length along Mine Shaft with 4 block spacing
--Place torches in slot 1 and fuel in any slot
local tArgs = { ... }
if #tArgs <2 then
print("Usage: fullMine <Length> <Width>")
return true
end
--length is shaft length
--steps is branch length
local length = tonumber(tArgs[1])
local steps = tonumber(tArgs[2])
--if #tArgs >= 2 and tArgs[2] == "nt" then
-- torch = false
--else
-- torch = true
--end
-- Mine in a quarry pattern until we hit something we can't dig
-- local length = tonumber( tArgs[1] )
if length < 1 then
print( "Tunnel length must be positive" )
return
end
local depth = 0
local collected = 0
local function collect()
collected = collected + 1
if math.fmod(collected, 25) == 0 then
print( "Mined "..collected.." items." )
end
end
local function tryDig()
while turtle.detect() do
if turtle.dig() then
collect()
sleep(0.5)
else
return false
end
end
return true
end
local function tryDigUp()
while turtle.detectUp() do
if turtle.digUp() then
collect()
sleep(0.5)
else
return false
end
end
return true
end
local function tryDigDown()
while turtle.detectDown() do
if turtle.digDown() then
collect()
sleep(0.5)
else
return false
end
end
return true
end
local function refuel()
local fuelLevel = turtle.getFuelLevel()
if fuelLevel == "unlimited" or fuelLevel > 0 then
return
end
local function tryRefuel()
for n=1,16 do
if turtle.getItemCount(n) > 0 then
turtle.select(n)
if turtle.refuel(1) then
turtle.select(1)
return true
end
end
end
turtle.select(1)
return false
end
if not tryRefuel() then
print( "Add more fuel to continue." )
while not tryRefuel() do
sleep(1)
end
print( "Resuming Tunnel." )
end
end
local function tryUp()
refuel()
while not turtle.up() do
if turtle.detectUp() then
if not tryDigUp() then
return false
end
elseif turtle.attackUp() then
collect()
else
sleep( 0.5 )
end
end
return true
end
local function tryDown()
refuel()
while not turtle.down() do
if turtle.detectDown() then
if not tryDigDown() then
return false
end
elseif turtle.attackDown() then
collect()
else
sleep( 0.5 )
end
end
return true
end
local function tryForward()
refuel()
while not turtle.forward() do
if turtle.detect() then
if not tryDig() then
return false
end
elseif turtle.attack() then
collect()
else
sleep( 0.5 )
end
end
return true
end
local function branch()
--Starting the dig for branch
for x = 1, steps do
if not turtle.forward() then
repeat
refuel()
tryDig()
sleep()
until turtle.forward()
end
end
--Getting into position for the return
tryDigUp()
tryUp()
turtle.turnRight()
turtle.turnRight()
--Starting the return
for x = 1, steps do
tryDigUp()
if x % 8 == 0 then
turtle.placeDown()
end
if not tryForward() then
repeat
tryDig()
sleep(0.25)
until tryForward()
end
end
end
print( "Tunnelling..." )
for n=1,length do
if n % 8 == 0
turtle.placeDown()
end
tryDigUp()
turtle.turnLeft()
tryDig()
tryUp()
tryDig()
tryUp()
tryDig()
turtle.turnRight()
turtle.turnRight()
tryDig()
tryDown()
tryDig()
tryDown()
tryDig()
turtle.turnLeft()
if n % 4 == 0
turtle.turnRight()
tryForward()
branch()
tryDown()
tryForward()
turtle.turnRight()
end
if n % 4 == 2
turtle.turnLeft()
tryForward()
branch()
tryDown()
tryForward()
turtle.turnLeft()
end
if n<length then
tryDig()
depth = depth + 1
if not tryForward() then
print( "Aborting Tunnel." )
break
end
else
print( "Tunnel complete." )
end
end
print( "Returning to start..." )
-- Return to where we started
turtle.turnLeft()
turtle.turnLeft()
while depth > 0 do
if tryForward() then
depth = depth - 1
else
tryDig()
end
end
turtle.turnRight()
turtle.turnRight()
print( "Tunnel complete." )
print( "Mined "..collected.." items total." )
--Starting the dig for branch
--[[for x = 1, steps do
if not turtle.forward() then
repeat
turtle.dig()
sleep(0.6)
until turtle.forward()
end
end
--Getting into position for the return
turtle.digUp()
turtle.up()
turtle.turnRight()
turtle.turnRight()
--Starting the return
for x = 1, steps do
turtle.digUp()
if x % 8 == 0 then
turtle.placeDown()
end
if not turtle.forward() then
repeat
turtle.dig()
sleep(0.25)
until turtle.forward()
end
end]]