Difference between revisions of "Redstone.getBundledOutput"

From ComputerCraft Wiki
Jump to: navigation, search
(Undo revision 1968 by 91.121.27.33 (talk))
(changed the content to the function template, anyone please review this - never used the function)
Line 1: Line 1:
<p>----------------------------------------------------------------------------</p>
+
{{lowercase}}
<p>''if(rs.getBundledOutput("back") > "0") then''</p>
+
{{Function
<p>''rs.setBundledOutput("back", 0)''</p>
+
|name=redstone.getBundledOutput
<p>''else''</p>
+
|args=[[string]] side
<p>''rs.setBundledOutput("back", colors.red+colors.yellow)''</p>
+
|api=redstone
<p>''end''</p>''
+
|returns=[[int (type)|int]] the value of the colors that are activated on that side
<p>----------------------------------------------------------------------------</p>
+
|addon=ComputerCraft
<p></p>
+
|examples=
<p></p>
+
{{Example
<p>this code will either power everything off or</p>
+
|desc=Prints the value of the active colors on the back
<p>everything(dependant on the colours you use)</p>
+
|code=[[print]] (redstone.getBundledOutput ("back"))
<p>on</p>
+
|output=the value of the colors, for example 1 if only white is active.
<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>
+
<p>----</p>
+
<p>----</p>
+
<p>----</p>
+
<p>Page created by [http://acecheesecr14.dlinkddns.com/ acecheesecr14]</p>
+

Revision as of 17:22, 8 July 2012


Grid Redstone.png  Function redstone.getBundledOutput
No description provided.
Syntax redstone.getBundledOutput(string side)
Returns int the value of the colors that are activated on that side
Part of ComputerCraft
API redstone

Examples

Grid paper.png  Example
Prints the value of the active colors on the back
Code
print (redstone.getBundledOutput ("back"))
Output the value of the colors, for example 1 if only white is active.