solarfactory:70: attempt to index ? (a number value)
it should be turning on the black and white bundled cables that are sitting in the back
of the computer but It must be clashing with some code above, but I'm not sure what could. code:
Also, how would I make the copper round upto a multiple of 3?
btw, it makes solar pannels.
mon = peripheral.wrap("left")
x=0
while true do
if true then
mon.clear()
mon.setCursorPos(1,1)
mon.write(" *** Solar Pannel Factory *** ")
mon.setCursorPos(1,2)
mon.write("-------------------------------------")
mon.setCursorPos(1,4)
mon.write(" Use the Computer to input how many ")
mon.setCursorPos(1,5)
mon.write(" solar pannels you would like to make")
end
print("how many panels would you like to make?")
x = tonumber(io.read())
y = x
if x ~= 0 then
break
end
os.sleep(1)
end
local glass = 3 * y
local coal = 3 * y
local riron = 4 * y
local iron = 8 * y
local redstone = 8 * y
local tin = 4 * y
local copper = 6.5 * y
local rubber = 13 * y
while true do
mon.clear()
mon.setCursorPos(1,1)
mon.write(" *** Solar Pannel Factory *** ")
mon.setCursorPos(1,2)
mon.write("-------------------------------------")
mon.setCursorPos(1,3)
mon.write(" You will need... ")
mon.setCursorPos(1,4)
mon.write(glass.." Glass ")
mon.setCursorPos(1,5)
mon.write(coal.." Coal ")
mon.setCursorPos(1,6)
mon.write(riron.." Refined Iron ")
mon.setCursorPos(1,7)
mon.write(iron.." Iron ")
mon.setCursorPos(1,8)
mon.write(redstone.." Redstone ")
mon.setCursorPos(1,9)
mon.write(tin.." Tin ")
mon.setCursorPos(1,10)
mon.write(copper.." Copper ")
mon.setCursorPos(1,11)
mon.write(rubber.." Rubber ")
print("Have you loaded the chests with the correct material? type 'yes' to continue...")
if io.read() == "yes" then
break
end
os.sleep(2)
end
if true then
redstone.setBundledOutput("back", colors.black+colors.white)
end