Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- term.redirect(term.native())
- term.setBackgroundColor(colors.yellow)
- term.clear()
- term.setCursorPos(1, 1)
- term.setBackgroundColor(colors.lightGray)
- term.clearLine()
- term.setCursorPos(23, 1)
- term.setTextColor(colors.black)
- term.write("Paint")
- term.setCursorPos(51, 1)
- term.setBackgroundColor(colors.red)
- term.setTextColor(colors.white)
- term.write("X")
- term.setCursorPos(1,3)
- term.setBackgroundColor(colors.lightGray)
- term.write("File Name: ")
- term.setCursorPos(1,5)
- term.write("Directory:os/images ")
- term.setCursorPos(5,7)
- term.write("Editor")
- local keystrokes = "newFile"
- term.setCursorPos(11, 3)
- term.write(keystrokes)
- local progRunning = true
- while progRunning == true do
- event, button, xPos, yPos = os.pullEvent("mouse_click")
- if xPos > 10 and xPos < 27 and yPos == 3 then
- term.setCursorPos(1,3)
- term.setBackgroundColor(colors.lightGray)
- term.write("File Name: ")
- keystrokes = ""
- local scanning = true
- while scanning == true do
- event, keyTemp = os.pullEvent("key")
- if keys.getName(keyTemp) == "enter" then
- scanning = false
- end
- if scanning == true then
- keystrokes = keystrokes .. keys.getName(keyTemp)
- term.setCursorPos(11, 3) --set to proper y value.
- term.write(keystrokes)
- end
- end
- end
- if xPos > 4 and xPos < 11 and yPos == 7 then
- shell.run("paint os/images/" .. keystrokes)
- progRunning = false
- end
- if xPos > 50 and xPos < 52 and yPos == 1 then
- progRunning = false
- os.run({}, "os/gui")
- end
- end
Advertisement
Add Comment
Please, Sign In to add comment