Talk:Turtle (API)
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 (talk • contribs)
- 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()
- Would be interesting to see if one could write a function for that. ( Banane9 | Talk ) 22:43 - 9 March 2012
Contents |
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)
- Now in 1.4 there is the turtle.suck() function --Dadmob18 12:22, 27 Sep 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 (talk • contribs)
- 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.
Turtle API to detect block/item ID?
I have a suggestion, what if you have a function like: turtle.getBlockID() which would return ID, damage value, or simmilar
- Dan doesn't want Block IDs as they'd break the 4th wall. --Pinkishu 13:12, 16 August 2012 (CEST)
BlockIDs? Breaking the 4th wall? Weird, but fine. How about returning strings? "Wood", "Diamond", "Whatever"
More than 1 mover per turtle.up()
is there a way to make a turtle go up more than once for each turtle.up() ? like maybe turtle.up(36) (i tried that but it said attempt to call nil)
You could use:
turtleold = turtle.up function turtlenew(times) for i=1,times do turtle.up() end end turtle.up = turtlenew
Then just use turtle.up(5) and stuff, because it overrides the function.
If you want to make sure, the turtle wasn't blocked, you should add a return value. I'd also recommend sticking close to the regular interface, if you replace turtle.up(). To keep most regular uses working, maybe something like:
turtle.up = function(times) for i=1,times do if not turtle.up() then return false, i end end return true, times end ok, moves = turtle.up(5) if not ok then -- check for obstacles or fuel shortage etc. end
Can you tell the turtle to drop/not pick up unwanted items like dirt, cobble, sand and gravel?
Detecting Fluids
It seems as though water or lava aren't considered as blocks, and I was wondering if it would be possible to make it possible to detect a fluid but not directly, something like a fluid temperature attachment, and with that you could distinguish between water, lava and air and perhaps fire. As i said nothing too easy like a function that spits out a string like "water" or "lava" or "air". Just something that allows the programmer to make functions that can come to those conclusions.
--Sand 00:46, 7 October 2012 (EDT)
I have also just realized that if there is going to be a way to detect fluids, there will need to be a way to pick them up/ place them as well.
Anything
Whenever I try to do anything with a turtle, it says "No such program", and normally I am good at programming. How do I do even the simplest things with these turtles?
Please post this on the forums. It's easier to reply there. --Thesbros 17:25, 21 October 2012 (EDT)
Fighting game
Check out http://en.wikipedia.org/wiki/Crobots Just adding a ranged detect() that see's mobs and other turtles and we have crobot fighting games in minecraft :-D
Syntax Page
Shouldn't we use this syntax of table for all the others tables ? I think it's nice and clear ! Viproz 12:22, 29 March 2013 (MSK)
(change pages like this one : Paintutils_(API))