Lua PCI-Devices Example
The Computer API provides the getPCIDevices
function.
It allows us to search for currently installed PCI-Devices of a given type.
For this we first have to get the type of PCI-Device we want to reference with the findClass
function.
When you want to get all installed PCI-Devices, you can try to use the class for Actor or even Object since all PCI-Devices should be of that type.
|
Get GPUs
This example gives all GPU T1 installed.
You can see it as replacement for the getGPUs
function of older mod versions.
local GPUs = computer.getPCIDevices(findClass("FIN_GPU_T1"))
Get Network Card
This example gives the first Network Cards installed.
local NetworkCard = computer.getPCIDevices(findClass("NetworkCard"))[1]
Get Screen Drivers
This example gives all Screen Drivers installed.
You can see it as replacement for the getScreens
function of older mod versions.
local Screens = computer.getPCIDevices(findClass("FINComputerScreen"))