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

turtle.suck() - Only sucking a certain amount of items

Started by J-Nutz, 19 May 2014 - 05:34 PM
J-Nutz #1
Posted 19 May 2014 - 07:34 PM
Hello World!

I am new to the ComputerCraft Forums and was hoping I could get some help with my felling program. I am trying to make a lumber jack script and was wondering how you could make the turtle suck up a certain amount of items based on how many are needed to make it a full stack.

For example, I need to restock the bonemeal and seen as the amount of bonemeal used each time is random, I can't just have it suck up a certain amount each time to fill the stack.

Thanks in advance for any help. :)/>
Edited on 19 May 2014 - 05:59 PM
CCGrimHaxor #2
Posted 19 May 2014 - 08:44 PM

turtle.suck(number_here)
J-Nutz #3
Posted 19 May 2014 - 09:08 PM
CCGrimHaxor

Thanks a lot for the reply. :D/>

I'll figure out some sort of way to incorporate that in my program using turtle.getItemCount() to find the remainder and suck the required amount.

Really should of put two and two together on this one. Having a 'Slow' day I guess.
CometWolf #4
Posted 19 May 2014 - 09:31 PM
Actually i don't think turtle.suck accepts any arguments
http://computercraft.info/wiki/Turtle.suck
If you have openP installed however, you could use that. Or you could check the rest of the turtle inventory for bonemeal after sucking it up, and drop the extras back in.
J-Nutz #5
Posted 20 May 2014 - 12:00 AM
CometWolf

I Haven't had a chance to test what he said so I'll take your word for it.

I will probably end up doing that but I was just looking for a more efficient way to go about doing it.

One more thing, seen as I am trying to make this as efficient as possible, what happens if I have it drop the remainder in and then next time it goes to suck, it only sucks up like 4? Then It would have to go and suck up more in a little bit.

Thanks for all of your help!
Edited on 19 May 2014 - 10:01 PM
macss_ #6
Posted 20 May 2014 - 12:33 AM
Actually i don't think turtle.suck accepts any arguments
http://computercraft...iki/Turtle.suck
If you have openP installed however, you could use that. Or you could check the rest of the turtle inventory for bonemeal after sucking it up, and drop the extras back in.

I'm quite noob about computercraft yet, but I saw in direwolf20 MOD SPOTLIGHT that since computercraft 1.6 the turtle.suck() accept arguments.

EDIT

http://youtu.be/S731LoSHYXw?t=36m57s
Edited on 19 May 2014 - 10:53 PM
J-Nutz #7
Posted 20 May 2014 - 12:41 AM
macss_

Thaks a lot for the information. :)/> You'll be teaching us all with it.

Really hope it does. Will make my program a lot easier!
macss_ #8
Posted 20 May 2014 - 12:54 AM
Thank you! Bro, and yes it is possible… :D/>
J-Nutz #9
Posted 20 May 2014 - 12:58 AM
Macss_

Yay! Thanks so much!

Program = 100 times easier. :)/>

Thanks a bunch for your help and the link.

Take it easy.
CometWolf #10
Posted 20 May 2014 - 08:53 AM
I wouldn't know, i don't use 1.6 :P/>
J-Nutz #11
Posted 20 May 2014 - 03:08 PM
CometWolf

It's all good man. :)/> I haven't really checked out 1.6 either. I've done most of my learning in the earlier versions.

Thanks for your input though! It's much appreciated.