Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- os.loadAPI("api")
- os.loadAPI("touchpoint")
- mon = peripheral.wrap("right")
- mon.clear()
- mon.setTextScale(1)
- local t = touchpoint.new("right")
- t:add("Spawner 1", toggle, 1, 1, 29, 3, colors.red, colors.lime)
- t:draw()
- mon.setBackgroundColor(colors.black)
- mon.setTextColor(colors.white)
- function toggle()
- state = redstone.getOutput("left")
- stateChanged = false;
- if state == false then
- stateChanged = true
- else
- stateChanged = false
- end
- redstone.setOutput("left", stateChanged)
- end
- while true do
- local event, p1 = t:handleEvents(os.pullEvent())
- if event == "button_click" then
- t.buttonList[p1].func()
- end
- end
Advertisement
Add Comment
Please, Sign In to add comment