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

Turtle Tweaks (API)

Started by HPWebcamAble, 18 July 2015 - 10:30 PM
HPWebcamAble #1
Posted 19 July 2015 - 12:30 AM
Annoyed by 'turtle.digUp()' and 'turtle.inspectDown()', ect?

Wish they were 'turtle.dig("top")' or 'turtle.inspect("bottom")' ?

You've come the the right place!


Turtle Tweaks

Lets you pass sides to the turtle functions!

[attachment=2331:Turtle Tweaks API.png]

The API doesn't change the behavior of the default functions,
so it won't break existing scripts!


Download

http://pastebin.com/5fXEWeDW


New Functions:
SpoilerSee below for valid sides and directions


turtle.move( direction or side )
turtle.place( side )
turtle.dig( side )
turtle.detect( side )
turtle.inspect( side )
turtle.suck( side )
turtle.compare( side )
turtle.attack( side )
turtle.drop( side )
turtle.equip( side )

Google '<function> computercraft' to find the CC Wiki entry for each function
I'm not going to link them all :P/>

Valid Sides for most functions (pass as a string):
front,up,down

Valid Sides for 'turtle.equip'
left,right

Valid Directions:
forward,left,right,back,up,down
Note: left and right turn the turtle, and don't require fuel.

Passing an invalid side will throw the error '<side you gave> is not a valid side'
'turtle.move()' will error with 'Not a vaild side or direction'


All original functions will work.
For example, 'turtle.dig("front")' is the same as 'turtle.dig()'
Edited on 18 July 2015 - 11:11 PM
jerimo #2
Posted 19 July 2015 - 01:00 AM
The API doesn't change the function of the default functions,
so it won't break existing scripts! (Yes I know that's awkward wording)
"The API doesn't change the behavior of the default functions", might be a good alternative?

Other than that seems nice and to the point
HPWebcamAble #3
Posted 19 July 2015 - 01:11 AM
"The API doesn't change the behavior of the default functions", might be a good alternative?

Thanks, I'm tired :P/>