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

[Suggestion] Turtle 'move' Event

Started by Liraal, 27 February 2012 - 09:02 PM
Liraal #1
Posted 27 February 2012 - 10:02 PM
How about adding to the default turtle API a 'move' event? It's second param would be the direction of movement. Ik you can do that with external functions, but i suppose some people would still use default, making any degree of control impossible. I don't want to modify the ROM either, cause my programs are to be fully SMP-compatible. What do you think?
Advert #2
Posted 27 February 2012 - 10:57 PM
I think this is kind of redundant.
You could use something like this:

local turtle = turtle
function forward()
 if turtle.forward() then
  os.queueEvent("move", "forward")
  return true
 end
 return false
end
<insert for other turtle functions>

There's certainly no harm from adding this, though.

You could potentially replace the turtle.* functions when you load your program, though; and this could add the move-event.