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

Making a batch file

Started by OmegaPaladin, 29 August 2012 - 12:02 AM
OmegaPaladin #1
Posted 29 August 2012 - 02:02 AM
I'm just getting my feet wet in LUA, and I'm finding remarkably hard to run something as simple as a batch file.


shell.setDir(ccSensors)
shell.run(monitor top dash_reactor)


The ingame help was unhelpful, and I read through the wiki. My plan was to eventually make this into a startup file so that I have a simple reactor readout.
Luanub #2
Posted 29 August 2012 - 02:18 AM
CC can only run Lua scripts not batch files. You would have to put together a translator to get the batch files to work(there might already be one in the programs section if I remember properly).
OmegaPaladin #3
Posted 29 August 2012 - 07:16 AM
CC can only run Lua scripts not batch files. You would have to put together a translator to get the batch files to work(there might already be one in the programs section if I remember properly).

Well, I wrote a two-line lua script that should change to the correct directory and then run the program with the arguments I gave.
Luanub #4
Posted 29 August 2012 - 07:30 AM
If the program is in Lua all you have to do to run it is use shell.run(). It uses absolute paths so..


shell.run("monitor", "top", "ccSensors/dash_reactor")

Make sure you're using the double quotes and comma's.
OmegaPaladin #5
Posted 30 August 2012 - 04:52 AM
If the program is in Lua all you have to do to run it is use shell.run(). It uses absolute paths so..
 shell.run("monitor", "top", "ccSensors/dash_reactor") 
Make sure you're using the double quotes and comma's.

Thanks, that worked.