Posted 30 December 2013 - 07:14 AM
alright, i cant figure this out, I'm trying to use the button.toggleButton in Direwolf's api and i cant figure out how to use it as a on/off. for instance when the button gets toggled on I want it to emit a redstone signal out of the computers back, and when the button gets toggled off I want it to stop the output.
This is the code i'm using:
And here is the button API: http://pastebin.com/HRbMF1Eg
Now in the api i see: button[name]["active"] = false
But how do i call this in a different script?
Help would be greatly appreciated!
And thanks for your time!
This is the code i'm using:
os.loadAPI("button")
mon = peripheral.wrap("right")
mon.clear()
function fillTable()
button.setTable("Test", test1, 1, 10, 1, 10)
button.screen()
end
function test1()
button.toggleButton("Test")
--and this is where i get stumped :/
end
function getClick()
event,side,x,y = os.pullEvent("monitor_touch")
button.checkxy(x,y)
end
fillTable()
while true do
getClick()
end
And here is the button API: http://pastebin.com/HRbMF1Eg
Now in the api i see: button[name]["active"] = false
But how do i call this in a different script?
Help would be greatly appreciated!
And thanks for your time!