Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- os.loadAPI("clickAPI")
- os.loadAPI("advPrint")
- term.setBackgroundColor(colors.white)
- term.setTextColor(colors.gray)
- term.clear()
- button_1 = paintutils.loadImage("tde-r")
- on = false
- while true do
- paintutils.drawImage(button_1, 1, 1)
- term.setTextColor(colors.red)
- term.setBackgroundColor(colors.white)
- advPrint.tout(1, "X Redstone 3.0")
- local event, button, X, Y = os.pullEventRaw()
- if event == "mouse_click" then
- if (X>=3 and Y>=3 and X<=13 and Y<=17) and (on == false) then
- on = true
- redstone.setOutput("back", true)
- elseif (X>=3 and Y>=3 and X<=13 and Y<=17) and (on == true) then
- on = false
- redstone.setOutput("back", false)
- elseif X == 1 and Y == 1 then
- break
- end
- end
- end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement