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

Turtle restart issue

Started by Cing, 11 April 2015 - 06:44 PM
Cing #1
Posted 11 April 2015 - 08:44 PM
hi everyone me again

i recently asked how to make a turtle that restart after the sever shutsdown and restart.
and this "http://pastebin.com/JziMy7eG" is the code.
But there is a problem that the turtle some times restart but then on block forward or to the right or something like that.

Does anybody know how i could improve this.
Lupus590 #2
Posted 11 April 2015 - 11:00 PM
But there is a problem that the turtle some times restart but then on block forward or to the right or something like that.

Could you rephrase this sentence, I'm struggling to understand what the problem you are having is.

I understand that English is hard, particularly for non-native speakers.
Edited on 11 April 2015 - 09:01 PM
Cing #3
Posted 11 April 2015 - 11:21 PM
Yeah sorry for my bad English

But the problem is that the information is saved before that the turtle moves or turn
So it starts at a different position
Lupus590 #4
Posted 11 April 2015 - 11:27 PM
Is this a turtle position tracker? Track the fuel level too, if the fuel is different to the recorded value then the turtle can know that a move was interrupted.
HPWebcamAble #5
Posted 11 April 2015 - 11:30 PM
Yeah sorry for my bad English

But the problem is that the information is saved before that the turtle moves or turn
So it starts at a different position

So you mean sometimes, the turtle saves its new position, but the server shuts down before it can move?

Try saving the position after the move
Kaikaku #6
Posted 11 April 2015 - 11:37 PM
hi everyone me again

i recently asked how to make a turtle that restart after the sever shutsdown and restart.
and this "http://pastebin.com/JziMy7eG" is the code.
But there is a problem that the turtle some times restart but then on block forward or to the right or something like that.

Does anybody know how i could improve this.

Not sure, but this could be the cause:
You are saving the coordinates and then do the movement. If the program stops between those two actions, the turtle gets the wrong coordinates on startup.

To check if this is the case, you could save before the movement (e.g. "current command: turn left") and after successful movement (e.g. "current command: none").
If on startup the file doesn't say "current command: none", then you know this caused the problems.
While this doesn't fix it (stopped before movement or before second save?), it would be interessting to know.

Go for GPS to ensure having the right coordinates.
Cing #7
Posted 11 April 2015 - 11:57 PM
Hpwebcamable i have already read online that it is the best to save the coords before the movement.

that is a great idea kaikaku and lupus thanks a lot i wil add it in my program

and i already tough of GPS i will maby also make a program using it.
Cing #8
Posted 12 April 2015 - 12:33 AM
thanks for all the reactions :D/>