Jump to content




shrinking code?


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

#1 protexxi

  • Members
  • 51 posts

Posted 10 December 2013 - 04:37 PM

Ok so making a program use in this function to place items into a ender chest
turtle.select(1)
turtle.placeDown()
turtle.select(2)
turtle.dropDown()
turtle.select(3)
turtle.dropDown()
turtle.select(4)
turtle.dropDown()
turtle.select(5)
turtle.dropDown()
turtle.select(6)
turtle.dropDown()
turtle.select(7)
turtle.dropDown()
turtle.select(8)
turtle.dropDown()
turtle.select(9)
turtle.dropDown()
turtle.select(1)
turtle.digDown

I remember there was a way to do this in one line something like .drop(2,9)?

#2 Bubba

    Use Code Tags!

  • Moderators
  • 1,142 posts
  • LocationRHIT

Posted 10 December 2013 - 04:39 PM

Use a for loop:
for i=1,9 do
  turtle.select(i)
  turtle.dropDown()
end

You could condense that into one line, though it is unnecessary.

#3 protexxi

  • Members
  • 51 posts

Posted 10 December 2013 - 04:40 PM

thanks





1 user(s) are reading this topic

0 members, 1 guests, 0 anonymous users