This is a read-only snapshot of the ComputerCraft forums, taken in April 2020.
XRuecian's profile picture

Bios 338 Error ._.

Started by XRuecian, 23 November 2012 - 01:41 AM
XRuecian #1
Posted 23 November 2012 - 02:41 AM
So, i am NOT an LUA user, i have no experience with it.
I was attempting to put in the 3x3 Mining program into one of my turtles.
HTTP access is not enabled on my server, so i could not download the program from pastebin, i had to type in the program manually.
After 30 minutes of copying code by hand, i finally finished.
I got bios:338 error, the first one, i figured out on my own, i had misspelled a word.
Now im getting another bios:338 error, and i checked the line that is erroring but i can't find anything incorrect. There must be something else in the code that i dont have knowledge about that is causing the error.

I tried googling around for the error, but i cannot find anything that resembles my exact problem.

The full error:
Bios:338: [string "Mine"]:75: '<name>' expected

The code:




print("This program digs tunnel 3x3") --and even put every 5 blocks torch on wall
print("Important ! place torches in slot 1 and solid block to slot 2 !")
print("How long tunnel do you want ? ")
local x = read()
local times = 0
print("Digging "..x.." blocks long tunnel")
turtle.turnLeft()
while not turtle.forward() do
  turtle.dig()
end
turtle.turnRight()


for i = 1, x do

  while not turtle.forward() do
	turtle.dig()
  end

  turtle.turnRight()

for j = 1, 2 do
  for i = 1, 2 do	
	while not turtle.forward() do
	  turtle.dig()
	end
  end
  turtle.turnLeft()
  turtle.turnLeft()
  while not turtle.up() do
	turtle.digUp()
  end
end

for k = 1, 2 do
   while not turtle.forward() do
	turtle.dig()
   end
end

turtle.turnLeft()
turtle.turnLeft()
while not turtle.down() do
turtle.digDown()
end
if math.fmod(times,5) == 0 then
  for u = 1, 2 do
   while not turtle.forward() do
	 turtle.dig()
   end
  end
if not turtle.detect() then
  turtle.select(2)
  turtle.place()
end
  turtle.select(1)
  turtle.turnLeft()
  turtle.turnLeft()
  while not turtle.forward() do
  turtle.dig()
  end
  turtle.turnLeft()
  turtle.turnLeft()
  turtle.place()
  while not turtle.down() do
  turtle.digDown()
  end
  while not turtle.forward() do
  turtle.dig()
  end
else
while not turtle.down() do
  turtle.digDown()
end
for l = 1, 2 do
   while not turtle.forward() do
	 turtle.dig()
   end
end
end
turtle.turnRight()
times = times + 1
print("Fuel left: "..turtle.getFuelLevel())
--trash
local filled = 0
  for q = 3, 16 do
	 if turtle.getItemCount(q) >= 1 then
	filled = filled + 1
	end
  end																																	

  if filled > 8 then
   turtle.turnRight()
   while not turtle.forward() do
	 turtle.dig()
   end
   turtle.turnRight()
   for z = 1, times do
		 while not turtle.forward() do
		   turtle.dig()
		 end
   end
   for t = 3, 16 do
	 turtle.select(t)
	 turtle.drop()
   end
   filled = 0
   turtle.turnRight()
   turtle.turnRight()
   for w = 1, times do
	 while not turtle.forward() do
	  turtle.dig()
	 end
   end
   turtle.turnLeft()
	while not turtle.forward() do
	 turtle.dig()
	end
   turtle.turnRight()
  end
--trashend															  
end
turtle.turnRight()
while not turtle.forward() do
  turtle.dig()
end
turtle.turnLeft()
print("And done")
local fuelstate = turtle.getFuelLevel()
print("I have "..fuelstate.." fuel")

if fuelstate < 1000 then
print("Please refuel me")
end

Tiin57 #2
Posted 23 November 2012 - 02:48 AM
Try defining the l variable before the for loop and with a different name.
XRuecian #3
Posted 23 November 2012 - 02:51 AM
You did read that i am not an lua user? I have no idea what that means or how to do that.
I got this program from these forums, how come it was broken?
ChunLing #4
Posted 23 November 2012 - 03:09 AM
First, there are some work-arounds for not having http enabled, basically third-party programs that will rapidly retype text into the minecraft window when it has input focus. You should definitely use those.

The problem here is that we have very little confidence that what you posted is what you input into your turtle. See, what you posted is the working code that you pulled off the site, while what is in your turtle is the hand-retyped version that you can't easily cut/paste to the forum.

I'm guessing the problem is that the code you pasted calls for line 75 to be "for l = 1, 2 do" and you typed it in as "for 1 = 1, 2 do" because "l" and "1" look similar, particularly in some fonts.

The solution tiin57 suggested was to make the line read "for i = 1, 2 do" so that there is less risk of confusion. That's a valid point, but what you want is a way to input code that doesn't leave the option for you to make a mistake that we then can't see because the mistake is only in the copy that exists on your server.

Here is a topic for one such program.
Edited on 23 November 2012 - 02:14 AM
Tiin57 #5
Posted 23 November 2012 - 03:13 AM
You did read that i am not an lua user? I have no idea what that means or how to do that.
I got this program from these forums, how come it was broken?
Erm… No I did not… Very sorry.
remiX #6
Posted 23 November 2012 - 03:18 AM
Weird, it works fine for me. I just copied the code you have in your first post. No error popped up. Why not just use the default 'tunnel' program? It does the same.