Posted 18 May 2016 - 06:01 PM
So for some reason when runing the below code, I get the error attempt to call nil at the peripheral.getType( side). I have CC 1.7 and the needed is 1.6 so that shouldnt be a problem, and I copy pasted the function from the wiki so it shouldnt be misspeleled either.
function getPeripherals()
–modem = peripheral.find("modem")
–drive = peripheral.find("drive")
sides = {"top", "bottom", "left", "right", "back"}
for i = 1,5 do
if i == 1 then
side = "top"
elseif i == 2 then
side = "bottom"
elseif i == 3 then
side = "left"
elseif i == 4 then
side = "right"
elseif i == 5 then
side = "back"
end
peripheral = peripheral.getType(side) –Problem lies here…
if peripheral == "drive" then
drive = side elseif
peripheral == "modem" then
modem = side
end
end
end
function getPeripherals()
–modem = peripheral.find("modem")
–drive = peripheral.find("drive")
sides = {"top", "bottom", "left", "right", "back"}
for i = 1,5 do
if i == 1 then
side = "top"
elseif i == 2 then
side = "bottom"
elseif i == 3 then
side = "left"
elseif i == 4 then
side = "right"
elseif i == 5 then
side = "back"
end
peripheral = peripheral.getType(side) –Problem lies here…
if peripheral == "drive" then
drive = side elseif
peripheral == "modem" then
modem = side
end
end
end