Jump to content




turtle.getItemId()?


22 replies to this topic

#1 creepig

  • New Members
  • 3 posts

Posted 05 October 2012 - 12:39 PM

I know that you can compare items in a slot with known items in another slot to determine what item is in the selected slot, but that seems horribly inefficient to me, especially when working with large numbers of vanilla blocks. I really think that the Turtle API needs a getItemId() function that just returns the ID number (and maybe the damage value) of the item in the slot and leaves it up to the programmer to do the comparison. That would also allow for switching statements that perform different actions based on the ID value, leading to more efficient code.

#2 Kolpa

  • New Members
  • 260 posts
  • LocationGermany

Posted 05 October 2012 - 12:50 PM

it was already said that this is not going to happen

#3 Pyrodogg

  • Members
  • 16 posts

Posted 05 October 2012 - 04:45 PM

I know Dan is against this cause it's OP, lawl. Someday when I get time... i think i'm going to add this in to my own turtles.

It bothers me fundamentally. We now have turtles that can print pages, and books. They can communicate wirelessly, innately know what redstone wires are and can't frakking tell if blocks are dirt or stone </rant>

#4 creepig

  • New Members
  • 3 posts

Posted 05 October 2012 - 10:49 PM

 Pyrodogg, on 05 October 2012 - 04:45 PM, said:

I know Dan is against this cause it's OP, lawl.

Blocks that can craft, dig, move, and place blocks are not OP, but being able to more intelligently determine what's in your inventory is? I'll be blunt, that's downright stupid. I don't even see how it could be OP. It's simply a more efficient way of doing the same thing, without wasting unnecessary processor cycles by doing it inefficiently.

#5 Orwell

    Self-Destructive

  • Members
  • 1,091 posts

Posted 05 October 2012 - 11:13 PM

 creepig, on 05 October 2012 - 10:49 PM, said:

 Pyrodogg, on 05 October 2012 - 04:45 PM, said:

I know Dan is against this cause it's OP, lawl.

Blocks that can craft, dig, move, and place blocks are not OP, but being able to more intelligently determine what's in your inventory is? I'll be blunt, that's downright stupid. I don't even see how it could be OP. It's simply a more efficient way of doing the same thing, without wasting unnecessary processor cycles by doing it inefficiently.

Teleporting turtles are even more efficient. But all that just defeats the purpose. Computers/turtles are blind, they don't have eyes and crazy advanced image processors or some sort of sensors that recognize a hundres materials. It's just a clear border between a dumb moving block and an absurdly intelligent drone.

#6 PixelToast

  • Signature Abuser
  • 2,265 posts
  • Location3232235883

Posted 05 October 2012 - 11:37 PM

i suggested being able to get an items metavalue awhile ago, they didnt like it :C, i dont get why, its so useful

#7 Kolpa

  • New Members
  • 260 posts
  • LocationGermany

Posted 06 October 2012 - 02:25 AM

 abc, on 05 October 2012 - 11:37 PM, said:

i suggested being able to get an items metavalue awhile ago, they didnt like it :C, i dont get why, its so useful

Reading helps :D/> 2 people infront of you just explained

 Pyrodogg, on 05 October 2012 - 04:45 PM, said:

I know Dan is against this cause it's OP, lawl. Someday when I get time... i think i'm going to add this in to my own turtles.

It bothers me fundamentally. We now have turtles that can print pages, and books. They can communicate wirelessly, innately know what redstone wires are and can't frakking tell if blocks are dirt or stone </rant>

 Orwell, on 05 October 2012 - 11:13 PM, said:

 creepig, on 05 October 2012 - 10:49 PM, said:

 Pyrodogg, on 05 October 2012 - 04:45 PM, said:

I know Dan is against this cause it's OP, lawl.

Blocks that can craft, dig, move, and place blocks are not OP, but being able to more intelligently determine what's in your inventory is? I'll be blunt, that's downright stupid. I don't even see how it could be OP. It's simply a more efficient way of doing the same thing, without wasting unnecessary processor cycles by doing it inefficiently.

Teleporting turtles are even more efficient. But all that just defeats the purpose. Computers/turtles are blind, they don't have eyes and crazy advanced image processors or some sort of sensors that recognize a hundres materials. It's just a clear border between a dumb moving block and an absurdly intelligent drone.


#8 creepig

  • New Members
  • 3 posts

Posted 06 October 2012 - 02:57 AM

 Orwell, on 05 October 2012 - 11:13 PM, said:

 creepig, on 05 October 2012 - 10:49 PM, said:

 Pyrodogg, on 05 October 2012 - 04:45 PM, said:

I know Dan is against this cause it's OP, lawl.

Blocks that can craft, dig, move, and place blocks are not OP, but being able to more intelligently determine what's in your inventory is? I'll be blunt, that's downright stupid. I don't even see how it could be OP. It's simply a more efficient way of doing the same thing, without wasting unnecessary processor cycles by doing it inefficiently.

Teleporting turtles are even more efficient. But all that just defeats the purpose. Computers/turtles are blind, they don't have eyes and crazy advanced image processors or some sort of sensors that recognize a hundres materials. It's just a clear border between a dumb moving block and an absurdly intelligent drone.

And yet they somehow have the ability to tell if this is the same as that without having "crazy advanced image processors" to recognize materials. If they can't tell what something is, they can't tell if it's the same as something else. It's as simple as that, and the idea that they somehow shouldn't be capable of distinguishing is quite simply completely absurd.

#9 Sebra

  • Members
  • 726 posts

Posted 06 October 2012 - 06:35 AM

Check Peripheral section. Several Turtle Upgrades able to help you made already.

Someone definitely need to make "Denied suggestions and ToDo list" pinned in this section.

#10 Cloudy

    Ex-Developer

  • Members
  • 2,543 posts

Posted 06 October 2012 - 12:01 PM

Dan has never said its OP. Dan had only said it would break the fourth wall. Capabilities exist to compare items in the turtles inventory. There is no need to expose item ID's - if someone can prove that the existing capabilities are not enough then sure, we will think of solutions - however all we have been told is that they are difficult to use. Which isn't valid enough to be honest.

#11 PonyKuu

  • Members
  • 215 posts

Posted 06 October 2012 - 02:11 PM

 Cloudy, on 06 October 2012 - 12:01 PM, said:

if someone can prove that the existing capabilities are not enough then sure, we will think of solutions
My recent peatfarm example? Wheat growth detection? Lapis/redstone/nikolite/diamond/coal/uranium detection?

Other "white spot" - is the inventory interaction, since there are only two options - suck and drop.

#12 Sebra

  • Members
  • 726 posts

Posted 06 October 2012 - 02:25 PM

Yes. To distinguish blocks which cannot be in inventory. Even with Silk Touch.

#13 Cloudy

    Ex-Developer

  • Members
  • 2,543 posts

Posted 06 October 2012 - 02:29 PM

 PonyKuu, on 06 October 2012 - 02:11 PM, said:

 Cloudy, on 06 October 2012 - 12:01 PM, said:

if someone can prove that the existing capabilities are not enough then sure, we will think of solutions
My recent peatfarm example? Wheat growth detection? Lapis/redstone/nikolite/diamond/coal/uranium detection?

Other "white spot" - is the inventory interaction, since there are only two options - suck and drop.

Wheat growth detection wouldn't be able to be handled like this anyway - and the rest of them can be done if you provide a turtle with a block using silk touch (which is easier than ever to get in 1.3.2). Besides - I think the best way of detecting an item is being destructive - digging, and checking if an item has increased, or using turtle.compareTo() if it goes into a new slot. There is no way of us detecting what item is going to go into the slot at the time we mine, since it could be different every time we call it. Case in point, gravel and flint.

Suck and drop are more than enough to do most inventory interactions, including sorting etc. You just need a little ingenuity - where would the fun be if everything was handled to you on a plate?

#14 PonyKuu

  • Members
  • 215 posts

Posted 06 October 2012 - 03:33 PM

 Cloudy, on 06 October 2012 - 02:29 PM, said:

Wheat growth detection wouldn't be able to be handled like this anyway - and the rest of them can be done if you provide a turtle with a block using silk touch
And we have to start laking about inventory space. - there are 16 slots, and if you are playing with some mods - there are tons of different resources underground. And you have to tell turtle to mine all of them. Anyways, there a a solution, but... I don't talk about getItemID (), but some things are missing - like that wheat issue...

Quote

Besides - I think the best way of detecting an item is being destructive - digging, and checking if an item has increased, or using turtle.compareTo() if it goes into a new slot. There is no way of us detecting what item is going to go into the slot at the time we mine, since it could be different every time we call it. Case in point, gravel and flint.
Sometimes you want to know, whether that block worth mining or not to save inventory space and time. Destructive way in that cas - is not the way.

Quote

Suck and drop are more than enough to do most inventory interactions, including sorting etc. You just need a little ingenuity - where would the fun be if everything was handled to you on a plate?
Well, it's not enough really, since you can't have a chest with dirt and sand and have turtle make that... bog earth. You have to make a separate chest for dirt, and a separate chest for sand - that's an issue. Well, there are tons of dirt and sand, but if you want to use something more... rare in crafting - you should have a separate chest for each item. it's kinda siily, isn't it?

#15 Cloudy

    Ex-Developer

  • Members
  • 2,543 posts

Posted 06 October 2012 - 03:50 PM

 PonyKuu, on 06 October 2012 - 03:33 PM, said:

Sometimes you want to know, whether that block worth mining or not to save inventory space and time. Destructive way in that cas - is not the way.
But there is no way round it - I'm sorry about that, but there are technical concerns when it comes to comparing what you will receive when you're going to mine, before you actually do it - because there is really no way of doing it.

Quote

Well, it's not enough really, since you can't have a chest with dirt and sand and have turtle make that... bog earth. You have to make a separate chest for dirt, and a separate chest for sand - that's an issue. Well, there are tons of dirt and sand, but if you want to use something more... rare in crafting - you should have a separate chest for each item. it's kinda siily, isn't it?

No. It isn't. Chests are cheap - and if something is rare in crafting, surely you won't have more than 8 stacks of each - you can easily pull in many stacks from the chest, and then put back things that you don't want. It isn't rocket science.

#16 PonyKuu

  • Members
  • 215 posts

Posted 06 October 2012 - 04:05 PM

 Cloudy, on 06 October 2012 - 03:50 PM, said:

But there is no way round it - I'm sorry about that, but there are technical concerns when it comes to comparing what you will receive when you're going to mine, before you actually do it - because there is really no way of doing it.
OK, but can we solve somehow the wheat issue? Maybe special function for the farming turtle, which detects whether it has grown or not?

Quote

No. It isn't. Chests are cheap - and if something is rare in crafting, surely you won't have more than 8 stacks of each - you can easily pull in many stacks from the chest, and then put back things that you don't want. It isn't rocket science.
Yeah, but the main problem - is free space...
And, the thing I really don't like - is that any inventory is a black box. There are no way to know is there are something, and how much. By hand you can open the chest and look into it, but turtle can only suck items, and count them... And if there are no space in turtle's inventory - you should place items somwhere else, while you try to figure it out. Maybe some sort of inventory peripheral would be nice? For example, you peripheral.wrap() that inventory and be able to select slots in that inventory, count them and compare to something inside turtle's inventory...

#17 Cloudy

    Ex-Developer

  • Members
  • 2,543 posts

Posted 06 October 2012 - 04:42 PM

 PonyKuu, on 06 October 2012 - 04:05 PM, said:

OK, but can we solve somehow the wheat issue? Maybe special function for the farming turtle, which detects whether it has grown or not?

Look into database turtle peripheral.

Quote

Yeah, but the main problem - is free space...
And, the thing I really don't like - is that any inventory is a black box. There are no way to know is there are something, and how much. By hand you can open the chest and look into it, but turtle can only suck items, and count them... And if there are no space in turtle's inventory - you should place items somwhere else, while you try to figure it out. Maybe some sort of inventory peripheral would be nice? For example, you peripheral.wrap() that inventory and be able to select slots in that inventory, count them and compare to something inside turtle's inventory...

Turtles are going to remain blind when it comes to reading from an inventory - if you know you're reading from an inventory, you will have some idea as to what will be in that inventory anyway.

However, coming soon ™:

turtle.transfer( slot, [count] )

#18 PonyKuu

  • Members
  • 215 posts

Posted 06 October 2012 - 04:48 PM

Oh, mods for mods... Don't like that... OK, maybe I'll try that eventually...

Transfer sounds cool. Does it move a <count> number of items from selected slot to <slot>?

#19 Cloudy

    Ex-Developer

  • Members
  • 2,543 posts

Posted 06 October 2012 - 05:21 PM

Yep!

#20 PonyKuu

  • Members
  • 215 posts

Posted 06 October 2012 - 06:37 PM

Nice!





1 user(s) are reading this topic

0 members, 1 guests, 0 anonymous users