4 posts
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
7083 posts
Location
Tasmania (AU)
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…?
35 posts
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
7083 posts
Location
Tasmania (AU)
Posted 06 June 2016 - 02:07 AM
You can't spread that sort of code over multiple lines within the Lua console, though.
35 posts
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
…
4 posts
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:
35 posts
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
4 posts
Posted 07 June 2016 - 04:32 PM
I tried both advanced and normal computer (diffrent pastebins) but both won't run on startup
1220 posts
Location
Earth orbit
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
4 posts
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?
3057 posts
Location
United States of America
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
374 posts
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)