Jump to content




GPI - An intedependant gps system


  • You cannot reply to this topic
No replies to this topic

#1 Hydrotronics

  • Members
  • 131 posts
  • LocationThe hall of 1000 monkeys and only 1 typewriter

Posted 09 October 2016 - 02:13 PM

_____________

|GPI|

What is GPI?

GPI is an API based off the inbuilt GPS API. It will take note of where the turtle is and change the values of the internal table to keep up to date with its position.

Why did you make it?

I made it because I found myself using way more materials than I needed to keep track of where my turtle was so I made this. Also because others may run into the same problem but not know how / have enough time to make a program.

What changes does it make?

It overwrites the movement programs of the turtle API, while storing the old ones in shortened names. It also adds a few functions for setup and getting the values. Also a set of compass points are added to give ease with one of the functions.

How do I get it?

That's simple! Just type "pastebin run Yh0wCDKL" into the shell or console (depending if you're also running an OS) and you're good to go!

What are the functions and their syntax?

Ok, so this is a list of the functions and what they do:

gpi.locate([x],[y],[z]) --Returns the coordinates as well as the direction, if possible. Will return false if it can't get a value. You can also manually tell it where it was.

gpi.getDirection() --Returns just the direction. Will return false if a direction hasn't been determined

gpi.setDirection(<direction>) --Rotates the turtle to face the direction given. Requires compass point or numbers 0-3.

gpi.restore() --Restores old turtle functions.

gpi.[movement]() --Used as a replacement for the turtle functions. These are usable while the movement programs are also usable.

gpi.direction -- A variable with the numeric direction stored in it. It's best to not manually change this.
gpi.location -- A table with the coordinates stored in it. It's best to not manually change this.

Change log
Release 1.0 - 9/10/16 (9th Oct 2016)

Edited by LemonJelly, 09 October 2016 - 02:21 PM.






1 user(s) are reading this topic

0 members, 1 guests, 0 anonymous users