Jump to content




[LUA][QUESTION][PROGRAMMING] rs.setBundledOutput...

computer networking utility

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

#1 TheEisbaer

  • Members
  • 37 posts

Posted 25 September 2012 - 07:23 PM

I want to set the Computer 2 Colored Outputs to one bundled Cable.

I type in
rs.setBundletOuput("back", colors.organge) --> Orange Wire gets powered

Next, I type this
rs.setBundletOuput("back", colors.red) --> Red Wire gets powered , orange wire gets unpowered

----------------

This is what i'm trying

rs.setBundletOuput("back", colors.organge) --> Orange Wire gets powered
rs.setBundletOuput("back", colors.red) --> Red ANDOrange Wire gets powered

How do I have to do this?

#2 Matrixmage

  • Members
  • 116 posts
  • LocationAt my Computer coding for the Computer in my Computer

Posted 25 September 2012 - 07:26 PM

Hope it helps!
 
rs.setBundledOutput("back", colors.orange, colors.red)


#3 Cranium

    Ninja Scripter

  • Moderators
  • 4,031 posts
  • LocationLincoln, Nebraska

Posted 25 September 2012 - 07:27 PM

You are looking for the colors.combine() and colors.subtract() functions. Try this:
rs.setBundledOutput("back",colors.combine(colors.orange)) --orange wire on
rs.setBundledOutput("back",colors.combine(colors.red)) --orange stays on, red also turned on.
rs.setBundledOutput("back",colors.subtract(colors.orange)) --orange wire turned off, red still on
rs.setBundledOutput("back",0) --all colors turned off, no matter what
Hope that helps!

Edit: You can also add multiple colors at a time, by adding more colors in the parenthesis for colors.combine or colors.subtract. Like this:
rs.setBundledOutput("back",colors.combine(colors.red,colors.orange)) --both colors added at the same time.

Edited by Cranium, 25 September 2012 - 07:29 PM.


#4 TheEisbaer

  • Members
  • 37 posts

Posted 25 September 2012 - 07:30 PM

View PostMatrixmage, on 25 September 2012 - 07:26 PM, said:

Hope it helps!
rs.setBundledOutput("back", colors.orange, colors.red)
-

#5 TheEisbaer

  • Members
  • 37 posts

Posted 25 September 2012 - 07:31 PM

View PostCranium, on 25 September 2012 - 07:27 PM, said:

You are looking for the colors.combine() and colors.subtract() functions. Try this:
rs.setBundledOutput("back",colors.combine(colors.orange)) --orange wire on
rs.setBundledOutput("back",colors.combine(colors.red)) --orange stays on, red also turned on.
rs.setBundledOutput("back",colors.subtract(colors.orange)) --orange wire turned off, red still on
rs.setBundledOutput("back",0) --all colors turned off, no matter what
Hope that helps!

Edit: You can also add multiple colors at a time, by adding more colors in the parenthesis for colors.combine or colors.subtract. Like this:
rs.setBundledOutput("back",colors.combine(colors.red,colors.orange)) --both colors added at the same time.
Thanks :P/>

View PostMatrixmage, on 25 September 2012 - 07:26 PM, said:

Hope it helps!
rs.setBundledOutput("back", colors.orange, colors.red)
Thank you very much!

#6 TheEisbaer

  • Members
  • 37 posts

Posted 25 September 2012 - 07:38 PM

View PostCranium, on 25 September 2012 - 07:27 PM, said:

You are looking for the colors.combine() and colors.subtract() functions. Try this:
rs.setBundledOutput("back",colors.combine(colors.orange)) --orange wire on
rs.setBundledOutput("back",colors.combine(colors.red)) --orange stays on, red also turned on.
rs.setBundledOutput("back",colors.subtract(colors.orange)) --orange wire turned off, red still on
rs.setBundledOutput("back",0) --all colors turned off, no matter what
Hope that helps!

Edit: You can also add multiple colors at a time, by adding more colors in the parenthesis for colors.combine or colors.subtract. Like this:
rs.setBundledOutput("back",colors.combine(colors.red,colors.orange)) --both colors added at the same time.
Sry.. I tried in Lua Live Editor.. i think thats the problem :$$


rs.setBundledOutput("back",colors.combine(colors.orange)) --orange wire on
rs
.setBundledOutput("back",colors.combine(colors.red)) --orange stays on, red also turned on.

#7 Doyle3694

  • Members
  • 815 posts

Posted 25 September 2012 - 08:10 PM

use notepad++, it's the best :P/>

#8 Cranium

    Ninja Scripter

  • Moderators
  • 4,031 posts
  • LocationLincoln, Nebraska

Posted 25 September 2012 - 08:19 PM

I agree. Notepad++ is by far my favorite text editor now.





1 user(s) are reading this topic

0 members, 1 guests, 0 anonymous users