Jump to content




Turtle dropping fuel while slot isn't selected


  • You cannot reply to this topic
6 replies to this topic

#1 ammy55

  • Members
  • 4 posts

Posted 05 June 2013 - 03:36 PM

I wrote a mining script that diigs a 3x3 hole to a user specified depth, but it doesn't work. When it goes to drop off it's load it drops its fuel and the chest used to check that it's in the right place. I tried adding print()'s before the slot select, and drop functions and those showed that the slots with its fuel and the chest are only being selected when they should be. Here's the code i'm using, http://pastebin.com/UhLit7EW, I hope someone can tell me why this is messing up.

#2 Lyqyd

    Lua Liquidator

  • Moderators
  • 8,465 posts

Posted 05 June 2013 - 03:38 PM

Split into new topic.

There is a bug wherein a turtle instructed to drop items from an empty slot will drop items from the next non-empty slot. Try ensuring that the selected slot contains at least one item before dropping.

#3 ammy55

  • Members
  • 4 posts

Posted 05 June 2013 - 03:41 PM

View PostLyqyd, on 05 June 2013 - 03:38 PM, said:

There is a bug wherein a turtle instructed to drop items from an empty slot will drop items from the next non-empty slot. Try ensuring that the selected slot contains at least one item before dropping.
That'd be it then. Glad it wasn't on my end. Do you know if this is fixed in 1.5.2 or if there is a fix in the pipeline?
Also thanks for the instant move and helpful reply.

#4 zazarath

  • Members
  • 10 posts

Posted 05 June 2013 - 03:45 PM

if you replace your function dropall() with this it should work

function dropall()
for i,1,14,1
  if turtle.getItemCount(i) > 0 then
   turtle.select(i)
   turtle.drop()
  end
end
turtle.select(1)
end


#5 ammy55

  • Members
  • 4 posts

Posted 05 June 2013 - 03:56 PM

I had to tweak it a little, but yes that does work! Thank you.

#6 theoriginalbit

    Semi-Professional ComputerCrafter

  • Moderators
  • 7,332 posts
  • LocationAustralia

Posted 05 June 2013 - 09:35 PM

View Postzazarath, on 05 June 2013 - 03:45 PM, said:

if you replace your function dropall() with this it should work

for i,1,14,1

for i = 1, 14 do
Some notes:
— you must assign i to something, not just comma it.
— @OP there are 16 slots in a turtle, I'm assuming 14 is deliberate?
— if you don't specify an increment of 1 it assumes it
— a for loop must have a `do` after defining the condition or increment.

#7 zazarath

  • Members
  • 10 posts

Posted 05 June 2013 - 11:47 PM

lol oops i mised do again can you imgine how long it takes me to bug fix =P i still new at this.
also should of realy tested before posting =P





1 user(s) are reading this topic

0 members, 1 guests, 0 anonymous users