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

Turtle. Parameters

Started by mrpoopy345, 06 December 2013 - 03:41 PM
mrpoopy345 #1
Posted 06 December 2013 - 04:41 PM
I think it would be a cool idea to make it so we could type in something like…

turtle.forward("9")
And it would move the turtle forward 9 blocks.
Lyqyd #2
Posted 06 December 2013 - 04:44 PM

local oldtf = turtle.forward

turtle.forward = function(count)
  local count = tonumber(count) or 1
  for i = 1, count do
    oldtf()
  end
end
Cranium #3
Posted 09 December 2013 - 10:21 AM
In case you're not sure, Lyqyd just showed you how you are able to do this already. It's not hard at all and you can do this with any functions.
Edited on 09 December 2013 - 09:22 AM