Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- function initialize()
- term.setBackgroundColor(colors.orange)
- term.clear()
- iosutils.centerAlign("Program Hub", 1, colors.red, colors.yellow)
- iosutils.leftAlign("Edit: ", 3, colors.white, colors.orange)
- iosutils.leftAlign("Run: ", 5)
- select = {}
- select[3] = 1
- select[4] = 1
- end
- function clickCheck(x, y, x2, y2)
- if select[3] >= x and select[3] <= x2 and select[4] >= y and select[4] <= y2 then
- return true
- else
- return false
- end
- end
- while true do
- initialize()
- select = {os.pullEvent("mouse_click")}
- if clickCheck(1, 3, 12, 3) then
- term.setCursorPos(7, 3)
- local uEdit = read()
- shell.run("edit " .. tostring(uEdit))
- end
- if clickCheck(1, 5, 12, 5) then
- term.setCursorPos(6, 5)
- local uRun = read()
- term.setBackgroundColor(colors.black)
- term.clear()
- term.setCursorPos(1, 1)
- shell.run(tostring(uRun))
- sleep(3)
- end
- end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement