Difference between revisions of "Modem.isWireless"
From ComputerCraft Wiki
(Categorised page) |
MKlegoman357 (Talk | contribs) m (Expanded) |
||
Line 1: | Line 1: | ||
{{Function | {{Function | ||
− | |name=modem.isWireless | + | |name=''modem''.isWireless |
− | |returns={{type|boolean}} | + | |returns={{type|boolean}} is modem wireless? |
|api=Modem | |api=Modem | ||
|addon=ComputerCraft | |addon=ComputerCraft | ||
Line 7: | Line 7: | ||
|examples= | |examples= | ||
{{Example | {{Example | ||
− | |desc= | + | |desc=Prints whether the modem on top of the computer is wireless or wired. |
− | |code=modem.isWireless() | + | |code= local modem = [[peripheral.wrap]]("top") |
+ | |||
+ | if modem.isWireless() then | ||
+ | print("The modem on top of the computer is wireless.") | ||
+ | else | ||
+ | print("The modem on top of the computer is wired.") | ||
+ | end | ||
}} | }} | ||
}} | }} | ||
[[Category:API_Functions]] | [[Category:API_Functions]] |
Latest revision as of 16:05, 9 April 2014
Function modem.isWireless | |
Returns true if a modem is wireless, false if it's wired. | |
Syntax | modem.isWireless() |
Returns | boolean is modem wireless? |
Part of | ComputerCraft |
API | Modem |
Examples
Example | |
Prints whether the modem on top of the computer is wireless or wired. | |
Code |
local modem = peripheral.wrap("top") if modem.isWireless() then print("The modem on top of the computer is wireless.") else print("The modem on top of the computer is wired.") end |