Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- shell.run("clear")
- black = colors.black
- red = colors.red
- green = colors.green
- white = colors.white
- blue = colors.blue
- bnorm = black
- tnorm = white
- brown = colors.brown
- cyan = colors.cyan
- orange = colors.orange
- yellow = colors.yellow
- pink = colors.pink
- purple = colors.purple
- function cbut(cx, cy, text, bcol, tcol)
- term.setCursorPos(cx, cy)
- term.setBackgroundColor(bcol)
- term.setTextColor(tcol)
- print(text)
- term.setBackgroundColor(bnorm)
- term.setTextColor(tnorm)
- end
- cbut(3,2, " ", red, black)
- cbut(3,3, " Sludge Boiler ", red, black)
- cbut(3,4, " ", red, black)
- sel = 1
- while true do
- evt, side, x, y = os.pullEvent("monitor_touch")
- if evt == "monitor_touch" then
- for mx = 3, 17, 1 do
- for my = 2, 4 , 1 do
- if mx == x then
- if my == y then
- if sel == 1 then
- cbut(3,2, " ", green, black)
- cbut(3,3, " Sludge Boiler ", green, black)
- cbut(3,4, " ", green, black)
- sel = 0
- rs.setBundledOutput("back", colors.red)
- elseif sel == 0 then
- cbut(3,2, " ", red, black)
- cbut(3,3, " Sludge Boiler ", red, black)
- cbut(3,4, " ", red, black)
- sel = 1
- rs.setBundledOutput("back", colors.red)
- end
- end
- end
- end
- end
- end
- --------------------------------------------
- end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement