I have been playing around with the peripheral API and for some reason, two EXACTLY the same pieces of code give me trouble. For some odd reason it works on one Computer and it doesn't work on the other. This is the piece of code:
data = peripheral.getNames(side)
for i,j in pairs(data) do
type_peripheral = peripheral.getType(j)
print(i..": "..type_peripheral)
if type_peripheral == "monitor" then
mon = peripheral.wrap(data[i])
end
end
And for some reason this works on the other Computer:
data = peripheral.getNames(side)
for i,j in pairs(data) do
type_peripheral = peripheral.getType(j)
print(i..": "..type_peripheral)
if type_peripheral == "monitor" then
mon = peripheral.wrap(data[i])
mon.clear()
mon.write("Hello World!")
end
end
I hope you can help me.












