This is a read-only snapshot of the ComputerCraft forums, taken in April 2020.
resdac's profile picture

Check if modem is wireless or wired

Started by resdac, 10 August 2015 - 08:55 PM
resdac #1
Posted 10 August 2015 - 10:55 PM
sorry to be here again but i couldn't find an answer elsewere.
im looking for a way to check if the modem conected to the pc is wireless or wired. with the peripheral.getType() you can only see modem
is there a way to check this or must this be filled in manualy?
valithor #2
Posted 10 August 2015 - 10:56 PM
sorry to be here again but i couldn't find an answer elsewere.
im looking for a way to check if the modem conected to the pc is wireless or wired. with the peripheral.getType() you can only see modem
is there a way to check this or must this be filled in manualy?

You could use the isWireless function from the modem api example:

modem = peripheral.wrap(side)
modem.isWireless()
Edited on 10 August 2015 - 08:57 PM
KingofGamesYami #3
Posted 10 August 2015 - 11:18 PM
Or you could call it without wrapping:


peripheral.call( "side", "isWireless" )
Anavrins #4
Posted 11 August 2015 - 12:36 AM
You can also do this to automatically wrap wired/wireless only.

peripheral.find("modem", function(n, o) return o.isWireless() end)