Jump to content




Making a batch file

lua help

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

#1 OmegaPaladin

  • Members
  • 6 posts

Posted 29 August 2012 - 01: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.

#2 Luanub

    Lua Nub

  • Members
  • 1,135 posts
  • LocationPortland OR

Posted 29 August 2012 - 01: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).

#3 OmegaPaladin

  • Members
  • 6 posts

Posted 29 August 2012 - 06:16 AM

View Postluanub, on 29 August 2012 - 01:18 AM, said:

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.

#4 Luanub

    Lua Nub

  • Members
  • 1,135 posts
  • LocationPortland OR

Posted 29 August 2012 - 06: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.

#5 OmegaPaladin

  • Members
  • 6 posts

Posted 30 August 2012 - 03:52 AM

View Postluanub, on 29 August 2012 - 06:30 AM, said:

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.





3 user(s) are reading this topic

0 members, 3 guests, 0 anonymous users