Jump to content




shell.run() - No such program


11 replies to this topic

#1 Wanjia

  • Members
  • 4 posts

Posted 05 June 2016 - 11:56 PM

View Posttfoote, on 24 July 2012 - 03:47 PM, said:

Yes. create this... (the program is to be named startup)
shell.run("your program") -- replace your program

When I try to do
shell.run("power")
or even
shell.run(power)
I get "No such program", but if I use
edit power
, I can edit my program.

How, why and how to fix?

Edited by Wanjia, 06 June 2016 - 04:07 PM.


#2 Bomb Bloke

    Hobbyist Coder

  • Moderators
  • 7,099 posts
  • LocationTasmania (AU)

Posted 06 June 2016 - 12:52 AM

Split from this old thread.

Is the "power" script sitting on the root of your computer's drive, or have you got it in a sub-directory...?

#3 TechnicalCoding

  • Members
  • 35 posts

Posted 06 June 2016 - 01:05 AM

Check if your program exist with:
write "lua" in console

then
-----------
if fs.exists("/power")==false then print("Program does not exist!")
elseif fs.exists("/power")==true then print("Program does exist but can't be opened somehow")
else print("Unknown error!") end


#4 Bomb Bloke

    Hobbyist Coder

  • Moderators
  • 7,099 posts
  • LocationTasmania (AU)

Posted 06 June 2016 - 01:07 AM

You can't spread that sort of code over multiple lines within the Lua console, though.

#5 TechnicalCoding

  • Members
  • 35 posts

Posted 06 June 2016 - 01:33 AM

View PostBomb Bloke, on 06 June 2016 - 01:07 AM, said:

You can't spread that sort of code over multiple lines within the Lua console, though.
In one line you can, it was not ment to be like that
...

#6 Wanjia

  • Members
  • 4 posts

Posted 06 June 2016 - 02:44 PM

View PostTechnicalCoding, on 06 June 2016 - 01:05 AM, said:

Check if your program exist with:
write "lua" in console

then
-----------
if fs.exists("/power")==false then print("Program does not exist!")
elseif fs.exists("/power")==true then print("Program does exist but can't be opened somehow")
else print("Unknown error!") end

This is how was shown:
Posted Image

#7 TechnicalCoding

  • Members
  • 35 posts

Posted 07 June 2016 - 12:39 PM

View PostWanjia, on 06 June 2016 - 02:44 PM, said:

View PostTechnicalCoding, on 06 June 2016 - 01:05 AM, said:

Check if your program exist with:
write "lua" in console
then
-----------
if fs.exists("/power")==false then print("Program does not exist!")
elseif fs.exists("/power")==true then print("Program does exist but can't be opened somehow")
else print("Unknown error!") end
This is how was shown:
Posted Image
Please upload your code to paste bin.
Then go into a NEW computer and write
pastebin get (pastebin url code) GetPowerBack
now if that was successfull it will download it, then you can rename it to power with
rename GetPowerBack power
I hope this works!

Edited by TechnicalCoding, 07 June 2016 - 12:42 PM.


#8 Wanjia

  • Members
  • 4 posts

Posted 07 June 2016 - 03:32 PM

I tried both advanced and normal computer (diffrent pastebins) but both won't run on startup
Posted Image

Posted Image

#9 Dog

  • Members
  • 1,177 posts
  • LocationEarth orbit

Posted 07 June 2016 - 04:36 PM

shell.run() is meant to be invoked from within a program or the Lua console, not from the command prompt. At the command prompt you just type the program name to run it.

Edited by Dog, 07 June 2016 - 04:55 PM.


#10 Wanjia

  • Members
  • 4 posts

Posted 07 June 2016 - 08:35 PM

so it should be like:
lua
lua>shell.run(power)
and this should make the power program startup everytime the game/world loads?

#11 KingofGamesYami

  • Members
  • 3,002 posts
  • LocationUnited States of America

Posted 07 June 2016 - 08:39 PM

No, it would be:
> power

If you want it to start everytime the game/world loads, then name it 'startup':
> mv power startup

Edited by KingofGamesYami, 07 June 2016 - 08:41 PM.


#12 Cloud Ninja

  • Members
  • 361 posts

Posted 07 June 2016 - 09:38 PM

shell.run() gets called from inside of lua or another program. To run a program without those 2, just type it into the terminal. so "power" is what you would type in (not in lua, just shell)





1 user(s) are reading this topic

0 members, 1 guests, 0 anonymous users