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

Possible to add to the Turtle OS functions?

Started by Ampix0, 11 May 2013 - 11:32 PM
Ampix0 #1
Posted 12 May 2013 - 01:32 AM
I have written some functions for the turtle I will use for basically every single bot I write, they just make the default API a little smarter and the actions more robust. I know some of you guys have made your own OS for the computers (which I have no idea how to do). Can it be done for a Turtle? Can someone show me a tutorial for this?
KaoS #2
Posted 12 May 2013 - 08:47 AM
basically modify the turtle functions in your startup file…

for example

local fd=turtle.forward
turtle.forward=function(num)
  num=tonumber(num) or 1
  for i=1,num do
    if not fd() then
	  return false,i
    else
	  --modify position recording
    end
  end
end