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

[1.32 - 1.4] Additional Turtle API

Started by static_sprocket, 22 March 2012 - 04:31 PM
static_sprocket #1
Posted 22 March 2012 - 05:31 PM
Although I can understand that having Turtles consuming fuel is not something everyone would like to have, I think it's something that would benefit some servers.

For example on the OutlandCraft servers, we would like to consider having turtles require fuel. We would modify the turtle APIs ourselves, so that the various existing API's would take "action points" – and consuming some kind of fuel would provide those points. This is something we could code ourselves with a custom TurtleOS, if we had one or two new API methods provided by the CC module itself. We basically need a way to consume/destroy items from a turtle's inventory and some way to know what item was consumed. These could be seperate commands or a single command.

turtle.analyze(slot) – returns a unique string based on block id and metadata, possibly with server name thrown in. The string could be a hashcode or garbage string, that's a hash of ID, Meta, Server Name – as long as it's unique across all turtles on all worlds on a given server.

turtle.consume(slot) - this destroys, removes from inventory, 1 item from the given slot.

Alternatively it could be a single command, that both consumes an item from the stack in a slot and returns the analyze code.

Thanks for considering!
Neowulf #2
Posted 22 March 2012 - 09:01 PM
http://www.computercraft.info/forums2/index.php?/topic/598-14plugin-blockitem-api/ Bottom post.
Great minds think alike.