Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- os.loadAPI("touch")
- mon = peripheral.wrap("right")
- rednet.open("top")
- mon.setTextScale(0.5)
- local t1 = touch.new("right")
- local t = t1
- function writeButtons()
- t1:add ("RDC", nil, 2, 2, 18, 8, colors.gray, colors.cyan)
- t1:add ("N-1", nil, 21, 2, 37, 8, colors.gray, colors.cyan)
- t1:add ("N-2", nil, 40, 2, 56, 8, colors.gray, colors.cyan)
- t1:add ("N-3", nil, 2, 10, 18, 16, colors.gray, colors.cyan)
- t1:add ("N-4", nil, 21, 10, 37, 16, colors.gray, colors.cyan)
- t = t1
- t:draw()
- end
- writeButtons()
- function Checkclick(p1)
- if p1 == "RDC" then
- rednet.broadcast("RDC")
- end
- if p1 == "N-1" then
- rednet.broadcast("N1")
- end
- if p1 == "N-2" then
- rednet.broadcast("N2")
- end
- if p1 == "N-3" then
- rednet.broadcast("N3")
- end
- if p1 == "N-4" then
- rednet.broadcast("N4")
- end
- end
- while true do
- local event, p1 = t:handleEvents(os.pullEvent())
- if event == "button_click" then
- t:flash(p1)
- Checkclick(p1)
- end
- end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement