Jump to content




Autorun GPS hosts



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

#1 jewelshisen

  • Members
  • 164 posts

Posted 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?

#2 theoriginalbit

    Semi-Professional ComputerCrafter

  • Moderators
  • 7,332 posts
  • LocationAustralia

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.

#3 jewelshisen

  • Members
  • 164 posts

Posted 09 January 2013 - 07:08 PM

 TheOriginalBIT, on 09 January 2013 - 07:06 PM, said:

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.

#4 theoriginalbit

    Semi-Professional ComputerCrafter

  • Moderators
  • 7,332 posts
  • LocationAustralia

Posted 09 January 2013 - 07:09 PM

oh derp, of course it does... lol...

so doing
shell.run( "gps", "host", x, y, z )
doesn't work?

#5 jewelshisen

  • Members
  • 164 posts

Posted 09 January 2013 - 07:13 PM

 TheOriginalBIT, on 09 January 2013 - 07:09 PM, said:

oh derp, of course it does... lol...

so doing
shell.run( "gps", "host", x, y, z )
doesn't work?

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.

#6 theoriginalbit

    Semi-Professional ComputerCrafter

  • Moderators
  • 7,332 posts
  • LocationAustralia

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.

#7 jewelshisen

  • Members
  • 164 posts

Posted 09 January 2013 - 07:18 PM

 TheOriginalBIT, on 09 January 2013 - 07:16 PM, said:

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!

#8 theoriginalbit

    Semi-Professional ComputerCrafter

  • Moderators
  • 7,332 posts
  • LocationAustralia

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 :)

#9 jewelshisen

  • Members
  • 164 posts

Posted 09 January 2013 - 07:24 PM

 TheOriginalBIT, on 09 January 2013 - 07:20 PM, said:

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.

#10 remiX

  • Members
  • 2,076 posts
  • LocationSouth Africa

Posted 10 January 2013 - 12:13 AM

 TheOriginalBIT, on 09 January 2013 - 07:16 PM, said:

. Also "gps host" should be separate as "gps", "host"

You can run arguments through shell.run() with spaces. So he can use "gps host"

#11 theoriginalbit

    Semi-Professional ComputerCrafter

  • Moderators
  • 7,332 posts
  • LocationAustralia

Posted 10 January 2013 - 12:31 AM

 remiX, on 10 January 2013 - 12:13 AM, said:

 TheOriginalBIT, on 09 January 2013 - 07:16 PM, said:

. Also "gps host" should be separate as "gps", "host"

You can run arguments through shell.run() with spaces. So he can use "gps host"
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

#12 Lyqyd

    Lua Liquidator

  • Moderators
  • 8,465 posts

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).





3 user(s) are reading this topic

0 members, 3 guests, 0 anonymous users