Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- displayText = "template"
- --The X position on the screen
- startX = 2
- --The Y position on the screen
- startY = 2
- --Use 0 if only a single line
- height = 0
- width = string.len(displayText)
- --Color of the button and text
- boxColor = colors.blue
- TextColor = colors.white
- ---------------------------------------------------
- slc = 0
- paintutils.drawBox(startX,startY, width,height,boxColor)
- term.setCursorPos(startX, startY)
- term.setTextColor(textColor)
- print(displayText)
- while true do
- local event, button, X, Y = os.pullEventRaw()
- if(slc == 0) then
- if(event == "mouse_click") then
- if(X >= startX and X <= width and Y >= startY and Y <= height) then
- --Write what the button has to do in the if
- if(true) then
- os.reboot()
- end
- --------------------------------------
- end
- end
- end
- end
Advertisement
Add Comment
Please, Sign In to add comment