7 posts
Posted 22 December 2012 - 04:48 AM
Keep getting an "Attempt to Call Nil" error in line 6. Nothing I seem to do fixes it, though..
g = 0
print("Welcome to MineHall 2.0")
print("How long would you like the tunnel:")
len = tonumber(read())
turtle.select(1)
turtle.refuel()
while g < len do
turtle.dig()
turtle.forward()
turtle.digUp()
turtle.digDown()
g = g+1
end
print("Finished mining.")
Any and all help is appreciated. :)/>
249 posts
Location
In the universe
Posted 22 December 2012 - 05:05 AM
You need to select the quantity to refuel in turtle.refuel(), like: turtle.refuel(1) will refuel with 1 unit from selected slot
7 posts
Posted 22 December 2012 - 05:13 AM
But if left blank, it refuels with the entire stack, no?
EDIT: Tried with (1) in the spot, still a nil value.
2088 posts
Location
South Africa
Posted 22 December 2012 - 05:20 AM
But if left blank, it refuels with the entire stack, no?
EDIT: Tried with (1) in the spot, still a nil value.
Yes.
What version of CC are you using, and have you maybe changed the settings for turtles to
NOT use fuel.
7 posts
Posted 22 December 2012 - 05:25 AM
I am using 1.3, as it is on a tekkit server, and although i am looking up how to, I have not altered the settings.
EDIT: Oh wait.. You don't even need fuel in 1.3, right? Or is that in both 1.3 and 1.4?
436 posts
Posted 22 December 2012 - 05:27 AM
You don't need fuel in 1.3.
7 posts
Posted 22 December 2012 - 05:28 AM
Wow. What an idiot.. Thanks guys! Hahaha..
436 posts
Posted 22 December 2012 - 05:31 AM
Also, a good way to test whether a function exists is to fulfill its parameters (such as putting fuel in the selected slot, in this case), and then using it in an if statement. Most functions return true if they fire.
2005 posts
Posted 22 December 2012 - 12:23 PM
Just check if turtle.refuel then or print(type(turtle.refuel)).
But yeah, no refuel function in 1.3.