Microstar301

MICROS/WIN

Dec 10th, 2013
214
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Lua 14.96 KB | None | 0 0
  1. if RUNNING45==1 then
  2.  error("ALREADY RUNNING")
  3. end
  4. RUNNING45=1
  5. if fs.exists("/funcs")==false then
  6.  shell.run("pastebin","get","ZqEtCWuu","funcs")
  7.  os.loadAPI("funcs")
  8. else
  9.  os.loadAPI("funcs")
  10. end
  11. if fs.exists("/confg") == false then
  12.  term.clear()
  13.  term.setTextColor(colors.red)
  14.  term.setBackgroundColor(colors.black)
  15.  term.setCursorPos(1,1)
  16.  print("PLEASE SELECT THE SIDE OF THE DISK DRIVE")
  17.  print("")
  18.  term.setTextColor(colors.green)
  19.  print("TOP")
  20.  print("BOTTOM")
  21.  print("LEFT")
  22.  print("RIGHT")
  23.  print("FRONT")
  24.  print("BACK")
  25.  sr = "RT"
  26.  while sr == "RT" do
  27.   e, k, x, y = os.pullEvent("mouse_click")
  28.   if y==3 or y==4 or y==5 or y==6 or y==7 or y==8 then
  29.    sr = "1"
  30.    term.setCursorPos(8,y)
  31.    term.setTextColor(colors.white)
  32.    write("<")
  33.   end
  34.  end
  35.  local function wzu(TRZ)
  36.   HJ = fs.open("confg","w")
  37.   HJ.write(TRZ)
  38.   HJ.close()
  39.  end
  40.  if y==3 then
  41.   wzu("top")
  42.  end
  43.  if y==4 then
  44.   wzu("bottom")
  45.  end
  46.  if y==5 then
  47.   wzu("left")
  48.  end
  49.  if y==6 then
  50.   wzu("right")
  51.  end
  52.  if y==7 then
  53.   wzu("front")
  54.  end
  55.  if y==8 then
  56.   wzu("back")
  57.  end
  58.  term.setCursorPos(1,10)
  59.  term.setTextColor(colors.yellow)
  60.  print("IT IS NOW POSSIBLE TO PLAY A DISK JUST BY INSERTING IT IN THE DRIVE")
  61.  sleep(2)
  62.  print("")
  63.  print(" PRESS ANY KEY TO CONTINUE...")
  64.  os.pullEvent("char")
  65.  os.reboot()
  66. end
  67. function OS()
  68.  
  69. term.clear()
  70. term.setCursorPos(1,4)
  71. print("      #     #  ###   ####  #### /   ####    ####  ")
  72. print("     ##   ##   #   #      #  # /   #    #  #      ")
  73. print("    # # # #   #   #      # #      #    #   #      ")
  74. print("   #  #  #   #   #      ##       #    #     ####  ")
  75. print("  #     #   #   #      # #      #    #          # ")
  76. print(" #     #   #   #      #  #     #    #           # ")
  77. print("#     #  ###   ####  #   #      ###         ####  ")
  78. term.setTextColor(colors.red)
  79. print("                   coded by Microstar301")
  80. term.setTextColor(colors.white)
  81. term.setCursorPos(15,19)
  82. write("PRESS C TO DELETE THE DISK SETTINGS")
  83. term.setCursorPos(20,15)
  84. print("LOADING...")
  85. term.setCursorPos(19,16)
  86. write("\[")
  87. term.setCursorPos(30,16)
  88. write("\]")
  89. term.setCursorPos(-99,-99)
  90. term.setCursorPos(20,16)
  91. term.setBackgroundColor(colors.green)
  92. function l()
  93.  for t=1,10 do
  94.   write(" ")
  95.   sleep(0.2)
  96.  end
  97. end
  98. function del()
  99.  while true do
  100.   e, k = os.pullEvent("char")
  101.   if k=="c" then
  102.    shell.run("rm","/confg")
  103.   end
  104.   os.reboot()
  105.  end
  106. end
  107. parallel.waitForAny(l,del)
  108. sleep(2)
  109. local function draw(XZT1,XZT2,XZT3)
  110.  funcs.cc()
  111.  term.setBackgroundColor(colors.lightBlue)
  112.  funcs.cs()
  113.  sleep(XZT1)
  114.  funcs.ts(1,19)
  115.  term.setBackgroundColor(colors.blue)
  116.  for t=1,51 do
  117.   write(" ")
  118.  end
  119.  sleep(XZT1)
  120.  funcs.ts(1,19)
  121.  term.setBackgroundColor(colors.red)
  122.  term.setTextColor(colors.white)
  123.  write("MENU")
  124.  sleep(XZT2)
  125.  term.setBackgroundColor(colors.lightBlue)
  126.  term.setTextColor(colors.black)
  127.  funcs.ts(17,3)
  128.  write("  v  ")
  129.  funcs.ts(17,4)
  130.  write(" >*< ")
  131.  funcs.ts(17,5)
  132.  write("  |  ")
  133.  funcs.ts(16,6)
  134.  term.setBackgroundColor(colors.green)
  135.  term.setTextColor(colors.brown)
  136.  write("Receiver")
  137.  term.setBackgroundColor(colors.lightBlue)
  138.  term.setTextColor(colors.black)
  139.  funcs.ts(28,3)
  140.  write("  ^  ")
  141.  funcs.ts(28,4)
  142.  write(" <*> ")
  143.  funcs.ts(28,5)
  144.  write("  |  ")
  145.  funcs.ts(25,6)
  146.  term.setBackgroundColor(colors.green)
  147.  term.setTextColor(colors.brown)
  148.  write("Transmitter")
  149.  term.setBackgroundColor(colors.lightBlue)
  150.  term.setTextColor(colors.black)
  151.  funcs.ts(10,3)
  152.  write("|--|")
  153.  funcs.ts(10,4)
  154.  write("^  v")
  155.  funcs.ts(10,5)
  156.  write("|--|")
  157.  funcs.ts(9,6)
  158.  term.setBackgroundColor(colors.green)
  159.  term.setTextColor(colors.brown)
  160.  write("Update")
  161.  term.setCursorPos(3,3)
  162.  term.setBackgroundColor(colors.lightBlue)
  163.  term.setTextColor(colors.black)
  164.  write("+--/")
  165.  funcs.ts(3,4)
  166.  write("|~'|")
  167.  funcs.ts(3,5)
  168.  write("+--+")
  169.  funcs.ts(3,6)
  170.  term.setBackgroundColor(colors.green)
  171.  term.setTextColor(colors.brown)
  172.  write("Edit")
  173.  sleep(XZT3)
  174.  funcs.ts(39,19)
  175.  term.setTextColor(colors.black)
  176.  term.setBackgroundColor(colors.blue)
  177.  write("ID:")
  178.  write(os.getComputerID())
  179. end
  180.  local function click1()
  181.   e,k,x,y=os.pullEvent("mouse_click")
  182.  end
  183.  local function time()
  184.   TIME_VX, TIME_VY = term.getCursorPos()
  185.   term.setCursorBlink(false)
  186.   term.setBackgroundColor(colors.white)
  187.   while true do
  188.    funcs.ts(45,19)
  189.    write("     ")
  190.    funcs.ts(45,19)
  191.    write(textutils.formatTime(os.time(),true))
  192.    funcs.ts(TIME_VX,TIME_VY)
  193.    sleep(1)
  194.   end
  195.  end
  196. draw(1,0.5,0.3)
  197. while true do
  198.  draw(0,0,0)
  199.  parallel.waitForAny(click1,time)
  200.   if y==6 and x>24 and x<35 then
  201.    funcs.ts(25,6)
  202.    term.setBackgroundColor(colors.orange)
  203.    write("Transmitter")
  204.    sleep(0.4)
  205.    term.setCursorPos(5,4)
  206.    term.setTextColor(colors.black)
  207.    term.setBackgroundColor(colors.blue)
  208.    write("                [x] ")
  209.    funcs.ts(5,6)
  210.    term.setTextColor(colors.white)
  211.    term.setBackgroundColor(colors.gray)
  212.    write("SIDE:")
  213.    term.setBackgroundColor(colors.white)
  214.    write("               ")
  215.    term.setBackgroundColor(colors.gray)
  216.    funcs.ts(5,5)
  217.    term.setTextColor(colors.red)
  218.    write("MODEM MUST BE PLACED")
  219.    term.setTextColor(colors.white)
  220.    funcs.ts(5,7)
  221.    write("POSSIBLE: top, back ")
  222.    funcs.ts(5,8)
  223.    write("left, right, bottom ")
  224.    funcs.ts(5,9)
  225.    write("                    ")
  226.    funcs.ts(10,6)
  227.    term.setTextColor(colors.black)
  228.    local function IN70()
  229.     INU=read()
  230.    end
  231.    RAT=0
  232.    local function click31()
  233.     while RAT==0 do
  234.      e,k,x,y=os.pullEvent("mouse_click")
  235.      if x==22 and y==4 then
  236.       RAT=1
  237.      end
  238.     end
  239.    end
  240.    parallel.waitForAny(click31,IN70,time)
  241.    if RAT==0 then
  242.     if INU=="top" or INU=="bottom" or INU=="back" or INU=="left" or INU=="right" then
  243.      rednet.open(INU)
  244.      term.setBackgroundColor(colors.gray)
  245.      term.setTextColor(colors.red)
  246.      funcs.cs()
  247.      local function INQ45()
  248.       while true do
  249.        term.setTextColor(colors.yellow)
  250.        write("SEND:")
  251.        term.setTextColor(colors.black)
  252.        INPUTIN=read()
  253.        term.setTextColor(colors.yellow)
  254.        write("SEND TO [ALL= /ID]:")
  255.        term.setTextColor(colors.black)
  256.        INPUTINJ=tonumber(read())      
  257.        INTER=0
  258.        if INPUTINJ==nil then
  259.         rednet.broadcast(INPUTIN)
  260.        else
  261.        rednet.send(INPUTINJ,INPUTIN)
  262.        end
  263.       end
  264.      end
  265.      local function end09()
  266.       TOPT=0
  267.       while TOPT==0 do
  268.        ZX,ZY=term.getCursorPos()
  269.        term.setCursorPos(45,19)
  270.        term.setBackgroundColor(colors.red)
  271.        term.setTextColor(colors.black)
  272.        write("ABORT")
  273.        term.setCursorPos(ZX,ZY)
  274.        term.setBackgroundColor(colors.gray)
  275.        term.setTextColor(colors.black)
  276.        e,k,x,y=os.pullEvent("mouse_click")
  277.        if x>44 and x<50 and y==19 then
  278.         rednet.close(INU)
  279.         TOPT=1
  280.        end
  281.       end
  282.      end
  283.      parallel.waitForAny(end09,INQ45)
  284.     end
  285.    end
  286.   end    
  287.        
  288.   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
  289.    funcs.ts(16,6)
  290.    term.setBackgroundColor(colors.orange)
  291.    write("Receiver")
  292.    sleep(0.4)
  293.    term.setCursorPos(5,4)
  294.    term.setTextColor(colors.black)
  295.    term.setBackgroundColor(colors.blue)
  296.    write("                [x] ")
  297.    --X at 22                  
  298.    funcs.ts(5,6)                    
  299.    term.setTextColor(colors.white)
  300.    term.setBackgroundColor(colors.gray)
  301.    write("SIDE:")              
  302.    term.setBackgroundColor(colors.white)
  303.    write("               ")                          
  304.    term.setBackgroundColor(colors.gray)
  305.    funcs.ts(5,5)                    
  306.    term.setTextColor(colors.red)
  307.    write("MODEM MUST BE PLACED")
  308.    term.setTextColor(colors.white)
  309.    funcs.ts(5,7)
  310.    write("POSSIBLE: top, back ")
  311.    funcs.ts(5,8)
  312.    write("left, right, bottom ")
  313.    funcs.ts(5,9)
  314.    write("                    ")
  315.    funcs.ts(10,6)
  316.    term.setTextColor(colors.black)
  317.    local function IN38()
  318.     IN=read()
  319.    end
  320.    RET=0
  321.    local function click47()
  322.     while RET==0 do
  323.      e,k,x,y=os.pullEvent("mouse_click")
  324.      if x==22 and y==4 then
  325.       RET=1
  326.      end
  327.     end
  328.    end
  329.    parallel.waitForAny(click47,IN38,time)
  330.    if RET==0 then
  331.     if IN=="top" or IN=="bottom" or IN=="back" or IN=="left" or IN=="right" then
  332.      rednet.open(IN)
  333.      term.setBackgroundColor(colors.gray)
  334.      term.setTextColor(colors.red)
  335.      term.clear()
  336.      local function INQ78()
  337.       ZU=1
  338.       while ZU==1 do
  339.        e,k=os.pullEvent("char")
  340.        if k=="q" then
  341.         rednet.close(IN)
  342.         ZU=0
  343.        end
  344.       end
  345.      end
  346.      local function REDRES()
  347.       while true do
  348.        i,o=rednet.receive()
  349.        print("USER ",i," sent: ",o)
  350.       end
  351.      end
  352.      term.setCursorPos(1,1)
  353.      print("PRESS Q TO QUIT")
  354.      term.setTextColor(colors.yellow)
  355.      print("ID:",os.getComputerID())
  356.      term.setTextColor(colors.green)
  357.      print("LOG START...")
  358.      term.setTextColor(colors.black)
  359.      parallel.waitForAny(REDRES,INQ78)
  360.     end
  361.    end
  362.   end
  363.   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
  364.    funcs.ts(9,6)
  365.    term.setBackgroundColor(colors.orange)
  366.    write("Update")
  367.    shell.run("rm","/install")
  368.    shell.run("cd","/")
  369.    term.setCursorPos(-99,-99)
  370.    shell.run("pastebin","get","Eb4gPRJV","/install")
  371.    shell.run("/install")
  372.   end
  373.   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
  374.    funcs.ts(3,6)
  375.    term.setBackgroundColor(colors.orange)
  376.    write("Edit")
  377.    sleep(0.4)
  378.    funcs.ts(7,8)
  379.    term.setTextColor(colors.black)
  380.    term.setBackgroundColor(colors.blue)
  381.    write("             [x]")
  382.    term.setBackgroundColor(colors.gray)
  383.    funcs.ts(7,9)
  384.    write("                ")
  385.    funcs.ts(7,10)
  386.    write("EDIT:")
  387.    term.setBackgroundColor(colors.white)
  388.    for t=1,11 do
  389.     write(" ")
  390.    end
  391.    funcs.ts(7,11)
  392.    term.setBackgroundColor(colors.gray)
  393.    write("                ")
  394.    ZUIG=0
  395.    local function click45()
  396.     while ZUIG==0 do
  397.      e,k,x,y=os.pullEvent("mouse_click")
  398.      if y==8 and x==21 then
  399.       ZUIG=1
  400.       term.setCursorBlink(false)
  401.      end
  402.     end
  403.    end
  404.    local function type48()
  405.     funcs.ts(12,10)
  406.     term.setBackgroundColor(colors.white)
  407.     INT=read()
  408.    end
  409.    parallel.waitForAny(click45,type48,time)
  410.    if ZUIG==0 then
  411.     shell.run("edit",INT)
  412.    end
  413.   end
  414.   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
  415.    term.setBackgroundColor(colors.lightGray)
  416.    term.setTextColor(colors.white)
  417.    term.setCursorPos(1,16)
  418.    print("CMD     ")
  419.    print("SHUTDOWN")
  420.    print("RUN     ")
  421.    local function click36()
  422.     e,k,x,y=os.pullEvent("mouse_click")
  423.    end
  424.    term.setTextColor(colors.black)
  425.    parallel.waitForAny(click36,time)
  426.    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
  427.     term.setCursorPos(1,16)
  428.     term.setBackgroundColor(colors.orange)
  429.     write("CMD     ")
  430.     sleep(1)
  431.     term.setTextColor(colors.white)
  432.     term.setBackgroundColor(colors.black)
  433.     funcs.cs()
  434.     print("TO RETURN TYPE EXIT OR CLICK ABORT")
  435.     function run()
  436.      shell.run("shell")
  437.     end
  438.     function abort()
  439.      exit379=0
  440.      while exit379==0 do
  441.       ZU,ZX=term.getCursorPos()
  442.       term.setCursorPos(45,19)
  443.       term.setBackgroundColor(colors.red)
  444.       write("ABORT")
  445.       term.setBackgroundColor(colors.black)
  446.       term.setCursorPos(ZU,ZX)
  447.       e,k,x,y=os.pullEvent("mouse_click")
  448.       if x<50 and x>44 and y==19 then
  449.        exit379=1
  450.       end
  451.      end
  452.     end
  453.     parallel.waitForAny(run,abort)
  454.    end
  455.    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
  456.     funcs.ts(1,17)
  457.     term.setBackgroundColor(colors.orange)
  458.     write("SHUTDOWN")
  459.     sleep(1)
  460.     funcs.cc()
  461.     term.setBackgroundColor(colors.lightGray)
  462.     term.setTextColor(colors.black)
  463.     funcs.cs()
  464.     funcs.ts(1,1)
  465.     print("SHUTTING DOWN...")
  466.     write("\[")
  467.     funcs.ts(12,2)
  468.     write("\]")
  469.     funcs.ts(2,2)
  470.     OFF56=0
  471.     local function end56()
  472.      funcs.ts(2,2)
  473.      term.setBackgroundColor(colors.green)
  474.      for t=1,10 do
  475.       write(" ")
  476.       sleep(0.3)
  477.      end
  478.     end
  479.     local function click49()
  480.      CLICKO=0
  481.      term.setCursorPos(45,19)
  482.      term.setBackgroundColor(colors.red)
  483.      write("ABORT")
  484.      while CLICKO==0 do
  485.       e,k,x,y=os.pullEvent("mouse_click")
  486.       if x>44 and x<50 and y==19 then
  487.        OFF56=1
  488.        CLICKO=1
  489.       end
  490.      end
  491.     end
  492.     parallel.waitForAny(click49,end56)
  493.     if OFF56==0 then
  494.      os.shutdown()
  495.     end
  496.    end
  497.    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  
  498.     funcs.ts(1,18)
  499.     term.setBackgroundColor(colors.orange)
  500.     write("RUN     ")
  501.     funcs.ts(7,8)
  502.     term.setTextColor(colors.black)
  503.     term.setBackgroundColor(colors.blue)
  504.     write("               [x]")
  505.     funcs.ts(7,9)
  506.     term.setTextColor(colors.white)
  507.     term.setBackgroundColor(colors.gray)
  508.     write("                  ")
  509.     funcs.ts(7,10)
  510.     write("RUN:")
  511.     term.setBackgroundColor(colors.white)
  512.     for t=1,14 do
  513.      write(" ")
  514.     end  
  515.     term.setBackgroundColor(colors.gray)
  516.     funcs.ts(7,11)
  517.     write("                  ")
  518.     funcs.ts(11,10)
  519.     term.setTextColor(colors.black)
  520.     term.setBackgroundColor(colors.white)
  521.     ZULR=0
  522.     local function click46()
  523.      while ZULR==0 do
  524.       e,k,x,y=os.pullEvent("mouse_click")
  525.       if y==8 and x==23 then
  526.       ZULR=1
  527.       term.setCursorBlink(false)
  528.       end
  529.      end
  530.     end
  531.     local function type74()
  532.      IN=read()
  533.     end
  534.     parallel.waitForAny(click46,type74,time)
  535.     if ZULR==0 then
  536.      term.setCursorPos(29,17)
  537.      term.setBackgroundColor(colors.blue)
  538.      write("  ")
  539.      sleep(0.2)
  540.      term.setCursorPos(29,17)
  541.      term.setBackgroundColor(colors.lightBlue)
  542.      write("  ")
  543.      term.setBackgroundColor(colors.blue)
  544.      term.setCursorPos(20,10)
  545.      write("       ")
  546.      sleep(0.2)
  547.      term.setCursorPos(20,10)
  548.      term.setBackgroundColor(colors.lightBlue)
  549.      write("       ")
  550.      term.setBackgroundColor(colors.blue)
  551.      term.setCursorPos(10,3)
  552.      write("                      ")
  553.      sleep(0.2)
  554.      term.setBackgroundColor(colors.lightBlue)
  555.      term.setCursorPos(10,3)
  556.      write("                      ")
  557.      term.setBackgroundColor(colors.black)
  558.      term.clear()
  559.      sleep(0.1)
  560.      term.setBackgroundColor(colors.blue)
  561.      term.setCursorPos(1,1)
  562.      term.setTextColor(colors.red)
  563.      write("                    RUNNING                        ")
  564.      term.setCursorPos(1,2)
  565.      term.setBackgroundColor(colors.black)
  566.      term.setTextColor(colors.white)
  567.      shell.run(IN)  
  568.      sleep(2)
  569.     end
  570.    end
  571.   end
  572.  end
  573. end
  574. parallel.waitForAll(OS,funcs.player)
Advertisement
Add Comment
Please, Sign In to add comment