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

Check for wireless modems ONLY

Started by houseofkraft, 31 October 2016 - 06:50 PM
houseofkraft #1
Posted 31 October 2016 - 07:50 PM
Hi Guys!

I am making a program and i want it to check if their is a wireless modem on the PC.

Thanks!

- House
Anavrins #2
Posted 31 October 2016 - 11:17 PM
The second argument of peripheral.find is a filter, you give it a function which takes two arguments and it will be ran against all the matching peripherals, if it returns true the peripheral will be returned, otherwise it won't.

local wl_modem = peripheral.find("modem", function(name, peri) return peri.isWireless() end)
Edited on 31 October 2016 - 10:19 PM