Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- -- Funkce pro hledání všech periferíí a kontrolu, zda je to Logistics Pipe
- local function findLogisticsPipe()
- local sides = {"top", "bottom", "left", "right", "front", "back"} -- Strany pro modem
- for _, side in ipairs(sides) do
- if peripheral.isPresent(side) then
- local peripheralType = peripheral.getType(side)
- print("Nalezena periferie na straně: " .. side .. " (" .. peripheralType .. ")")
- -- Zkontrolujeme, zda typ obsahuje "LogisticsPipes"
- if peripheralType:find("LogisticsPipes") then
- print("Nalezena Logistics Pipe na straně: " .. side)
- return peripheral.wrap(side) -- Vrátí odkaz na periferii
- end
- end
- end
- return nil -- Nenalezena žádná Logistics Pipe
- end
- -- Hlavní program
- local lp = findLogisticsPipe()
- if lp then
- print("Úspěšně nalezena Logistics Pipe!")
- else
- print("Nenalezena žádná Logistics Pipe. Zkontrolujte připojení!")
- end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement