Difference between revisions of "Redstone.getBundledOutput"

From ComputerCraft Wiki
Jump to: navigation, search
(Created page with "if(rs.getBundledOutput("back") > "0") then rs.setBundledOutput("back", 0) else rs.setBundledOutput("back", colors.red+colors.yellow) ----")
 
Line 1: Line 1:
if(rs.getBundledOutput("back") > "0") then
+
<p>----------------------------------------------------------------------------</p>
rs.setBundledOutput("back", 0)
+
<p>''if(rs.getBundledOutput("back") > "0") then''</p>
else
+
<p>''rs.setBundledOutput("back", 0)''</p>
rs.setBundledOutput("back", colors.red+colors.yellow)
+
<p>''else''</p>
----
+
<p>''rs.setBundledOutput("back", colors.red+colors.yellow)''</p>
 +
<p>''end''</p>''
 +
<p>----------------------------------------------------------------------------</p>
 +
<p></p>
 +
<p></p>
 +
<p>this code will either power everything off or</p>
 +
<p>everything(dependant on the colours you use)</p>
 +
<p>on</p>
 +
<p></p>
 +
<p></p>
 +
<p>----------------------------------------------------------------------------</p>
 +
<p>''if(rs.getBundledOutput("back") > "0") then''</p>
 +
<p>----------------------------------------------------------------------------</p>
 +
<p>this part identifies ant bundled outputs that are on</p>
 +
<p>using the ''' ''greater than'' ''' symbol</p>
 +
<p>"''' ''>'' '''"</p>
 +
<p>after they are identified if they are on or not</p>
 +
<p>they are changed to the opposite state</p>
 +
<p></p>
 +
<p>1 = on</p>
 +
<p>0 = off</p>
 +
<p></p>
 +
<p>1 goes to 0</p>
 +
<p>0 goes to 1</p>

Revision as of 00:45, 29 June 2012

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

if(rs.getBundledOutput("back") > "0") then

rs.setBundledOutput("back", 0)

else

rs.setBundledOutput("back", colors.red+colors.yellow)

end

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

this code will either power everything off or

everything(dependant on the colours you use)

on

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

if(rs.getBundledOutput("back") > "0") then

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

this part identifies ant bundled outputs that are on

using the greater than symbol

" > "

after they are identified if they are on or not

they are changed to the opposite state

1 = on

0 = off

1 goes to 0

0 goes to 1