Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- if RUNNING45==1 then
- error("ALREADY RUNNING")
- end
- RUNNING45=1
- if fs.exists("/funcs")==false then
- shell.run("pastebin","get","ZqEtCWuu","funcs")
- os.loadAPI("funcs")
- else
- os.loadAPI("funcs")
- end
- if fs.exists("/confg") == false then
- term.clear()
- term.setTextColor(colors.red)
- term.setBackgroundColor(colors.black)
- term.setCursorPos(1,1)
- print("PLEASE SELECT THE SIDE OF THE DISK DRIVE")
- print("")
- term.setTextColor(colors.green)
- print("TOP")
- print("BOTTOM")
- print("LEFT")
- print("RIGHT")
- print("FRONT")
- print("BACK")
- sr = "RT"
- while sr == "RT" do
- e, k, x, y = os.pullEvent("mouse_click")
- if y==3 or y==4 or y==5 or y==6 or y==7 or y==8 then
- sr = "1"
- term.setCursorPos(8,y)
- term.setTextColor(colors.white)
- write("<")
- end
- end
- local function wzu(TRZ)
- HJ = fs.open("confg","w")
- HJ.write(TRZ)
- HJ.close()
- end
- if y==3 then
- wzu("top")
- end
- if y==4 then
- wzu("bottom")
- end
- if y==5 then
- wzu("left")
- end
- if y==6 then
- wzu("right")
- end
- if y==7 then
- wzu("front")
- end
- if y==8 then
- wzu("back")
- end
- term.setCursorPos(1,10)
- term.setTextColor(colors.yellow)
- print("IT IS NOW POSSIBLE TO PLAY A DISK JUST BY INSERTING IT IN THE DRIVE")
- sleep(2)
- print("")
- print(" PRESS ANY KEY TO CONTINUE...")
- os.pullEvent("char")
- os.reboot()
- end
- function OS()
- term.clear()
- term.setCursorPos(1,4)
- print(" # # ### #### #### / #### #### ")
- print(" ## ## # # # # / # # # ")
- print(" # # # # # # # # # # # ")
- print(" # # # # # ## # # #### ")
- print(" # # # # # # # # # ")
- print(" # # # # # # # # # ")
- print("# # ### #### # # ### #### ")
- term.setTextColor(colors.red)
- print(" coded by Microstar301")
- term.setTextColor(colors.white)
- term.setCursorPos(15,19)
- write("PRESS C TO DELETE THE DISK SETTINGS")
- term.setCursorPos(20,15)
- print("LOADING...")
- term.setCursorPos(19,16)
- write("\[")
- term.setCursorPos(30,16)
- write("\]")
- term.setCursorPos(-99,-99)
- term.setCursorPos(20,16)
- term.setBackgroundColor(colors.green)
- function l()
- for t=1,10 do
- write(" ")
- sleep(0.2)
- end
- end
- function del()
- while true do
- e, k = os.pullEvent("char")
- if k=="c" then
- shell.run("rm","/confg")
- end
- os.reboot()
- end
- end
- parallel.waitForAny(l,del)
- sleep(2)
- local function draw(XZT1,XZT2,XZT3)
- funcs.cc()
- term.setBackgroundColor(colors.lightBlue)
- funcs.cs()
- sleep(XZT1)
- funcs.ts(1,19)
- term.setBackgroundColor(colors.blue)
- for t=1,51 do
- write(" ")
- end
- sleep(XZT1)
- funcs.ts(1,19)
- term.setBackgroundColor(colors.red)
- term.setTextColor(colors.white)
- write("MENU")
- sleep(XZT2)
- term.setBackgroundColor(colors.lightBlue)
- term.setTextColor(colors.black)
- funcs.ts(17,3)
- write(" v ")
- funcs.ts(17,4)
- write(" >*< ")
- funcs.ts(17,5)
- write(" | ")
- funcs.ts(16,6)
- term.setBackgroundColor(colors.green)
- term.setTextColor(colors.brown)
- write("Receiver")
- term.setBackgroundColor(colors.lightBlue)
- term.setTextColor(colors.black)
- funcs.ts(28,3)
- write(" ^ ")
- funcs.ts(28,4)
- write(" <*> ")
- funcs.ts(28,5)
- write(" | ")
- funcs.ts(25,6)
- term.setBackgroundColor(colors.green)
- term.setTextColor(colors.brown)
- write("Transmitter")
- term.setBackgroundColor(colors.lightBlue)
- term.setTextColor(colors.black)
- funcs.ts(10,3)
- write("|--|")
- funcs.ts(10,4)
- write("^ v")
- funcs.ts(10,5)
- write("|--|")
- funcs.ts(9,6)
- term.setBackgroundColor(colors.green)
- term.setTextColor(colors.brown)
- write("Update")
- term.setCursorPos(3,3)
- term.setBackgroundColor(colors.lightBlue)
- term.setTextColor(colors.black)
- write("+--/")
- funcs.ts(3,4)
- write("|~'|")
- funcs.ts(3,5)
- write("+--+")
- funcs.ts(3,6)
- term.setBackgroundColor(colors.green)
- term.setTextColor(colors.brown)
- write("Edit")
- sleep(XZT3)
- funcs.ts(39,19)
- term.setTextColor(colors.black)
- term.setBackgroundColor(colors.blue)
- write("ID:")
- write(os.getComputerID())
- end
- local function click1()
- e,k,x,y=os.pullEvent("mouse_click")
- end
- local function time()
- TIME_VX, TIME_VY = term.getCursorPos()
- term.setCursorBlink(false)
- term.setBackgroundColor(colors.white)
- while true do
- funcs.ts(45,19)
- write(" ")
- funcs.ts(45,19)
- write(textutils.formatTime(os.time(),true))
- funcs.ts(TIME_VX,TIME_VY)
- sleep(1)
- end
- end
- draw(1,0.5,0.3)
- while true do
- draw(0,0,0)
- parallel.waitForAny(click1,time)
- if y==6 and x>24 and x<35 then
- funcs.ts(25,6)
- term.setBackgroundColor(colors.orange)
- write("Transmitter")
- sleep(0.4)
- term.setCursorPos(5,4)
- term.setTextColor(colors.black)
- term.setBackgroundColor(colors.blue)
- write(" [x] ")
- funcs.ts(5,6)
- term.setTextColor(colors.white)
- term.setBackgroundColor(colors.gray)
- write("SIDE:")
- term.setBackgroundColor(colors.white)
- write(" ")
- term.setBackgroundColor(colors.gray)
- funcs.ts(5,5)
- term.setTextColor(colors.red)
- write("MODEM MUST BE PLACED")
- term.setTextColor(colors.white)
- funcs.ts(5,7)
- write("POSSIBLE: top, back ")
- funcs.ts(5,8)
- write("left, right, bottom ")
- funcs.ts(5,9)
- write(" ")
- funcs.ts(10,6)
- term.setTextColor(colors.black)
- local function IN70()
- INU=read()
- end
- RAT=0
- local function click31()
- while RAT==0 do
- e,k,x,y=os.pullEvent("mouse_click")
- if x==22 and y==4 then
- RAT=1
- end
- end
- end
- parallel.waitForAny(click31,IN70,time)
- if RAT==0 then
- if INU=="top" or INU=="bottom" or INU=="back" or INU=="left" or INU=="right" then
- rednet.open(INU)
- term.setBackgroundColor(colors.gray)
- term.setTextColor(colors.red)
- funcs.cs()
- local function INQ45()
- while true do
- term.setTextColor(colors.yellow)
- write("SEND:")
- term.setTextColor(colors.black)
- INPUTIN=read()
- term.setTextColor(colors.yellow)
- write("SEND TO [ALL= /ID]:")
- term.setTextColor(colors.black)
- INPUTINJ=tonumber(read())
- INTER=0
- if INPUTINJ==nil then
- rednet.broadcast(INPUTIN)
- else
- rednet.send(INPUTINJ,INPUTIN)
- end
- end
- end
- local function end09()
- TOPT=0
- while TOPT==0 do
- ZX,ZY=term.getCursorPos()
- term.setCursorPos(45,19)
- term.setBackgroundColor(colors.red)
- term.setTextColor(colors.black)
- write("ABORT")
- term.setCursorPos(ZX,ZY)
- term.setBackgroundColor(colors.gray)
- term.setTextColor(colors.black)
- e,k,x,y=os.pullEvent("mouse_click")
- if x>44 and x<50 and y==19 then
- rednet.close(INU)
- TOPT=1
- end
- end
- end
- parallel.waitForAny(end09,INQ45)
- end
- end
- end
- if y==6 and x==16 or y==6 and x==17 or y==6 and x==18 or y==6 and x==19 or y==6 and x==20 or y==6 and x==21 or y==6 and x==22 or y==6 and x==23 then
- funcs.ts(16,6)
- term.setBackgroundColor(colors.orange)
- write("Receiver")
- sleep(0.4)
- term.setCursorPos(5,4)
- term.setTextColor(colors.black)
- term.setBackgroundColor(colors.blue)
- write(" [x] ")
- --X at 22
- funcs.ts(5,6)
- term.setTextColor(colors.white)
- term.setBackgroundColor(colors.gray)
- write("SIDE:")
- term.setBackgroundColor(colors.white)
- write(" ")
- term.setBackgroundColor(colors.gray)
- funcs.ts(5,5)
- term.setTextColor(colors.red)
- write("MODEM MUST BE PLACED")
- term.setTextColor(colors.white)
- funcs.ts(5,7)
- write("POSSIBLE: top, back ")
- funcs.ts(5,8)
- write("left, right, bottom ")
- funcs.ts(5,9)
- write(" ")
- funcs.ts(10,6)
- term.setTextColor(colors.black)
- local function IN38()
- IN=read()
- end
- RET=0
- local function click47()
- while RET==0 do
- e,k,x,y=os.pullEvent("mouse_click")
- if x==22 and y==4 then
- RET=1
- end
- end
- end
- parallel.waitForAny(click47,IN38,time)
- if RET==0 then
- if IN=="top" or IN=="bottom" or IN=="back" or IN=="left" or IN=="right" then
- rednet.open(IN)
- term.setBackgroundColor(colors.gray)
- term.setTextColor(colors.red)
- term.clear()
- local function INQ78()
- ZU=1
- while ZU==1 do
- e,k=os.pullEvent("char")
- if k=="q" then
- rednet.close(IN)
- ZU=0
- end
- end
- end
- local function REDRES()
- while true do
- i,o=rednet.receive()
- print("USER ",i," sent: ",o)
- end
- end
- term.setCursorPos(1,1)
- print("PRESS Q TO QUIT")
- term.setTextColor(colors.yellow)
- print("ID:",os.getComputerID())
- term.setTextColor(colors.green)
- print("LOG START...")
- term.setTextColor(colors.black)
- parallel.waitForAny(REDRES,INQ78)
- end
- end
- end
- if y==6 and x==9 or y==6 and x==10 or y==6 and x==11 or y==6 and x==12 or y==6 and x==13 or y==6 and x==14 then
- funcs.ts(9,6)
- term.setBackgroundColor(colors.orange)
- write("Update")
- shell.run("rm","/install")
- shell.run("cd","/")
- term.setCursorPos(-99,-99)
- shell.run("pastebin","get","Eb4gPRJV","/install")
- shell.run("/install")
- end
- if y==6 and x==3 or y==6 and x==4 or y==6 and x==4 or y==6 and x==5 or y==6 and x==6 then
- funcs.ts(3,6)
- term.setBackgroundColor(colors.orange)
- write("Edit")
- sleep(0.4)
- funcs.ts(7,8)
- term.setTextColor(colors.black)
- term.setBackgroundColor(colors.blue)
- write(" [x]")
- term.setBackgroundColor(colors.gray)
- funcs.ts(7,9)
- write(" ")
- funcs.ts(7,10)
- write("EDIT:")
- term.setBackgroundColor(colors.white)
- for t=1,11 do
- write(" ")
- end
- funcs.ts(7,11)
- term.setBackgroundColor(colors.gray)
- write(" ")
- ZUIG=0
- local function click45()
- while ZUIG==0 do
- e,k,x,y=os.pullEvent("mouse_click")
- if y==8 and x==21 then
- ZUIG=1
- term.setCursorBlink(false)
- end
- end
- end
- local function type48()
- funcs.ts(12,10)
- term.setBackgroundColor(colors.white)
- INT=read()
- end
- parallel.waitForAny(click45,type48,time)
- if ZUIG==0 then
- shell.run("edit",INT)
- end
- end
- if y==19 and x==1 or y==19 and x==2 or y==19 and x==3 or y==19 and x==4 then
- term.setBackgroundColor(colors.lightGray)
- term.setTextColor(colors.white)
- term.setCursorPos(1,16)
- print("CMD ")
- print("SHUTDOWN")
- print("RUN ")
- local function click36()
- e,k,x,y=os.pullEvent("mouse_click")
- end
- term.setTextColor(colors.black)
- parallel.waitForAny(click36,time)
- if y==16 and x==1 or y==16 and x==2 or y==16 and x==3 or y==16 and x==4 or y==16 and x==5 or y==16 and x==6 or y==16 and x==7 or y==16 and x==8 then
- term.setCursorPos(1,16)
- term.setBackgroundColor(colors.orange)
- write("CMD ")
- sleep(1)
- term.setTextColor(colors.white)
- term.setBackgroundColor(colors.black)
- funcs.cs()
- print("TO RETURN TYPE EXIT OR CLICK ABORT")
- function run()
- shell.run("shell")
- end
- function abort()
- exit379=0
- while exit379==0 do
- ZU,ZX=term.getCursorPos()
- term.setCursorPos(45,19)
- term.setBackgroundColor(colors.red)
- write("ABORT")
- term.setBackgroundColor(colors.black)
- term.setCursorPos(ZU,ZX)
- e,k,x,y=os.pullEvent("mouse_click")
- if x<50 and x>44 and y==19 then
- exit379=1
- end
- end
- end
- parallel.waitForAny(run,abort)
- end
- if y==17 and x==1 or y==17 and x==2 or y==17 and x==3 or y==17 and x==4 or y==17 and x==5 or y==17 and x==6 or y==17 and x==7 or y==17 and x==8 then
- funcs.ts(1,17)
- term.setBackgroundColor(colors.orange)
- write("SHUTDOWN")
- sleep(1)
- funcs.cc()
- term.setBackgroundColor(colors.lightGray)
- term.setTextColor(colors.black)
- funcs.cs()
- funcs.ts(1,1)
- print("SHUTTING DOWN...")
- write("\[")
- funcs.ts(12,2)
- write("\]")
- funcs.ts(2,2)
- OFF56=0
- local function end56()
- funcs.ts(2,2)
- term.setBackgroundColor(colors.green)
- for t=1,10 do
- write(" ")
- sleep(0.3)
- end
- end
- local function click49()
- CLICKO=0
- term.setCursorPos(45,19)
- term.setBackgroundColor(colors.red)
- write("ABORT")
- while CLICKO==0 do
- e,k,x,y=os.pullEvent("mouse_click")
- if x>44 and x<50 and y==19 then
- OFF56=1
- CLICKO=1
- end
- end
- end
- parallel.waitForAny(click49,end56)
- if OFF56==0 then
- os.shutdown()
- end
- end
- if y==18 and x==1 or y==18 and x==2 or y==18 and x==3 or y==18 and x==4 or y==18 and x==5 or y==18 and x==6 or y==18 and x==7 or y==18 and x==8 then
- funcs.ts(1,18)
- term.setBackgroundColor(colors.orange)
- write("RUN ")
- funcs.ts(7,8)
- term.setTextColor(colors.black)
- term.setBackgroundColor(colors.blue)
- write(" [x]")
- funcs.ts(7,9)
- term.setTextColor(colors.white)
- term.setBackgroundColor(colors.gray)
- write(" ")
- funcs.ts(7,10)
- write("RUN:")
- term.setBackgroundColor(colors.white)
- for t=1,14 do
- write(" ")
- end
- term.setBackgroundColor(colors.gray)
- funcs.ts(7,11)
- write(" ")
- funcs.ts(11,10)
- term.setTextColor(colors.black)
- term.setBackgroundColor(colors.white)
- ZULR=0
- local function click46()
- while ZULR==0 do
- e,k,x,y=os.pullEvent("mouse_click")
- if y==8 and x==23 then
- ZULR=1
- term.setCursorBlink(false)
- end
- end
- end
- local function type74()
- IN=read()
- end
- parallel.waitForAny(click46,type74,time)
- if ZULR==0 then
- term.setCursorPos(29,17)
- term.setBackgroundColor(colors.blue)
- write(" ")
- sleep(0.2)
- term.setCursorPos(29,17)
- term.setBackgroundColor(colors.lightBlue)
- write(" ")
- term.setBackgroundColor(colors.blue)
- term.setCursorPos(20,10)
- write(" ")
- sleep(0.2)
- term.setCursorPos(20,10)
- term.setBackgroundColor(colors.lightBlue)
- write(" ")
- term.setBackgroundColor(colors.blue)
- term.setCursorPos(10,3)
- write(" ")
- sleep(0.2)
- term.setBackgroundColor(colors.lightBlue)
- term.setCursorPos(10,3)
- write(" ")
- term.setBackgroundColor(colors.black)
- term.clear()
- sleep(0.1)
- term.setBackgroundColor(colors.blue)
- term.setCursorPos(1,1)
- term.setTextColor(colors.red)
- write(" RUNNING ")
- term.setCursorPos(1,2)
- term.setBackgroundColor(colors.black)
- term.setTextColor(colors.white)
- shell.run(IN)
- sleep(2)
- end
- end
- end
- end
- end
- parallel.waitForAll(OS,funcs.player)
Advertisement
Add Comment
Please, Sign In to add comment