Posted 13 August 2012 - 02:22 PM
Hi i just made my self a new turtle api, it's sort of a derp mode/ do random moves for a turtle. I made it so i could learn stuff. I read the "How to make a api" thread, but with my stupidity, i did not understand how to make it useable.
If i was to make a new program, and make so it said "Want derp mode Y/n", then have it get a answer, and so on.
And then when i wanted to call derp mode i wanted to do it something like
sjTurtle.derpMode()
My questions: How would i add it to the rom/apis folder?
How would i get that name for it?
Thanks
Code:
This is my first api, and first time trying :P/>/>
Formatting messed up.
If i was to make a new program, and make so it said "Want derp mode Y/n", then have it get a answer, and so on.
And then when i wanted to call derp mode i wanted to do it something like
sjTurtle.derpMode()
My questions: How would i add it to the rom/apis folder?
How would i get that name for it?
Thanks
Code:
function randomWalk
local inf = noStop
while inf ~= stop do
sleep(.1)
way = math.random(1, 6)
if way == 1 then
turtle.forward()
elseif way == 2 then
turtle.back()
elseif way == 3 then
turtle.turnLeft()
turtle.forward()
elseif way == 4 then
turtle.turnLeft()
turtle.forward()
elseif way == 5 then
turtle.up()
elseif way == 6 then
turtle.down()
end
end
end
function content
print ("Content List")
print ("Name: Usage:")
print ("RandomWalk To be found out")
end
This is my first api, and first time trying :P/>/>
Formatting messed up.