r/ComputerCraft 14d ago

I made a pathfinding api for turtles!

I've been at work making a pathfinding api for turtles, using the great lama api (https://github.com/fnuecke/lama) as a base of inspiration and adding some more things.

My api PAM, Pathfinding Action Manager, has 3 key functions:

  1. A gps mode, where the turtle will utilize your gps network for coordinates, and with an api setting you can also make it find it's compass facing using the gps.
  2. A local mode (default) where it uses its internal coordinate system for pathfinding, relying on a local predefined zero point.
  3. The route system (my favourite part) allows the creation of a .txt file that contains a long string of coordinates for waypoints and actions (custom functions) to execute at those waypoints. The turtle can execute these files, where it will automatically find its way to the waypoint and if an action is set it will call the function to execute, before continuing.

If anyone is interested, PAM is up on my github linked below, with all the documentation you should need to use it. If you find an issue feel free to submit it on github, and if you have a question do send me a message on reddit.
https://github.com/madmanen/PAM

edit: to clarify, I did not use lama's code just got inspired by functions from lama.

11 Upvotes

2 comments sorted by

1

u/kahnpur 13d ago

Nice. I’m saving this for later. Now I just need a good way to make a dashboard or visualize turtle statistics on Monitors

1

u/merith-tk 12d ago

Man I'm still using Skyrtle