Jump to content




Turtle Tweaks (API)


2 replies to this topic

#1 HPWebcamAble

  • Members
  • 933 posts
  • LocationWeb Development

Posted 18 July 2015 - 11:30 PM

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!

Attached Image: 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:
Spoiler

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 by HPWebcamAble, 19 July 2015 - 12:11 AM.


#2 jerimo

  • Members
  • 74 posts

Posted 19 July 2015 - 12:00 AM

View PostHPWebcamAble, on 18 July 2015 - 11:30 PM, said:


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

#3 HPWebcamAble

  • Members
  • 933 posts
  • LocationWeb Development

Posted 19 July 2015 - 12:11 AM

View Postjerimo, on 19 July 2015 - 12:00 AM, said:

"The API doesn't change the behavior of the default functions", might be a good alternative?

Thanks, I'm tired :P





1 user(s) are reading this topic

0 members, 1 guests, 0 anonymous users