First off, the current code: http://pastebin.com/pLH2jAzk
Now, the issue:
The turtle runs fine, waiting for a sapling to grow into a tree before cutting it down. The issue comes when it goes to put the wood in/take saplings out of their respective chests. It keeps dropping the wood into the sapling chest. This is an issue since the wood from the wood chest is being pumped into a furnace to be turned into charcoal. I've been looking at this code for the past hour and apparently my brain isn't letting me see the issue.
Lumberjack turtle: Not dropping wood in correct chest
Started by AquatikJustice, Jun 15 2013 02:38 PM
3 replies to this topic
#1
Posted 15 June 2013 - 02:38 PM
#2
Posted 15 June 2013 - 07:34 PM
Split into new topic.
#3
Posted 15 June 2013 - 07:53 PM
Lines such as:
... aren't valid. It checks to see whether saplingChest == "right" is true, or if "Right" exists; since the term "Right" always exists (because you wrote it there!) the final result is always true.
Instead use:
... or better yet:
Or better yet, convert the user input to lower-case as soon as it's entered, and store it that way so you don't need to worry about it anywhere else in the program.
if saplingChest == "right" or "Right" then
... aren't valid. It checks to see whether saplingChest == "right" is true, or if "Right" exists; since the term "Right" always exists (because you wrote it there!) the final result is always true.
Instead use:
if saplingChest == "right" or saplingChest == "Right" then
... or better yet:
if string.lower(saplingChest) == "right" then
Or better yet, convert the user input to lower-case as soon as it's entered, and store it that way so you don't need to worry about it anywhere else in the program.
#4
Posted 15 June 2013 - 08:32 PM
Works perfectly now. Many thanks Bomb!
1 user(s) are reading this topic
0 members, 1 guests, 0 anonymous users











