Posted 04 May 2013 - 10:04 PM
I've recently run into a problem with my turtle strip mine program.
Code:
http://pastebin.com/bmsyqq5w
I just implemented the placeChest() function in which the turtle chooses between which type of chest the user decided and either places it down or goes back to the beginning of the mine and places all of it's items in the chest. My problem is with the last option. The turtles gets to the chest and drops off it's items perfectly but when it tries to go back to where it was, it goes on forever. I don't understand why because it should only go forward however long the tunnel was (as defined by 'totforw') When looking inside the console I can see that the turtle is still adding 'totforw' even though 'inMainTunnel' was declared as false on line 64 right before it goes back. I have no idea why but I think it either has something to do with the lop I am using to get back or I am somehow declaring 'inMainTunnel' as true. Also, a lot of the code is unused and unfinished at the moment. I am also new to programming and a lot of my code is quite sloppy and not thought through very well. Sorry, if it's hard to understand.
Help is appreciated!
Thanks! :D/>
Code:
http://pastebin.com/bmsyqq5w
I just implemented the placeChest() function in which the turtle chooses between which type of chest the user decided and either places it down or goes back to the beginning of the mine and places all of it's items in the chest. My problem is with the last option. The turtles gets to the chest and drops off it's items perfectly but when it tries to go back to where it was, it goes on forever. I don't understand why because it should only go forward however long the tunnel was (as defined by 'totforw') When looking inside the console I can see that the turtle is still adding 'totforw' even though 'inMainTunnel' was declared as false on line 64 right before it goes back. I have no idea why but I think it either has something to do with the lop I am using to get back or I am somehow declaring 'inMainTunnel' as true. Also, a lot of the code is unused and unfinished at the moment. I am also new to programming and a lot of my code is quite sloppy and not thought through very well. Sorry, if it's hard to understand.
Help is appreciated!
Thanks! :D/>