This is a read-only snapshot of the ComputerCraft forums, taken in April 2020.
pofferman's profile picture

repeat

Started by pofferman, 20 December 2015 - 04:47 PM
pofferman #1
Posted 20 December 2015 - 05:47 PM
Why doesnt the program "reapeat" support gps.locate() ?

Its really anoying. Help appreciated. Thanks
Yevano #2
Posted 20 December 2015 - 06:08 PM
Why doesnt the program "reapeat" support gps.locate() ?

Its really anoying. Help appreciated. Thanks

The gps API works by bouncing a signal directly off of 3 other computers and receiving their distances from you. That information is then used to triangulate your position in the world. Therefore, I'm guessing gps.locate just uses the wireless modem peripheral directly without going through the rednet protocol. This means that it won't try to have the signal pass through repeaters or even receive data from repeaters. As well, there wouldn't be much point of repeating your gps requests until you find the gps computers, because then the triangulated position would be that of the repeater which ends up sending the signal to the gps computers, and not your own computer.
pofferman #3
Posted 20 December 2015 - 09:19 PM
i guess your right :/
tanks tho
Bomb Bloke #4
Posted 21 December 2015 - 12:25 AM
Remember that if you're using advanced computers, it's fairly easy to have them run both the repeat and gps scripts at the same time. Create a startup script along these lines:

shell.run("bg repeat")
shell.run("gps host <x> <y> <z>")
Lupus590 #5
Posted 21 December 2015 - 12:29 AM
Remember that if you're using advanced computers, it's fairly easy to have them run both the repeat and gps scripts at the same time. Create a startup script along these lines:

shell.run("bg repeat")
shell.run("gps host <x> <y> <z>")

Can't you also use the parallel API?
Bomb Bloke #6
Posted 21 December 2015 - 12:42 AM
The display output would be a bit garbled, but for these scripts, I suppose that doesn't matter:

parallel.waitForAny(function() shell.run("repeat") end, function() shell.run("gps host <x> <y> <z>") end)
pofferman #7
Posted 21 December 2015 - 06:59 PM
How would this fix the problem? o.O
Lupus590 #8
Posted 21 December 2015 - 07:22 PM
it allows your repeating computers to at as gps hosts
Edited on 21 December 2015 - 06:22 PM