Posted 29 December 2012 - 01:47 PM
I have had some help with this code before but it needs a little more love :D/>
the error is line 44 " rednet.send(p1, "Floor " .. p2 .. ", " .. f[p2] .. " accepted.")" concatenate nil and string
rednet.open("back")
invalid = "ERROR: Not a valid floor."
f = {}
f[1] = "Automation"
f[2] = "Storage"
f[3] = "Agriculture"
f[4] = "Reactor control"
f[5] = "Matter generation"
f[6] = "Matter generation 2"
f[7] = "Living space"
f[8] = "Library"
f[9] = "Danger room"
f[10] = "Roof"
f[11] = invalid
f[12] = invalid
f[13] = invalid
f[14] = invalid
f[15] = invalid
f[16] = invalid
g = {}
g[1] = "white"
g[2] = "Lightblue"
g[3] = "yellow"
g[4] = "magenta"
g[5] = "purple"
g[6] = "lime"
g[7] = "orange"
g[8] = "red"
g[9] = "pink"
g[10] = "green"
g[11] = "brown"
g[12] = "cyan"
g[13] = "blue"
g[14] = "black"
g[15] = "gray"
g[16] = "lightGray"
while true do
e, p1, p2 = os.pullEvent()
if e == "rednet_message" then
rednet.send(p1, "Floor " .. p2 .. ", " .. f[p2] .. " accepted.")
if colors[g[p2]] then rs.setBundledOutput("right", colors[g[p2]]) end
elseif e == "redstone" then
rs.setBundledOutput("right", rs.getBundledInput("left") == 0 and rs.getBundledOutput("right") or rs.getBundledInput("left"))
end
end
the error is line 44 " rednet.send(p1, "Floor " .. p2 .. ", " .. f[p2] .. " accepted.")" concatenate nil and string