864 posts
Location
Sometime.
Posted 08 March 2012 - 05:08 AM
Looking into making a possible API for farmer turtles.
Works like this
————————-
turtle.use("DIRECTION")
That's really it..
715 posts
Posted 08 March 2012 - 05:43 AM
You can already do this with the current turtle (or with every function in Lua that uses String indices).
turtle.forward() really is just the function 'forward' inside the table 'turtle' and thus can also be called like this:
turtle["forward"]()
Therefore if you want to use a variable for movement then you can do something like:
local moveVar = "forward"
turtle.[moveVar]()
– Now some code happens where moveVar changes to 'back'
moveVar = "back"
turtle.[moveVar]()
I'd suggest you take a look at how tables work in Lua, because that is THE most central data structure in Lua (the only one really).
Almost everything in Lua is using tables. :mellow:/>/>
864 posts
Location
Sometime.
Posted 08 March 2012 - 04:10 PM
Nonono.. I meant use like right clicking with a tool equipped by a turtle.
715 posts
Posted 08 March 2012 - 04:24 PM
Ah, sorry. I misunderstood you then.
Thought the "use" part was meant like: "use this direction".
But about your initial idea: you can't make a turtle do that, at least not with Lua.
Or how exactly did you plan on doing that? I mean, you must've had a plan before creating this thread? :mellow:/>/>
864 posts
Location
Sometime.
Posted 09 March 2012 - 12:17 AM
Yes, yes I did. Working with some help from my clan. I'm actually making a .class file for it. Can't do it with lua so if I added a new function to a class file and added it, it should be able to do that.
1111 posts
Location
Portland OR
Posted 10 March 2012 - 06:03 AM
Wouldnt it be, faster, easier, and more efficient to setup a flooder that washes your harvest to a Buildcraft obsidian pipe and pipe the harvest directly into chest? You can even sort the seeds from the harvest.
Turtles to plant with would be bomb, but there is already better ways to harvest.
864 posts
Location
Sometime.
Posted 06 April 2012 - 08:43 PM
Yes.. but I get bored and I like to challenge myself. This would also be simpler and all the time.