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

Turtle won't move, and no error screen (Tree Farm)

Started by ChaosSlayer24, 02 January 2013 - 06:14 PM
ChaosSlayer24 #1
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.***
immibis #2
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).
ChaosSlayer24 #3
Posted 02 January 2013 - 07:23 PM
I did put in fuel, but i still got nothing
Dlcruz129 #4
Posted 02 January 2013 - 07:52 PM
Having fuel isn't enough. Make sure you run the refuel program or call turtle.refuel()
remiX #5
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?
ChaosSlayer24 #6
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
remiX #7
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.
ChaosSlayer24 #8
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.
remiX #9
Posted 02 January 2013 - 10:19 PM
Does it print true for the lua commands? Did you try using a new turtle?
Doyle3694 #10
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.
ChaosSlayer24 #11
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:/> .
ChaosSlayer24 #12
Posted 03 January 2013 - 11:05 AM
The problem is solved thanks for your guys's help. I appreciate it