Difference between revisions of "Redstone.getBundledOutput"

From ComputerCraft Wiki
Jump to: navigation, search
(Undo revision 1968 by 91.121.27.33 (talk))
(Changing int to number)
 
(2 intermediate revisions by 2 users not shown)
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={{type|string}} side
<p>''rs.setBundledOutput("back", colors.red+colors.yellow)''</p>
+
|api=redstone
<p>''end''</p>''
+
|returns={{type|number}} 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>
+
[[Category:Lua_Core_Functions]]
<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>
+

Latest revision as of 11:50, 18 July 2013


Grid Redstone.png  Function redstone.getBundledOutput
No description provided.
Syntax redstone.getBundledOutput(string side)
Returns number 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.