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

shell.run() - No such program

Started by Wanjia, 05 June 2016 - 10:56 PM
Wanjia #1
Posted 06 June 2016 - 12:56 AM
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 on 06 June 2016 - 03:07 PM
Bomb Bloke #2
Posted 06 June 2016 - 01: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…?
TechnicalCoding #3
Posted 06 June 2016 - 02: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
Bomb Bloke #4
Posted 06 June 2016 - 02:07 AM
You can't spread that sort of code over multiple lines within the Lua console, though.
TechnicalCoding #5
Posted 06 June 2016 - 02:33 AM
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
Wanjia #6
Posted 06 June 2016 - 03:44 PM
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:
TechnicalCoding #7
Posted 07 June 2016 - 01:39 PM
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:
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 on 07 June 2016 - 11:42 AM
Wanjia #8
Posted 07 June 2016 - 04:32 PM
I tried both advanced and normal computer (diffrent pastebins) but both won't run on startup


Dog #9
Posted 07 June 2016 - 05: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 on 07 June 2016 - 03:55 PM
Wanjia #10
Posted 07 June 2016 - 09: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?
KingofGamesYami #11
Posted 07 June 2016 - 09: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 on 07 June 2016 - 07:41 PM
Cloud Ninja #12
Posted 07 June 2016 - 10: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)