3 posts
Posted 12 March 2012 - 08:35 PM
compare(), compareUp(), compareDown()
Compares the block in front/above/below with the one in the chosen slot. Returns true if they're the same, false otherwise.
Optionally: Accept an argument A and compare the block with the block in slot A.
compareSlots(a, b )
Compares item in slot A with item in slot B. Returns true if they're the same, false otherwise.
dropCount(n)
Drops N items from the selected slot. If the number is negative, drops all but -N.
137 posts
Location
the Netherlands
Posted 12 March 2012 - 08:40 PM
dropCount(n)
Drops N items from the selected slot. If the number is negative, drops all but -N.
I totally agree with that. When no argument is given, it should drop the whole stack (so that old programs still work). But with an argument it should drop that amount
I personally don't like your other commands, they are not very straightforward (getBlockID() and getBlockDataValue() would be better)
3 posts
Posted 12 March 2012 - 08:42 PM
Like someone said in another thread, block ids change between servers for nonstandard items.
473 posts
Location
Poland
Posted 12 March 2012 - 09:05 PM
and there's the little issue that the staff considers (and i cane to agree with them) that block id detection is magic.
IMO, turtle.detect() should return a numerical code of detected block/item assigned for that block/item by CC and not related to vanilla MC (may even vary depending on installed mods or config options). That way you get no 'real' info about the block, but you can make a turtle store params of typical blocks and be aware of them. You can even make it so that the block params are its physical params, like slipperiness, hardness, light level.
137 posts
Location
the Netherlands
Posted 12 March 2012 - 09:48 PM
(sarcasm alert!)
Ofcourse getting the ID of a block isn't something magical! The turtle shoots lightwaves of different colors at the material, to test the amount of light it absorbs at different wavelengths (colors, but also UV and IR).
Then it uses a secret fingerprint algorithm to change the data into a positive integer: the block ID.
(At least it is a better explanation than the one for the endless fuel :
http://computercraft.info/wiki/index.php?title=Turtle)
88 posts
Posted 12 March 2012 - 10:16 PM
thats not magic thats SCIENCE!
2447 posts
Posted 13 March 2012 - 11:30 AM
I just thought I'd point out that compare is now in and drop now accepts an argument which is the number of items to drop.