Difference between revisions of "Modem.isWireless"
From ComputerCraft Wiki
Iownall555 (Talk | contribs) (Created page with "{{Function |name=modem.isWireless |returns={{type|boolean}} isWireless |api=Modem |addon=ComputerCraft |desc=Returns true if a modem is wireless, false if it's wired. |example...") |
MKlegoman357 (Talk | contribs) m (Expanded) |
||
| (One intermediate revision by one other user not shown) | |||
| 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]] | ||
Latest revision as of 16:05, 9 April 2014
| 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
| 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 |