Jump to content




Wimpy Question But I'm New


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

#1 sekots

  • New Members
  • 1 posts

Posted 25 July 2013 - 07:56 PM

turtle.up(3) doesn't go up 3 times. It has no error, and it goes up 1 time. What am I supposed to put inside of the (). I've looked on the wiki but I can't find the list of codes for turtles.

#2 Lyqyd

    Lua Liquidator

  • Moderators
  • 8,465 posts

Posted 25 July 2013 - 11:14 PM

Split into new topic.

Movement functions don't take arguments:

turtle.up()
turtle.up()
turtle.up()

or:

for i = 1, 3 do
  turtle.up()
end


#3 Lord_Spelunky

  • Members
  • 60 posts

Posted 26 July 2013 - 04:14 AM

You could make a function that does it though, a bit like this
function up(amount)
  for i = 1, amount do
    turtle.up()
  end
end


#4 HurricaneCoder

  • Members
  • 52 posts

Posted 27 July 2013 - 04:57 AM

you don't have to put anything in the (). when ever there is () doesn't mean you have to enter something.

#5 Qix

  • Members
  • 7 posts

Posted 30 July 2013 - 05:29 AM

Another alternative:

turtle._up = turtle.up
turtle.up = function(amt)
   for i=1,amt do
	  turtle._up()
   end
end

That will override the original turtle API function and provide a function similar to what Lord_Spelunky suggested. To me, it's cleaner when calling the function.





1 user(s) are reading this topic

0 members, 1 guests, 0 anonymous users