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

turtle.getItemDamage

Started by nicolaieno, 17 March 2013 - 01:19 PM
nicolaieno #1
Posted 17 March 2013 - 02:19 PM
i have a suggestion for you.
the turtle.getItemCount(number) is good, but if you want to make a crafting turtle that repairs tools like bows it would be nice to have an turtle.getItemDamage(none or number) and i have made myself an code that should go around it but i have problems with it…
it does nothing else then repairing the item and then say "no item crafted" can you help me
<spoiler>repeat
sleep(4)
turtle.select(3)
if(shell.run("craft 1")==false)then
x=turtle.getItemCount(3)
print("false")
if(x=="1")then
print("x=1")
shell.run("redpulse back 1 2")
elseif(x==0)then
print("x=0")
shell.run("redpulse right 2 10")
sleep(10)
end
end
until(false)
</spoiler>
sorry wrong forum
Cruor #2
Posted 17 March 2013 - 02:56 PM
Split into new topic to suggestions. Hoping the topic title fits.
SuicidalSTDz #3
Posted 17 March 2013 - 02:59 PM
I actually like this idea; turtle.getItemDamage that is.
theoriginalbit #4
Posted 17 March 2013 - 03:39 PM
you could always compare it against a fully repaired item. since the damage value of the fully repaired item would be different if the item you are 'fixing' is not fully repaired. that being said it could be a nice addition.
Lyqyd #5
Posted 17 March 2013 - 03:55 PM
To be honest, I don't see this getting added, for reasons similar to why we aren't going to have getBlockID. It is a bit different, though. Only a dev can say!
Cloudy #6
Posted 17 March 2013 - 04:09 PM
Nah. Too magic.
SuicidalSTDz #7
Posted 17 March 2013 - 04:19 PM
Nah. Too magic.
Darn! Oh well ^_^/>
theoriginalbit #8
Posted 17 March 2013 - 04:20 PM
Nah. Too magic.
Darn! Oh well ^_^/>
Guess its just down to simple comparisons then. :P/>
SuicidalSTDz #9
Posted 17 March 2013 - 04:24 PM
Nah. Too magic.
Darn! Oh well ^_^/>
Guess its just down to simple comparisons then. :P/>
Indeed.. Hmm, since the devs rejected the idea, I guess someone might as well make a new API for this kind of thing ^_^/>
theoriginalbit #10
Posted 17 March 2013 - 04:26 PM
Indeed.. Hmm, since the devs rejected the idea, I guess someone might as well make a new API for this kind of thing ^_^/>
Go ahead. :P/>
SuicidalSTDz #11
Posted 17 March 2013 - 04:27 PM
Indeed.. Hmm, since the devs rejected the idea, I guess someone might as well make a new API for this kind of thing ^_^/>
Go ahead. :P/>
HA! Laugh is what SuicidalSTDz did on the 16 of March as TOBIT insisted he make a new api!
theoriginalbit #12
Posted 17 March 2013 - 04:36 PM
HA! Laugh is what SuicidalSTDz did on the 16 of March as TOBIT insisted he make a new api!
A look of confusion went over BIT's face on the 17th March as Suicidal confused him as to why he didn't want to make it.
Bubba #13
Posted 17 March 2013 - 04:37 PM
Maybe instead of turtle.getItemDamage, you could get turtle.worstItemDamage(slot1, slot2)? For example, I have a slightly damaged sword in slot 1, and a very damaged sword in slot 2. turtle.worstItemDamage(1,2) –> 2


Still too OP?
SuicidalSTDz #14
Posted 17 March 2013 - 04:41 PM
A look of confusion went over BIT's face on the 17th March as Suicidal confused him as to why he didn't want to make it.
Heh, Third Person is the best ^_^/> As for the api… I never plan on learning Java :P/>
theoriginalbit #15
Posted 17 March 2013 - 05:28 PM
Heh, Third Person is the best ^_^/> As for the api… I never plan on learning Java :P/>
Oh I thought you meant a Lua API not a peripheral…
SuicidalSTDz #16
Posted 17 March 2013 - 05:50 PM
Heh, Third Person is the best ^_^/> As for the api… I never plan on learning Java :P/>
Oh I thought you meant a Lua API not a peripheral…
Wait, why did I say API? I meant to say peripheral… Wow that was a bad derp <_</>