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

computercraft opening programs in code

Started by hayhaycrusher, 11 April 2012 - 04:04 PM
hayhaycrusher #1
Posted 11 April 2012 - 06:04 PM
i know about shell.run("dj") but what i want to do is dj left,right,up and down in stead of just dj
MysticT #2
Posted 11 April 2012 - 06:11 PM
shell.run("dj", "left") – or "right", "up", "down", etc.
shell.run receives the program name/path, and the arguments you want to pass to the program.
hayhaycrusher #3
Posted 11 April 2012 - 06:23 PM
thank you so much
hayhaycrusher #4
Posted 11 April 2012 - 06:40 PM
it dosnt work it comes up with

usages:
dj play
dj play (side)
dj stop
MysticT #5
Posted 11 April 2012 - 07:54 PM
That's because you have to give it the right arguments:

shell.run("dj", "play", "left")
I never used the dj program and didn't check what was the arguments it needs, so I assumed that what you told was right (dj left,right,up and down).
shell.run() works like when you type in the terminal, so every word you would normally write must be a parameter for shell.run (wich is what happens when you type in the terminal).