Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- shell.run("clear")
- rednet.open("back")
- black = colors.black
- white = colors.white
- green = colors.green
- red = colors.red
- blue = colors.blue
- gray = colors.gray
- lgray = colors.lightGray
- function cleL(line)
- term.clearLine(line)
- end
- function reset()
- term.setBackgroundColor(black)
- term.setTextColor(white)
- end
- function cbut(cx,cy,ctext,bcol,tcol)
- ncx = cx
- term.setCursorPos(cx, cy)
- term.setBackgroundColor(bcol)
- term.setTextColor(tcol)
- print(ctext)
- reset()
- end
- --## START SCREEN ##--
- cbut(4,4," ", red, black)
- cbut(4,5," START ", red, black)
- cbut(4,6," ", red, black)
- cbut(4,9, " ", red, black)
- cbut(4,10," XXXXX ", red, black)
- cbut(4,11," ", red, black)
- cbut(4,14," ", red, black)
- cbut(4,15," XXXXX ", red, black)
- cbut(4,16," ", red, black)
- sel = 1
- sel2 = 1
- --################--
- while true do
- evt, button, x, y = os.pullEvent("monitor_touch")
- if button == 1 then
- --ST--
- for mx = 4, 13, 1 do
- for my = 4, 6, 1 do
- if x == mx then
- if y == my then
- if sel == 0 then
- cbut(4,4," ", red, black)
- cbut(4,5," START ", red, black)
- cbut(4,6," ", red, black)
- sel = 1
- rednet.broadcast("ST OFF")
- elseif sel == 1 then
- cbut(4,4," ", green, black)
- cbut(4,5," START ", green, black)
- cbut(4,6," ", green, black)
- sel = 0
- rednet.broadcast("ST ON")
- end
- end
- end
- end
- end
- --ST--
- for mx = 4, 9, 1 do
- for my = 9, 11, 1 do
- if x == mx then
- if y == my then
- if sel2 == 0 then
- cbut(4,9, " " , red, black)
- cbut(4,10," XXXXX ", red, black)
- cbut(4,11," ", red, black)
- sel2 = 1
- rednet.broadcast("SC OFF")
- elseif sel2 == 1 then
- cbut(4,9, " ", green, black)
- cbut(4,10," XXXXX ", green, black)
- cbut(4,11," ", green, black)
- rednet.broadcast("SC ON")
- sel2 = 0
- end
- end
- end
- end
- end
- end
- end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement