peripheral.getNames
Returns the network names of all peripherals connected to the computer. You can pass these to peripheral.getType, peripheral.getMethods, peripheral.isPresent, and peripheral.wrap.
|
|||
| Prints the network name and type of all connected peripherals. | |||
| Code | <nowiki>
for _, name in pairs(peripheral.getNames()) do
print(name, peripheral.getType(name))
end
</nowiki>
|
||
Functions | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
| Lua |
| ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| CC:Tweaked |
| ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| peripheral.getNames Function | |
|---|---|
|
Syntax peripheral.getNames() | |
| Returns | table |
| API | peripheral |
| Source | CC:Tweaked (source) |
This article is issued from Computercraft. The text is licensed under Creative Commons - Attribution - Sharealike. Additional terms may apply for the media files.