ComputerCraft Forums

ComputerCraft => Programs => Turtle Programs => Topic started by: informer on Feb 14, 2019, 02:37 am

Title: BTA - A Better Turtle API
Post by: informer on Feb 14, 2019, 02:37 am
After a decent amount of revision I'm going to release my turtle API to the public. It's pretty well commented so there shouldn't be much issue understanding it if you read through the code.

A caveat: I use gps for most if not all functions, I'll think about adding a way to keep your location with out it if people desire it.

Here is a quick rundown of the features added:
    Functions:
        calibrate() to the cardinal directions
        boxTo(destinationVector[, fn]) moves to every location between two coordinates
        goTo(vector[, fn]) moves the turtle to a specific vector
        move(direction[, fn][, count]) multiple times, foward-back-up-down
        refuel() checks inventory for fuel
        xMovement(distance[, fn]) moves the turtle along the x-axis
        yMovement(distance[, fn]) moves the turtle along the y-axis
        zMovement(distance[, fn]) moves the turtle along the z-axis
    Internal packages:
        turn.
            north(), south, (etc..) face the four cardinal directions
            spin(direction[, count]) multiple times
            toCardinal(str) face cardinal direction by user input
            getDirection() get current direction as a string value

Code Select
pastebin get MdD051uF bta
pastebin (https://pastebin.com/MdD051uF)
Title: BTA - A Better Turtle API
Post by: Jigokusaru on Dec 04, 2019, 05:56 pm
I'm sorry I'm not sure how this is used. I tried bta.goTo() and did nothing. am i stupid?