Talk:Turtle (API)

From ComputerCraft Wiki
Revision as of 13:48, 8 August 2012 by Beetle mac (Talk | contribs) (it's --> its)

Jump to: navigation, search

Is there a way to detect a block's type? Preferably without picking it up; it would be nice to be able to write a function to check the block about to be broken against a list of "Do not break" blocks, such as Industrial craft's MFSU, which loses all held power when picked up.

Also I request a way to set server-wide list of blocks immune to the turtle.dig() functions, such as say personal safes (Industrial Craft again).— Preceding unsigned comment added by 50.131.199.48 (talkcontribs)

As far as I know, there's no way to check the block type with the current API. Could be a feature in the future though, never know. ( Scarfacial | Talk ) 22:17 - 8 March 2012
Would be interesting to see if one could write a function for that. ( Banane9 | Talk ) 22:43 - 9 March 2012
i would see it too please. But i dont think that you can make that in a function
Dude 22:13, 9 March 2012 (UTC)
You can determine if the block matches the one in its inventory using turtle.select(slot) and then turtle.compare() or turtle.compareUp() or turtle.compareDown()

turtle collect ?

i understand that the turtle can drop items from its inventory with turtle.drop( [amount] ) but is there a way to make the turtle collect items (like a player would do) around and store it in inventory ? (from what i understand right now the turtle collects items taken from a digged block ? thanks

Nope they don't collect items that are already dropped --Banane9 12:22, 11 July 2012 (UTC)

treefarm

i have write a big programm (120 lines) that destory the tree full (with the leaves) when the tree is grown. so the turtle can plant an new tree an beginn at the start. My problem: the programm dont work and i cant find the faults... — Preceding unsigned comment added by Dude (talkcontribs)

Maybe because the leaves of the tree decay and that f*cks up the code? We cant help you without seeing your code ;) --Banane9 12:22, 11 July 2012 (UTC)
On a similar note, I have written a disassembler script which (mostly) disassembles arbitrary things from the top down, but it really gets messed up by doors and other turtles and pistons, it is basically because interacting with blocks only works well if the blocks don't change while you are trying to deal with them/use them for navigating.