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

(Small change) Command Computers AutoGPS host

Started by manu_03, 20 February 2015 - 02:52 PM
manu_03 #1
Posted 20 February 2015 - 03:52 PM
I looked up into Command API and I saw commands.getBlockPosition()

My little idea is editing GPS program to make anything like this

...
if arg[1] == "host" and #arg == 1 then
    if command then
	   local x,y,z = commands.getBlockPosition()
	   host(x,y,z)
   end
end
...
That would be cool: You can make a computer with startup code "shell.run("gps host")" an copy (mid-click in GM 1) the computer, place in anywhere you want and easily host multiple GPS pos.

Tip for people if Dan deny it:
Edit startup and place this code:

local x,y,z = commands.getBlockPosition()
shell.run("gps","host",x,y,z)
HPWebcamAble #2
Posted 20 February 2015 - 06:45 PM
Tip for people if Dan deny it:
Edit startup and place this code:

local x,y,z = commands.getBlockPosition()
shell.run("gps","host",x,y,z)

Why not just do this anyway?
Geforce Fan #3
Posted 21 February 2015 - 12:41 AM
He wants it default.
/support
Edited on 20 February 2015 - 11:41 PM
MKlegoman357 #4
Posted 21 February 2015 - 11:46 AM
But when you think about it, to make it automatic you'll probably add a startup script anyways. So an extra line of code won't make too much of a difference here.
Bomb Bloke #5
Posted 21 February 2015 - 12:44 PM
I wouldn't even use two lines.

shell.run("gps host", commands.getBlockPosition())
dan200 #6
Posted 23 February 2015 - 03:48 PM
Good idea. On Command Computers, gps.locate() now delegates to commands.getBlockPosition() if it's available.
Creator #7
Posted 18 March 2015 - 11:13 PM
Good idea. On Command Computers, gps.locate() now delegates to commands.getBlockPosition() if it's available.

Yep, but the user may have his own coordinate system, which then would totally ruin the custom coordinates, because commands.getBlockPosition() uses the default ones.
Bomb Bloke #8
Posted 19 March 2015 - 09:46 AM
Then the user can translate that themselves. That's not a problem.