Jump to content
  • Sky
  • Blueberry
  • Slate
  • Blackcurrant
  • Watermelon
  • Strawberry
  • Orange
  • Banana
  • Apple
  • Emerald
  • Chocolate
  • Charcoal

Nibato

Members
  • Content Count

    3
  • Joined

  • Last visited

  • Days Won

    1

Posts posted by Nibato

  1. If you're talking about nibnav.pathfind() in particular, no. It lets you use your own callback for "plotting" the path. You basically pass it a callback function (getCost, it's documented in the code) and the callback should return a numerical weight if it's a reachable block or null if it's impassable. In other words, you provide the block data, all it does is find and return a path in said block data.

    The algorithm will try to find the path with the lowest weight cost. I'd recommend reading this article if you're unfamiliar with A* pathfinding.

    Now, It does check for the success of the movement functions for the purpose of changing/updating it's internal x,y,z coordinates. 

    nibnav.moveY/X/Z/XZ only move in straight lines, and they're basically meant to be helper functions used in conjuction with nibnav.pathfind()

    The code is pretty messy but you can look at this code to see an example of how it's used. This is my personal circular branch mining script, but it's still a heavy WIP so I don't have any documentation for it at the moment unfortunately. Look at genMap(), moveTo(), and getMoveCost(). genMap() generates a 2d bitmap of what the mine shaft will look like once it's completely dug out.

  2. This program will fetch a file from gist.

    As an added feature (and because I'm lazy and update my private scripts every 2 seconds), if you pass a file argument but omit the gist id, it will read the first line of the given file (if it exists) and try to parse the gist id from it. Look at the first line of the this very program/script for an example ;)

    USAGE: gist [<gist id>] <file name>
    If no gist id is given, and the file exists,
    the program attempts to read the id on
    the first line of the file in the following

    I probably won't ever add push support to it. I've not tried to break this in every way imaginable, but it seems to work well enough for my own use. Scream angry words and shake a big stick at me if you have any problems with it.

    Download

    License

  3. I wrote a simple robot navigation API/library for my own personal use, and figured someone else might be able to make use of it.

    I spent a good hour documenting all the code so hopefully it isn't too hard to figure out. Unfortunately though, I'm not the best at explaining things :P

    If you have any issues with it, just yell at me and I'll take a look at it.

    Download
    License

×
×
  • Create New...

Important Information

By using this site, you agree to our Terms of Use and Privacy Policy.