Posted 27 June 2015 - 04:02 PM
So, I'm building a spawner room with different spawners right?
Well what I need help with is having buttons that when I click them they turn on or off the auto-spawners, and I have no idea how to do that. I have it so I can click the spawner and it outputs a signal to the correct spawner, but thats it.
It would be wonderful if anyone could help me.
EDIT:I am using Direwolf20's button API
My code current code is:
Well what I need help with is having buttons that when I click them they turn on or off the auto-spawners, and I have no idea how to do that. I have it so I can click the spawner and it outputs a signal to the correct spawner, but thats it.
It would be wonderful if anyone could help me.
EDIT:I am using Direwolf20's button API
My code current code is:
os.loadAPI("button")
os.loadAPI("bundle")
m = peripheral.wrap("top")
m.clear()
function fillTable()
button.setTable("WitherS", wither, 10,20,3,5)
button.setTable("Enderman", ender, 22,32,3,5)
button.setTable("Blaze", blaze, 10,20,8,10)
button.setTable("Pig", pig, 22,32,8,10)
button.screen()
end
function getClick()
event,side,x,y = os.pullEvent("monitor_touch")
button.checkxy(x,y)
end
function wither()
button.toggleButton("WitherS")
rs.setBundledOutput('back', colors.white)
print("WitherS")
end
function ender()
button.toggleButton("Enderman")
rs.setBundledOutput('back', colors.purple)
print("Enderman")
end
function blaze()
button.toggleButton("Blaze")
rs.setBundledOutput('back', colors.red)
print("Blaze")
end
function pig()
button.toggleButton("Pig")
rs.setBundledOutput('back', colors.pink)
print("Pig")
end
fillTable()
button.heading("Spawners on/off")
while true do
getClick()
end
Edited on 28 June 2015 - 11:50 PM