Jump to content




Editing Sethblings Flintify


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

#1 awesomness1290

  • Members
  • 69 posts

Posted 19 September 2014 - 01:41 AM

im trying to put sethblings flintify program into my world but I don't want manually put gravel into the turtle. Heres my code, I don't know how to add the code in a box:

local args = { ... }

if #args >= 1 then
  local slot = tonumber(args[1])

  if slot and slot >= 1 and slot <= 16 then
    turtle.select(slot)
  end
end

while true do
  if not turtle.place() then
    turtle.suckUp()
    break
  end
  if not turtle.dig() then
    break
  end
end 

Edited by awesomness1290, 01 February 2015 - 10:06 PM.


#2 KingofGamesYami

  • Members
  • 3,002 posts
  • LocationUnited States of America

Posted 19 September 2014 - 02:54 AM

put [code] and [/code] tags around the code.

local args = { ... }

if #args >= 1 then
  local slot = tonumber(args[1])

  if slot and slot >= 1 and slot <= 16 then
    turtle.select(slot)
  end
end

while true do
  if not turtle.place() then
    turtle.suckUp()
    break
  end
  if not turtle.dig() then
    break
  end
end 

Edited by KingofGamesYami, 19 September 2014 - 02:55 AM.


#3 awesomness1290

  • Members
  • 69 posts

Posted 19 September 2014 - 03:52 AM

ok thanks but can you help with my code problems?

#4 Bomb Bloke

    Hobbyist Coder

  • Moderators
  • 7,099 posts
  • LocationTasmania (AU)

Posted 19 September 2014 - 05:42 AM

You're on the right track - I see you've added to the original, beats me how he managed to create a half-hour video around it - but you're still breaking out of the while loop whenever the turtle fails to dig or place a block.

So I assume your problem is that the turtle stops whenever it runs out of gravel. If it's not, please be specific as to what your issue is.

#5 awesomness1290

  • Members
  • 69 posts

Posted 20 September 2014 - 12:54 AM

what the turtle is doing is pretty much just taking gravel then stopping. that's all

#6 Bomb Bloke

    Hobbyist Coder

  • Moderators
  • 7,099 posts
  • LocationTasmania (AU)

Posted 20 September 2014 - 01:45 AM

Ok, so... given that breaking out of your while loop would cause that, have you tried not breaking out of the while loop...?

That is to say: Delete the lines that say "break".

#7 awesomness1290

  • Members
  • 69 posts

Posted 20 September 2014 - 03:25 AM

it works but now it doesn't pull items from the chest

#8 Bomb Bloke

    Hobbyist Coder

  • Moderators
  • 7,099 posts
  • LocationTasmania (AU)

Posted 20 September 2014 - 03:31 AM

I'm guessing, because you haven't specified, but did you perhaps put the chest under the turtle instead of on top of it? If so, you'd want to use turtle.suckDown() instead.

#9 awesomness1290

  • Members
  • 69 posts

Posted 20 September 2014 - 03:45 AM

I have a me interface on top and I changed the code so instead of the turtle.suckUp() under "if not turtle.place() then" to under the "end" under "if not turtle.dig() then" if that made sense, but I only want 1 stack at all times and it puts as many as possible.

Edited by awesomness1290, 20 September 2014 - 03:48 AM.


#10 Bomb Bloke

    Hobbyist Coder

  • Moderators
  • 7,099 posts
  • LocationTasmania (AU)

Posted 20 September 2014 - 04:28 AM

I have a hunch that if you put that line back where it was things'll work just fine. The turtle will place blocks until it can't any more, than once it runs out, draw a stack from your interface.

You could rig it to try and keep exactly 64 items at all times, but that's added complexity for absolutely no gain. All it needs is "more than none".





1 user(s) are reading this topic

0 members, 1 guests, 0 anonymous users