Jump to content




How to send GPS coordinates?


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

#1 Wilma456

  • Members
  • 187 posts
  • LocationGermany

Posted 10 June 2016 - 04:58 PM

How can I send GPS coordinates like the GPS Program?

#2 Creator

    Mad Dash Victor

  • Members
  • 2,168 posts
  • LocationYou will never find me, muhahahahahaha

Posted 10 June 2016 - 05:46 PM

Through the modem api. Your computer needs to know it's position, and when prompted, it should send the coordinates.

local modem = peripheral.wrap(side)
modem.transmit(channel, replyChannel, {x=x,y=y,z=z})

Edited by Creator, 11 June 2016 - 11:49 AM.


#3 Dragon53535

  • Members
  • 973 posts
  • LocationIn the Matrix

Posted 11 June 2016 - 08:19 AM

Creator, that's not rednet at all, that's the modem api. Which is the correct thing to do, you'd need to use the modem api as that also sends the distance from the server.

I would take a look at the modem api's page.

Like creator did, you need to wrap the modem, and then transmit the message. When receiving you need to pull modem_message events and correctly figure out the block you are currently on by testing the distances versus the coordinates sent and doing some math. I don't know the exact math, but I believe it's either algebra or trig.

Each node needs to know it's actual coordinates however.

If you don't entirely understand, just check out the gps program's source.

Edited by Dragon53535, 11 June 2016 - 08:21 AM.


#4 Creator

    Mad Dash Victor

  • Members
  • 2,168 posts
  • LocationYou will never find me, muhahahahahaha

Posted 11 June 2016 - 09:40 AM

I know it's not rednet. I just dislike rednet and avoid using it at all costs.

Edited by Creator, 11 June 2016 - 11:49 AM.


#5 Dragon53535

  • Members
  • 973 posts
  • LocationIn the Matrix

Posted 11 June 2016 - 10:27 AM

You however specifically stated rednet, and then used the modem api. I felt it necessary to point out the fact that the two were different.


Edit: You also misspelled rednet the first time on your last post.

Edited by Dragon53535, 11 June 2016 - 10:27 AM.


#6 Creator

    Mad Dash Victor

  • Members
  • 2,168 posts
  • LocationYou will never find me, muhahahahahaha

Posted 11 June 2016 - 11:49 AM

View PostDragon53535, on 11 June 2016 - 10:27 AM, said:

You however specifically stated rednet, and then used the modem api. I felt it necessary to point out the fact that the two were different.


Edit: You also misspelled rednet the first time on your last post.

Yeah, my bad. Just noticed.

#7 Wilma456

  • Members
  • 187 posts
  • LocationGermany

Posted 11 June 2016 - 02:58 PM

I have taken code from gps and changed it. Thankyou all.





3 user(s) are reading this topic

0 members, 3 guests, 0 anonymous users