Posted 20 September 2015 - 08:40 AM
Hey, guys, I 've been working on this little turtle mining script for awhile now, and have sorted out most of my bugs. I however have one lingering one that seems to be in my returnAndUnload() function.
Source:
http://pastebin.com/XQaq8neb
And I finally got wise and had program generate a log, which is here:
http://pastebin.com/tdUt6QeG
Looking at the log and the program itself, it works fine until it reaches a point where it has to go back to the starting position for any reason (full inv./ no fuel) Inside the returnAndUnload function() it saves it's location to a variable lastGoodLoc, then exits into another function to travel (travelTo()) back to the starting position, startLoc. Once traveled, it returns back into the returnAndUnload() func. but all of the sudden the lastGoodLoc is wiped, and no longer points to where it should.
All this can be pretty easily found by looking at the two files. However, for the life of me I can't figure out where the error is. I'm guessing it's a lifespan or related issue?
Anyway, any help would be amazing, since I'm tearing my hair out!
Cheers!
-Julian
Edit: forgot to mention, travelTo() is @ line 250, and returnAndUnload is @ line 322
Source:
http://pastebin.com/XQaq8neb
And I finally got wise and had program generate a log, which is here:
http://pastebin.com/tdUt6QeG
Looking at the log and the program itself, it works fine until it reaches a point where it has to go back to the starting position for any reason (full inv./ no fuel) Inside the returnAndUnload function() it saves it's location to a variable lastGoodLoc, then exits into another function to travel (travelTo()) back to the starting position, startLoc. Once traveled, it returns back into the returnAndUnload() func. but all of the sudden the lastGoodLoc is wiped, and no longer points to where it should.
All this can be pretty easily found by looking at the two files. However, for the life of me I can't figure out where the error is. I'm guessing it's a lifespan or related issue?
Anyway, any help would be amazing, since I'm tearing my hair out!
Cheers!
-Julian
Edit: forgot to mention, travelTo() is @ line 250, and returnAndUnload is @ line 322
Edited on 20 September 2015 - 06:41 AM