Difference between revisions of "Rednet.isOpen"
From ComputerCraft Wiki
MechaTallon (Talk | contribs) m |
m (Formatted code according to the Documentation_Standard) |
||
Line 10: | Line 10: | ||
{{Example | {{Example | ||
|desc=Checks if any side is opened, if so then tell the user. | |desc=Checks if any side is opened, if so then tell the user. | ||
− | |code=for n,m in ipairs(rs.getSides()) do if rednet.isOpen(m) then print(m.." is open!") else print(m.." isn't open!") end end | + | |code=for n,m in ipairs(rs.getSides()) do |
+ | if rednet.isOpen(m) then | ||
+ | print(m.." is open!") | ||
+ | else | ||
+ | print(m.." isn't open!") | ||
+ | end | ||
+ | end | ||
}} | }} | ||
}} | }} | ||
[[Category:API_Functions]] | [[Category:API_Functions]] |
Revision as of 09:04, 3 December 2012
Function rednet.isOpen | |
Checks to see if the side has rednet opened. | |
Syntax | rednet.isOpen(string side) |
Returns | boolean isOpen, if the side has rednet opened it returns true, else false. |
Part of | ComputerCraft |
API | rednet |
Examples
Example | |
Checks if any side is opened, if so then tell the user. | |
Code |
for n,m in ipairs(rs.getSides()) do if rednet.isOpen(m) then print(m.." is open!") else print(m.." isn't open!") end end |