Posted 14 August 2015 - 10:45 AM
this is my code
and i have this problem "MobSpwan:19: attempt to call nil"
os.loadAPI("Button")
m = peripheral.wrap("top")
m.clear()
local lightsOn = false
function toggleSpawners()
rednet.open("left")
if lightsOn then
print("Turning the lights ON")
rednet.broadcast("lightsON")
else
print("Turning the lights OFF")
rednet.broadcast("lightsOFF")
end
rednet.close("left")
end
function fillTable()
Button.setTable("Lights",spawnersOn,10,20,3,5)
Button.screen()
end
function getClick()
event,side,x,y = os.pullEvent("monitor_touch")
Button.checkxy(x,y)
end
function spawnersOn()
Button.toggleButton("Lights")
rednet.open("left")
lightsON = not lightsOn
toggleSpawners()
end
fillTable()
Button.heading("Mod Farm")
Button.label(1,4,"Lights")
toggleSpawners()
while true do
getClick()
end
and i have this problem "MobSpwan:19: attempt to call nil"
os.loadAPI("Button")
m = peripheral.wrap("top")
m.clear()
local lightsOn = false
function toggleSpawners()
rednet.open("left")
if lightsOn then
print("Turning the lights ON")
rednet.broadcast("lightsON")
else
print("Turning the lights OFF")
rednet.broadcast("lightsOFF")
end
rednet.close("left")
end
function fillTable()
Button.setTable("Lights",spawnersOn,10,20,3,5)
Button.screen()
end
function getClick()
event,side,x,y = os.pullEvent("monitor_touch")
Button.checkxy(x,y)
end
function spawnersOn()
Button.toggleButton("Lights")
rednet.open("left")
lightsON = not lightsOn
toggleSpawners()
end
fillTable()
Button.heading("Mod Farm")
Button.label(1,4,"Lights")
toggleSpawners()
while true do
getClick()
end