Posted 27 September 2012 - 10:34 PM
Hi all,
Firstly, one of the best mods in minecraft as far as I am concerned, thanks
for all the effort put into it. Prepare for the great wall of text. Can be seen from
space.
I wrote an involved turtle quarry.. Basically boils down to turtles in a row,
you define a lateral distance from a docking bay/drop-off point to each
turtle and it will mine downwards row for row all the way down to bedrock
and as far forward as you want (currently limiting it at 64 blocks forward).
When full the turle will return to its initial deployment point and from there
move towards the defined drop off point and empty its inventory. It will then
move back to the row it was busy excavating(before its inventory got full)
and continue excavating.
As I suspected when I started writing said turtle quarry I would need a system
in place to save the state of each turtle so it can continue atleast almost
seamlessly after restarting my world.
The quarry itself works great, no bugs except maybe for creatures getting in
the way(which I can fix in CC 1.4 pretty easily with turtle.attack in a small
loop to confirm that i am actually at bedrock and not trying to mine a zombie).
Also this is not a train smash as the turtle will just skip that row and move
on to the next. The state file also works great in most cases. My question is
in regards to the rest of the cases.
I noticed that if I leave my world when a turtle is half way during a movement
it will complete its movement when restarting the world, obviously without
writing that movement into the state file. This is assuming I go with moving
and then saving the state. Obviously if I swap it around and save the state
before moving the same thing can occur. Infact in theory it is possible that i
can end up with an empty state file if I quit the world at exactely the right(wrong?)
time after opening the state file with the "w mode".
Is there any way for me to force the LUA to finish the current function(although I
highly doubt this) it is in before the world quits?
Any other suggestion to solve this problem would be greatly appreciated.
Even if it entails changing the way i handle the location/movement of
the individual turtles(even GPS) or the clearing of their inventories.
Initially i used a computer(with modem) and wireless mining turtles to handle
the docking. But much easier and less of a hassle to set-up by going with
normal mining turtles and some checking on movement. I guess I could
solve the problem by forcing the turles to stop, after docking, with a wireless
computer before i quit the world.
First prize however would be for them to automatically continue doing what they do.
Oupa Oorlog.
Firstly, one of the best mods in minecraft as far as I am concerned, thanks
for all the effort put into it. Prepare for the great wall of text. Can be seen from
space.
I wrote an involved turtle quarry.. Basically boils down to turtles in a row,
you define a lateral distance from a docking bay/drop-off point to each
turtle and it will mine downwards row for row all the way down to bedrock
and as far forward as you want (currently limiting it at 64 blocks forward).
When full the turle will return to its initial deployment point and from there
move towards the defined drop off point and empty its inventory. It will then
move back to the row it was busy excavating(before its inventory got full)
and continue excavating.
As I suspected when I started writing said turtle quarry I would need a system
in place to save the state of each turtle so it can continue atleast almost
seamlessly after restarting my world.
The quarry itself works great, no bugs except maybe for creatures getting in
the way(which I can fix in CC 1.4 pretty easily with turtle.attack in a small
loop to confirm that i am actually at bedrock and not trying to mine a zombie).
Also this is not a train smash as the turtle will just skip that row and move
on to the next. The state file also works great in most cases. My question is
in regards to the rest of the cases.
I noticed that if I leave my world when a turtle is half way during a movement
it will complete its movement when restarting the world, obviously without
writing that movement into the state file. This is assuming I go with moving
and then saving the state. Obviously if I swap it around and save the state
before moving the same thing can occur. Infact in theory it is possible that i
can end up with an empty state file if I quit the world at exactely the right(wrong?)
time after opening the state file with the "w mode".
Is there any way for me to force the LUA to finish the current function(although I
highly doubt this) it is in before the world quits?
Any other suggestion to solve this problem would be greatly appreciated.
Even if it entails changing the way i handle the location/movement of
the individual turtles(even GPS) or the clearing of their inventories.
Initially i used a computer(with modem) and wireless mining turtles to handle
the docking. But much easier and less of a hassle to set-up by going with
normal mining turtles and some checking on movement. I guess I could
solve the problem by forcing the turles to stop, after docking, with a wireless
computer before i quit the world.
First prize however would be for them to automatically continue doing what they do.
Oupa Oorlog.