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

run

Started by dorky106, 28 August 2012 - 08:41 PM
dorky106 #1
Posted 28 August 2012 - 10:41 PM
So I made my crap little program, basicly just checking what color of bundled color is on.

But what I'm wondering is how do I run redpulse from my program?

I know its shell.run("redpulse")
but its asking for the variables
Grim Reaper #2
Posted 28 August 2012 - 10:52 PM
You can pass arguments you would normally use in the shell as parameters when using method calls:

shell.run( "redpulse", "arg1", "arg2", "etc" )
dorky106 #3
Posted 28 August 2012 - 11:12 PM
so for something like redpulse cause the 2 are ints it would be
shell.run("redpulse", "side", #, #)

New to lua, but I understand some things.
Grim Reaper #4
Posted 29 August 2012 - 12:20 AM
Exactly.
dorky106 #5
Posted 29 August 2012 - 12:33 AM
okay seeing how this is along the same lines of what I asked.



if rs.setBundleInput("back", colors.orange) then
rs.setBundleOutput("back", shell.run("redpulse", "back", 5, 1), colors.black)
end

Can't seem to get this to work. So asking how I can redpulse Bundled Cable.
Zoinky #6
Posted 30 August 2012 - 05:47 AM
How do I get it to use a variable? Like this:


i = 1
shell.run("excavate", "i")

Lol. Might be hard to understand. I'm trying to basicly make the excavate program from 1.4. Since I play Tekkit (Still on 1.3).

EDIT: Never mind. Figured it out. :)/>/> ( It was shell.run("excavate", i) )