Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- backc = 32768
- background = paintutils.loadImage("sys/back.png")
- openbil = paintutils.loadImage("sys/open.png")
- terbil = paintutils.loadImage("sys/ter.png")
- back = ""
- function dd ()
- term.setBackgroundColor(backc)
- term.clear()
- paintutils.drawImage(background, 1, 1)
- tx = 4 ty = 18
- text = "Open File|"
- term.setCursorPos(5,18)
- print(text)
- tx3 = 18 ty3 = 18
- text3 = "Execute"
- term.setCursorPos(tx3, ty3)
- print(text3)
- tx1 = 15 ty1 = 18
- text1 = "DD:"
- term.setCursorPos(tx1,ty1)
- print(text1)
- tx2 = 1 ty2 = 18
- text2 = "I/O|"
- term.setCursorPos(tx2, ty2)
- print(text2)
- icox = 5 icoy = 3
- paintutils.drawImage(terbil, icox, icoy)
- term.setCursorPos(icox +1 , icoy +1)
- print("C: >")
- end
- opf = false
- dd()
- function openfile (x, y)
- term.setCursorPos(x, y)
- back = read()
- if back ~= "" then
- shell.openTab("edit ", back)
- end
- end
- function openimage(x,y)
- term.setCursorPos(x, y)
- back = read()
- if back ~= "" then
- shell.openTab("paint ", back)
- end
- end
- function execut(x,y)
- term.setCursorPos(x, y)
- back = read()
- if back ~= "" then
- shell.openTab(back)
- end
- end
- while true do
- e, but, cx, cy = os.pullEvent()
- if e == "mouse_click" then
- if cx >= tx+1 and cx <= tx+text:len()-1 and cy == ty then
- paintutils.drawImage(openbil, 10, 9)
- term.setBackgroundColor(128)
- term.setCursorPos(10,9)
- print("Open File")
- term.setBackgroundColor(16384)
- term.setCursorPos(31, 9)
- print("X")
- opf = true
- term.setBackgroundColor(128)
- openfile(13, 12)
- term.setBackgroundColor(backc)
- elseif cx >= tx1 and cx <= tx1+text1:len()-2 and cy == ty1 then
- paintutils.drawImage(openbil, 10,9)
- term.setBackgroundColor(128)
- term.setCursorPos(10,9)
- print("Open Image")
- term.setBackgroundColor(16384)
- term.setCursorPos(31, 9)
- print("X")
- opf = true
- term.setBackgroundColor(128)
- openimage(13, 12)
- term.setBackgroundColor(backc)
- elseif cx >=tx3 and cx <=tx3+text3:len()-1 and cy == ty3 then
- paintutils.drawImage(openbil, 10,9)
- term.setBackgroundColor(128)
- term.setCursorPos(10, 9)
- print("Execute (.exe)")
- term.setBackgroundColor(16384)
- term.setCursorPos(31,9)
- print("X")
- opf = true
- term.setBackgroundColor(128)
- execut(13, 12)
- term.setBackgroundColor(backc)
- elseif cx >=tx2 and cx <=tx2+text2:len()-2 and cy == ty2 then
- os.shutdown()
- elseif cx >= icox and cx <= icox+5 and cy >= icoy and cy <= icoy+5 then
- term.setBackgroundColor(32768)
- term.setCursorPos(1,1)
- term.setTextColor(1)
- term.clear()
- return
- elseif cx >= 31 and cx <= 31+1 and cy == 9 then
- if opf == true then
- dd()
- opf = false
- end
- end
- end
- end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement