Can anybody help me?
This is a read-only snapshot of the ComputerCraft forums,
taken in April 2020.
Autorun GPS hosts
Started by jewelshisen, 09 January 2013 - 06:04 PMPosted 09 January 2013 - 07:04 PM
Ok i am tryin to make a startup program that will remove my need to manually start the gps hosts in my world. The main issue i have found is that if i try to use the shell api it makes the program unbreakable.
Can anybody help me?
Can anybody help me?
Posted 09 January 2013 - 07:06 PM
This is not the correct area. I have requested this move to "Ask a Pro"
as for the the answer:
just try using the GPS api.
as for the the answer:
just try using the GPS api.
Posted 09 January 2013 - 07:08 PM
This is not the correct area. I have requested this move to "Ask a Pro"
as for the the answer:
just try using the GPS api.
will not work. gps api only has the locate function.
Posted 09 January 2013 - 07:09 PM
oh derp, of course it does… lol…
so doing
so doing
shell.run( "gps", "host", x, y, z )
doesn't work?Posted 09 January 2013 - 07:13 PM
oh derp, of course it does… lol…
so doingdoesn't work?shell.run( "gps", "host", x, y, z )
yes it will but you can't break it. Here is what little code i tried.
while true do
Shell.run("gps host", "x", "y", "z")
End
While this does work it has the side effect of rendering the computer totally unusable for anything else.
Posted 09 January 2013 - 07:16 PM
no loop is needed there. its most likely why you cant terminate, since the loop would run the gps program the minute you terminate it.
also I is that typed and not copy/paste… if it was copy/paste i don't know how it works, Lua is case sensitive so Shell should be shell and End should be end. Also "gps host" should be separate as "gps", "host"… other than that using ctrl + t will terminate the running program.
also I is that typed and not copy/paste… if it was copy/paste i don't know how it works, Lua is case sensitive so Shell should be shell and End should be end. Also "gps host" should be separate as "gps", "host"… other than that using ctrl + t will terminate the running program.
Posted 09 January 2013 - 07:18 PM
no loop is needed there.
also I is that typed and not copy/paste… if it was copy/paste i don't know how it works, Lua is case sensitive so Shell should be shell and End should be end. Also "gps host" should be separate as "gps", "host"… other than that using ctrl + t will terminate the running program.
Yea i just figured out i do not need the loop but you can leave gps host together and it works fine. and i am typing this on my phone so it auto caps the first letter. but thanks for the help!
Posted 09 January 2013 - 07:20 PM
yeh, so thats what it was doing, each termination it just restarted it… could have sworn that last time i tried "gps host" the gps program errored out. maybe its been fixed… fair enough :)/>
Posted 09 January 2013 - 07:24 PM
yeh, so thats what it was doing, each termination it just restarted it… could have sworn that last time i tried "gps host" the gps program errored out. maybe its been fixed… fair enough :)/>/>
yea. thanks anyways and i'll try and remember to post help requests in the right section from now on.
Posted 10 January 2013 - 12:13 AM
. Also "gps host" should be separate as "gps", "host"
You can run arguments through shell.run() with spaces. So he can use "gps host"
Posted 10 January 2013 - 12:31 AM
as I said last time i trie that GPS threw an error. although that was a long time ago…. in a galaxy far, far away… :P/>. Also "gps host" should be separate as "gps", "host"
You can run arguments through shell.run() with spaces. So he can use "gps host"
Posted 10 January 2013 - 11:10 AM
Yeah, I have a vague memory that the space-separation used to happen elsewhere in the process of running things from the shell, so it would have objected to spaces in the arguments, but that is no longer the case (if it in fact was the case previously).