6 posts
Posted 02 January 2013 - 07:14 PM
Hi, this is really the first code that I have written myself and it didn't have any hitches along the way (kinda surprised me). When the error screen didn't appear i was excited, but the turtle didnt move. Can someone help me figure out the problem? I don't know Lua that well, so bear with me.(I know enough for basic scripts, but not in computercraft).
Here is the paste bin:
http://pastebin.com/dDG5uK1e***The Turtle does require bonemeal and saplings for the TreeFarm. I also havent added a drop items function, but if someone could tell me with a way to drop all inv items at once, it would be appreciated. The setup requires 3-4 chests around the turtle. The one to the right of it contains fuel, the one behind has the saplings, and the one on the left has bonemeal.***
997 posts
Location
Wellington, New Zealand
Posted 02 January 2013 - 07:22 PM
Did you fuel the turtle?
Insert coal, charcoal, lava buckets or anything else that works in a furnace, then run "refuel all" (without quotes).
6 posts
Posted 02 January 2013 - 07:23 PM
I did put in fuel, but i still got nothing
1619 posts
Posted 02 January 2013 - 07:52 PM
Having fuel isn't enough. Make sure you run the refuel program or call turtle.refuel()
2088 posts
Location
South Africa
Posted 02 January 2013 - 08:02 PM
Does it not even move when calling forward4()?
print("Commencing Lumberjacking...")
turtle.turnRight()
checkfuel()
turtle.turnRight()
resupply()
forward4()-- Does it not move here? But it turns fine, and fuels fine?
6 posts
Posted 02 January 2013 - 08:28 PM
@Dlcruz i did run the command, it still wont move
@remiX it wont turn either, and it doesnt even print the message
2088 posts
Location
South Africa
Posted 02 January 2013 - 09:51 PM
Wow, ok. Hmm..
What version of CC do you have?
In the turtle, type lua. Then type turtle.forward() and turtle.turnLeft(), does it output False or nil?
While there, do print("test") what does it do?
After this, maybe try with a completely new turtle? You might have overwritten the functions with the turtle somehow.
6 posts
Posted 02 January 2013 - 10:11 PM
I have 1.48 and the lua commands work and so does the print("test"). I honestly can't tell by looking at my coding if I overwrote anything but like I said I do not know Lua that well.
2088 posts
Location
South Africa
Posted 02 January 2013 - 10:19 PM
Does it print true for the lua commands? Did you try using a new turtle?
818 posts
Posted 02 January 2013 - 10:27 PM
the while loop on line 10 hasn't got an end, and so everything is contained within the function harvest(). though, why are you having an extra random end in the last for loop? You got <program>:<line>: "End expected" didn't you? A good thing is that when you get "End expected", look through your code and see what isn't ended. especially since it tells you what action and what line the unclosed block starts.
Anyways, as said before, unended while loop.
6 posts
Posted 03 January 2013 - 09:15 AM
@remiX They did show true
@Doyle thank you i have a few other things to work out, but the turtle does move now :lol:/> .
6 posts
Posted 03 January 2013 - 11:05 AM
The problem is solved thanks for your guys's help. I appreciate it