10 posts
Posted 17 January 2013 - 01:33 AM
Hi,
I'm using these mining turtles on a feed the beast server and was wondering:
Could I run some code before the chunk, containing that turtle, unloads
and also
run some code after the chunk has (re)loaded?
The goal is to make it pick up where it left of. (Save the stack?)
Maybe something already exists and I wouldn't want to reinvent the wheel.
Grtz,
Jordi
1548 posts
Location
That dark shadow under your bed...
Posted 17 January 2013 - 01:38 AM
you cannot run before unloading. on chunk reload the startup file will run. I wouldn't worry much about this as the computercraft development want to make your turtle automatically resume where it left off if it is unloaded, even if you close the server
10 posts
Posted 17 January 2013 - 02:39 AM
follow ups :P/>
1) Can I write data somewhere, so it is retrievable on reload?
2) Can I change the startup file?
3) What happens when a turtle mines his friend?
4) What happens when a turtle puts something in a ender chest?
Grtz,
Jordi
7508 posts
Location
Australia
Posted 17 January 2013 - 02:43 AM
1) Can I write data somewhere, so it is retrievable on reload?
2) Can I change the startup file?
3) What happens when a turtle mines his friend?
4) What happens when a turtle puts something in a ender chest?
1) yes you can write to a file that is persistent on the turtle, take a look at file io in Lua :)/>
2) yes by making a program called startup
3) it mines the other turtle and places it in its inventory if there is space
4) same thing as when a player does it
10 posts
Posted 17 January 2013 - 02:48 AM
4) Which player?
Thanks a ton!!!!
2447 posts
Posted 17 January 2013 - 02:57 AM
Turtles can't interact with Vanilla ender chests as they're only accessible by players - and the inventory is stored with the players.
2088 posts
Location
South Africa
Posted 17 January 2013 - 02:58 AM
4) Which player?
Thanks a ton!!!!
Any player… The items will just be in the ender chest, if you're using pumps to suck items out, the items will be sucked out.
8543 posts
Posted 17 January 2013 - 07:33 AM
4) Which player?
Thanks a ton!!!!
Any player… The items will just be in the ender chest, if you're using pumps to suck items out, the items will be sucked out.
Again, this
does not apply to the vanilla ender chests; it only applies to the mod by the same name. Just to be doubly clear.
2088 posts
Location
South Africa
Posted 17 January 2013 - 08:08 AM
4) Which player?
Thanks a ton!!!!
Any player… The items will just be in the ender chest, if you're using pumps to suck items out, the items will be sucked out.
Again, this
does not apply to the vanilla ender chests; it only applies to the mod by the same name. Just to be doubly clear.
Yeah, my reply was 1 minute after Cloudy's and I hadn't seen his comment. Also, I don't use turtles so I went for the bullet…