Posted 29 February 2012 - 07:08 PM
I will post the programs/APIs I will make here with a brief description.
Feel free to use or modify any of them as long as you give me credit B)/>/>/>
Turtle ++ API
A small API that lets you use the basic turtle API but with params like tpp.forward(5) instead of using loops.
More features comming soon.
Type tpp.help() in lua to list the functions available.
[attachment=57:tpp.txt]
Code :
Feel free to use or modify any of them as long as you give me credit B)/>/>/>
Turtle ++ API
A small API that lets you use the basic turtle API but with params like tpp.forward(5) instead of using loops.
More features comming soon.
Type tpp.help() in lua to list the functions available.
[attachment=57:tpp.txt]
Code :
Spoiler
function help()
print("===Turtle ++ API===")
print("Uses/function list")
print("tpp.forward(n)")
print("tpp.back(n)")
print("tpp.up(n)")
print("tpp.down(n)")
print("tpp.left(n)")
print("tpp.right(n)")
print("tpp.dig(n)")
print("tpp.digUp(n)")
print("Press enter")
read()
print("tpp.digDown(n)")
print("tpp.place(n)")
print("tpp.placeUp(n)")
print("tpp.placeDown(n)")
print("tpp.clearInv()")
print("More comming soon :unsure:/>/>/>")
end
function forward(n)
turtle.forward()
if n ~= nil then
for i=2,n do
turtle.forward()
end
end
end
function back(n)
turtle.back()
if n ~= nil then
for i=2,n do
turtle.back()
end
end
end
function up(n)
turtle.up()
if n ~= nil then
for i=2,n do
turtle.up()
end
end
end
function down(n)
turtle.down()
if n ~= nil then
for i=2,n do
turtle.down()
end
end
end
function left(n)
turtle.turnLeft()
if n ~= nil then
for i=2,n do
turtle.turnLeft()
end
end
end
function right(n)
turtle.turnRight()
if n ~= nil then
for i=2,n do
turtle.turnRight()
end
end
end
function dig(n)
turtle.dig()
turtle.forward()
if n ~= nil then
for i=2,n do
turtle.dig()
turtle.forward()
end
end
end
function digUp(n)
turtle.digUp()
turtle.up()
if n ~= nil then
for i=2,n do
turtle.digUp()
turtle.up()
end
end
end
function digDown(n)
turtle.digDown()
turtle.down()
if n ~= nil then
for i=2,n do
turtle.digDown()
turtle.down()
end
end
end
function place(n)
turtle.place()
if n ~= nil then
for i=2,n do
turtle.back()
turtle.place()
end
end
end
function placeDown(n)
turtle.down()
turtle.placeUp()
if n ~= nil then
for i=2,n do
turtle.down()
turtle.placeUp()
end
end
end
function placeUp(n)
turtle.up()
turtle.placeDown()
if n ~= nil then
for i=2,n do
turtle.up()
turtle.placeDown()
end
end
end
function clearInv()
for i=1,9 do
turtle.select(i)
turtle.drop()
end
turtle.select(1)
end