Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- os.loadAPI("clickAPI")
- os.loadAPI("advPrint")
- button_off = paintutils.loadImage("tde-rOFF")
- button_ON = paintutils.loadImage("tde-rON")
- term.setBackgroundColor(colors.white)
- term.setTextColor(colors.gray)
- term.clear()
- on = off
- side = 'back'
- on = false
- while true do
- if on then
- term.clear()
- paintutils.drawImage(button_ON, 1, 1)
- else
- term.clear()
- paintutils.drawImage(button_off, 1, 1)
- end
- if side == 'back' then
- term.setCursorPos(1, 19)
- term.setBackgroundColor(colors.pink)
- term.setTextColor(colors.black)
- write('back')
- term.setBackgroundColor(colors.white)
- write(' front top bottom left right')
- elseif side == 'front' then
- term.setCursorPos(1, 19)
- term.setBackgroundColor(colors.white)
- term.setTextColor(colors.black)
- write('back ')
- term.setBackgroundColor(colors.pink)
- term.setTextColor(colors.black)
- write('front')
- term.setBackgroundColor(colors.white)
- write(' top bottom left right')
- elseif side == 'top' then
- term.setCursorPos(1, 19)
- term.setBackgroundColor(colors.white)
- term.setTextColor(colors.black)
- write('back front ')
- term.setBackgroundColor(colors.pink)
- write('top')
- term.setBackgroundColor(colors.white)
- write(' bottom left right')
- elseif side == 'bottom' then
- term.setCursorPos(1, 19)
- term.setBackgroundColor(colors.white)
- term.setTextColor(colors.black)
- write('back front top ')
- term.setBackgroundColor(colors.pink)
- write('bottom')
- term.setBackgroundColor(colors.white)
- write(' left right')
- elseif side == 'left' then
- term.setCursorPos(1, 19)
- term.setBackgroundColor(colors.white)
- term.setTextColor(colors.black)
- write('back front top bottom ')
- term.setBackgroundColor(colors.pink)
- write('left')
- term.setBackgroundColor(colors.white)
- write(' right')
- elseif side == 'right' then
- term.setCursorPos(1, 19)
- term.setBackgroundColor(colors.white)
- term.setTextColor(colors.black)
- write('back front top bottom left ')
- term.setBackgroundColor(colors.pink)
- write('right')
- end
- term.setTextColor(colors.red)
- term.setBackgroundColor(colors.white)
- advPrint.tout(1, "X Redstone 3.3")
- 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(side, true)
- elseif (X>=3 and Y>=3 and X<=13 and Y<=17) and (on == true) then
- on = false
- redstone.setOutput(side, false)
- elseif X == 1 and Y == 1 then
- redstone.setOutput('back', false)
- redstone.setOutput('front', false)
- redstone.setOutput('top', false)
- redstone.setOutput('bottom', false)
- redstone.setOutput('left', false)
- redstone.setOutput('right', false)
- term.setBackgroundColor(colors.black)
- term.clear()
- term.setCursorPos(1, 1)
- break
- elseif X >= 1 and X <= 4 and Y == 19 then
- if sideD ~= side then
- redstone.setOutput('back', false)
- redstone.setOutput('front', false)
- redstone.setOutput('top', false)
- redstone.setOutput('bottom', false)
- redstone.setOutput('left', false)
- redstone.setOutput('right', false)
- sideD = side
- on = false
- end
- side = "back"
- elseif X >= 5 and X <= 10 and Y == 19 then
- if sideD ~= side then
- redstone.setOutput('back', false)
- redstone.setOutput('front', false)
- redstone.setOutput('top', false)
- redstone.setOutput('bottom', false)
- redstone.setOutput('left', false)
- redstone.setOutput('right', false)
- on = false
- end
- sideD = side
- side = "front"
- elseif X >= 11 and X <= 14 and Y == 19 then
- if sideD ~= side then
- redstone.setOutput('back', false)
- redstone.setOutput('front', false)
- redstone.setOutput('top', false)
- redstone.setOutput('bottom', false)
- redstone.setOutput('left', false)
- redstone.setOutput('right', false)
- end
- on = false
- side = "top"
- elseif X >= 15 and X <= 15 + 6 and Y == 19 then
- if sideD ~= side then
- redstone.setOutput('back', false)
- redstone.setOutput('front', false)
- redstone.setOutput('top', false)
- redstone.setOutput('bottom', false)
- redstone.setOutput('left', false)
- redstone.setOutput('right', false)
- end
- on = false
- side = "bottom"
- elseif X >= 15 + 7 and X <= 15 + 7 + 4 and Y == 19 then
- if sideD ~= side then
- redstone.setOutput('back', false)
- redstone.setOutput('front', false)
- redstone.setOutput('top', false)
- redstone.setOutput('bottom', false)
- redstone.setOutput('left', false)
- redstone.setOutput('right', false)
- end
- on = false
- side = "left"
- elseif X >= 15 + 7 + 5 and X <= 15 + 7 + 10 and Y == 19 then
- if sideD ~= side then
- redstone.setOutput('back', false)
- redstone.setOutput('front', false)
- redstone.setOutput('top', false)
- redstone.setOutput('bottom', false)
- redstone.setOutput('left', false)
- redstone.setOutput('right', false)
- sideD = side
- end
- on = false
- side = "right"
- end
- end
- end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement