Posted 06 August 2014 - 10:56 PM
Hello,
It's me again with an other bug again for posting again!
I've setup a tree farm and at one point the turtle needs to refuel the 3 stacks of bone meal.
Since the amount to reload depends of the bone meal consumed, i've written this script to make the turtle sucks just what it needs. But I don't know why it always takes too much.
Sometimes it even makes me a stack of 123 items and when I click on it it became just one item (not shown in the video)
Here's my code:
It sucks just 3 times. the first time it takes 64 (since the maximum amount we can suck in one full stack) the second one too and the third time it is supposed to take 61.
But I have a bunch of bone meal I haven't even asked for…
Is it a bug or my code which is wrong? I think it's a bug but… who knows?
Video:
[media]http://www.youtube.com/watch?v=IDNHpQqhT_I[/media]
Furest
It's me again with an other bug again for posting again!
I've setup a tree farm and at one point the turtle needs to refuel the 3 stacks of bone meal.
Since the amount to reload depends of the bone meal consumed, i've written this script to make the turtle sucks just what it needs. But I don't know why it always takes too much.
Sometimes it even makes me a stack of 123 items and when I click on it it became just one item (not shown in the video)
Here's my code:
bonea = turtle.getItemSpace(5)
boneb = turtle.getItemSpace(6)
bonec = turtle.getItemSpace(7)
total = bonea+boneb+bonec
turtle.select(5)
print("total:"..total)
while total > 64 do
turtle.suck(64)
print("suck 64")
total = total - 64
print("reste:"..total)
sleep(2)
end
turtle.suck(total)
print("suck "..total)
print("final:"..total)
It sucks just 3 times. the first time it takes 64 (since the maximum amount we can suck in one full stack) the second one too and the third time it is supposed to take 61.
But I have a bunch of bone meal I haven't even asked for…
Is it a bug or my code which is wrong? I think it's a bug but… who knows?
Video:
[media]http://www.youtube.com/watch?v=IDNHpQqhT_I[/media]
Furest
Edited on 07 August 2014 - 07:58 AM