EvilGamer

Untitled

Jun 9th, 2015
246
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Lua 8.00 KB | None | 0 0
  1. function usersettings()
  2.   term.setTextColor(1)
  3.   term.setBackgroundColor(1)
  4.   term.clear()
  5.  
  6.   paintutils.drawLine(1, 1, 51, 1, colors.red)
  7.   paintutils.drawLine(1, 19, 51, 19, colors.red)
  8.   paintutils.drawLine(15, 1, 15, 19, colors.red)
  9.  
  10.   paintutils.drawFilledBox(1, 2, 14, 18, colors.gray)
  11.  
  12.   term.setCursorPos(2,3)
  13.   term.write('User >')
  14.  
  15.   term.setCursorPos(2,5)
  16.   term.write('System')
  17.  
  18.   term.setCursorPos(2,7)
  19.   term.write('Desktop')
  20.  
  21.   term.setCursorPos(2,9)
  22.   term.write('Info')
  23.  
  24.   term.setCursorPos(2,17)
  25.   term.write('< desktop')
  26. end
  27.  
  28. function systemsettings()
  29.   term.setTextColor(1)
  30.   term.setBackgroundColor(1)
  31.   term.clear()
  32.  
  33.   paintutils.drawLine(1, 1, 51, 1, colors.red)
  34.   paintutils.drawLine(1, 19, 51, 19, colors.red)
  35.   paintutils.drawLine(15, 1, 15, 19, colors.red)
  36.  
  37.   paintutils.drawFilledBox(1, 2, 14, 18, colors.gray)
  38.  
  39.   term.setCursorPos(2,3)
  40.   term.write('User')
  41.  
  42.   term.setCursorPos(2,5)
  43.   term.write('System >')
  44.  
  45.   term.setCursorPos(2,7)
  46.   term.write('Desktop')
  47.  
  48.   term.setCursorPos(2,9)
  49.   term.write('Info')
  50.  
  51.   term.setCursorPos(2,17)
  52.   term.write('< desktop')
  53. end
  54.  
  55. function desktopsettings()
  56.   term.setTextColor(1)
  57.   term.setBackgroundColor(1)
  58.   term.clear()
  59.  
  60.   paintutils.drawLine(1, 1, 51, 1, colors.red)
  61.   paintutils.drawLine(1, 19, 51, 19, colors.red)
  62.   paintutils.drawLine(15, 1, 15, 19, colors.red)
  63.  
  64.   paintutils.drawFilledBox(1, 2, 14, 18, colors.gray)
  65.  
  66.   term.setCursorPos(2,3)
  67.   term.write('User')
  68.  
  69.   term.setCursorPos(2,5)
  70.   term.write('System')
  71.  
  72.   term.setCursorPos(2,7)
  73.   term.write('Desktop >')
  74.  
  75.   term.setCursorPos(2,9)
  76.   term.write('Info')
  77.  
  78.   term.setCursorPos(2,17)
  79.   term.write('< desktop')
  80. end
  81.  
  82. function info()
  83.   term.setTextColor(1)
  84.   term.setBackgroundColor(1)
  85.   term.clear()
  86.  
  87.   paintutils.drawLine(1, 1, 51, 1, colors.red)
  88.   paintutils.drawLine(1, 19, 51, 19, colors.red)
  89.   paintutils.drawLine(15, 1, 15, 19, colors.red)
  90.  
  91.   paintutils.drawFilledBox(1, 2, 14, 18, colors.gray)
  92.  
  93.   term.setCursorPos(2,3)
  94.   term.write('User')
  95.  
  96.   term.setCursorPos(2,5)
  97.   term.write('System')
  98.  
  99.   term.setCursorPos(2,7)
  100.   term.write('Desktop')
  101.  
  102.   term.setCursorPos(2,9)
  103.   term.write('Info >')
  104.  
  105.   term.setCursorPos(2,17)
  106.   term.write('< desktop')
  107. end
  108.  
  109. function settings()
  110.   term.setTextColor(1)
  111.   term.setBackgroundColor(1)
  112.   term.clear()
  113.  
  114.   paintutils.drawLine(1, 1, 51, 1, colors.red)
  115.   paintutils.drawLine(1, 19, 51, 19, colors.red)
  116.   paintutils.drawLine(15, 1, 15, 19, colors.red)
  117.  
  118.   paintutils.drawFilledBox(1, 2, 14, 18, colors.gray)
  119.  
  120.   term.setCursorPos(2,3)
  121.   term.write('User')
  122.  
  123.   term.setCursorPos(2,5)
  124.   term.write('System')
  125.  
  126.   term.setCursorPos(2,7)
  127.   term.write('Desktop')
  128.  
  129.   term.setCursorPos(2,9)
  130.   term.write('Info')
  131.  
  132.   term.setCursorPos(2,17)
  133.   term.write('< desktop')
  134.  
  135.   while true do
  136.  
  137.   local event, button, xPos, yPos = os.pullEvent("mouse_click")
  138.  
  139.   if xPos > 1 and xPos < 11 and yPos == 17 then
  140.   DESKTOP()
  141.  
  142.   elseif xPos > 1 and xPos < 6 and yPos == 3 then
  143.   usersettings()
  144.  
  145.   elseif xPos > 1 and xPos < 9 and yPos == 5 then
  146.   systemsettings()
  147.  
  148.   elseif xPos > 1 and xPos < 10 and yPos == 7 then
  149.   desktopsettings()
  150.  
  151.   elseif xPos > 1 and xPos < 6 and yPos == 9 then
  152.   info()
  153. end
  154. end
  155. end
  156.  
  157. function DESKTOP()
  158.   while true do
  159.   term.setTextColor(1)
  160.   term.setBackgroundColor(1)
  161.   term.clear()
  162.  
  163.   paintutils.drawPixel(1, 1, colors.red)
  164.   paintutils.drawLine(5, 1, 51, 1, colors.red)
  165.   paintutils.drawLine(1, 19, 51, 19, colors.red)
  166.  
  167.   paintutils.drawLine(2, 1, 4, 1, colors.gray)
  168.   term.setCursorPos(2,1)
  169.   term.write('EOS')
  170.  
  171.   local event, button, xPos, yPos = os.pullEvent("mouse_click")
  172.  
  173.   if xPos > 1 and xPos < 5 and yPos == 1 then
  174.   settings()
  175. end
  176. end
  177. end
  178.  
  179. function welcome()
  180.   term.setTextColor(16384)
  181.   term.setBackgroundColor(1)
  182.   term.clear()
  183.   term.setCursorPos(25,10)
  184.   term.write("ooo")
  185.  
  186.   paintutils.drawLine(1, 1, 51, 1, colors.red)
  187.   paintutils.drawLine(1, 1, 1, 19, colors.red)
  188.   paintutils.drawLine(1, 19, 51, 19, colors.red)
  189.   paintutils.drawLine(51, 19, 51, 1, colors.red)
  190.  
  191.   sleep(0.2)
  192.  
  193.   term.setTextColor(16384)
  194.   term.setBackgroundColor(1)
  195.   term.clear()
  196.   term.setCursorPos(25,10)
  197.   term.write("0oo")
  198.  
  199.   paintutils.drawLine(1, 1, 51, 1, colors.red)
  200.   paintutils.drawLine(1, 1, 1, 19, colors.red)
  201.   paintutils.drawLine(1, 19, 51, 19, colors.red)
  202.   paintutils.drawLine(51, 19, 51, 1, colors.red)
  203.  
  204.   sleep(0.2)
  205.  
  206.   term.setTextColor(16384)
  207.   term.setBackgroundColor(1)
  208.   term.clear()
  209.   term.setCursorPos(25,10)
  210.   term.write("o0o")
  211.  
  212.   paintutils.drawLine(1, 1, 51, 1, colors.red)
  213.   paintutils.drawLine(1, 1, 1, 19, colors.red)
  214.   paintutils.drawLine(1, 19, 51, 19, colors.red)
  215.   paintutils.drawLine(51, 19, 51, 1, colors.red)
  216.  
  217.   sleep(0.2)
  218.  
  219.   term.setTextColor(16384)
  220.   term.setBackgroundColor(1)
  221.   term.clear()
  222.   term.setCursorPos(25,10)
  223.   term.write("oo0")
  224.  
  225.   paintutils.drawLine(1, 1, 51, 1, colors.red)
  226.   paintutils.drawLine(1, 1, 1, 19, colors.red)
  227.   paintutils.drawLine(1, 19, 51, 19, colors.red)
  228.   paintutils.drawLine(51, 19, 51, 1, colors.red)
  229. end
  230.  
  231. function welcomeuser()
  232.   term.setTextColor(16384)
  233.   term.setBackgroundColor(1)
  234.   term.clear()
  235.   term.setCursorPos(18,10)
  236.   term.write('Welcome, '..logread..'!')
  237.  
  238.   paintutils.drawLine(1, 1, 51, 1, colors.red)
  239.   paintutils.drawLine(1, 1, 1, 19, colors.red)
  240.   paintutils.drawLine(1, 19, 51, 19, colors.red)
  241.   paintutils.drawLine(51, 19, 51, 1, colors.red)
  242.  
  243.   sleep(5)
  244.   DESKTOP()
  245. end
  246.  
  247.  
  248. function startwelcome()
  249.   welcome()
  250.   sleep(0.2)
  251.   welcome()
  252.   sleep(0.2)
  253.   welcome()
  254.   sleep(0.2)
  255.   welcome()
  256.   sleep(0.2)
  257.   welcomeuser()
  258. end
  259.  
  260. function auth()
  261.   logAPI.authlog("Waiting for auth...")
  262.   while true do
  263.   term.setTextColor(16384)
  264.   term.setBackgroundColor(1)
  265.   term.clear()
  266.   term.setCursorPos(19,3)
  267.   term.write("Authorization")
  268.  
  269.  
  270.   paintutils.drawLine(15, 9, 37, 9, colors.red)
  271.   paintutils.drawLine(15, 5, 37, 5, colors.red)
  272.   paintutils.drawLine(38, 5, 38, 9, colors.red)
  273.   paintutils.drawLine(14, 5, 14, 9, colors.red)
  274.  
  275.   paintutils.drawLine(1, 1, 51, 1, colors.red)
  276.   paintutils.drawLine(1, 1, 1, 19, colors.red)
  277.   paintutils.drawLine(1, 19, 51, 19, colors.red)
  278.   paintutils.drawLine(51, 19, 51, 1, colors.red)  
  279.  
  280.   paintutils.drawLine(16, 7, 36, 7, colors.red)
  281.  
  282.   term.setCursorPos(16,7)
  283.   term.setTextColor(1)
  284.   term.write("Login:")
  285.   term.setCursorPos(23,7)
  286.   l = "login"
  287.   logread = read()
  288.   logAPI.lauthlog(logread)
  289.  
  290.   if fs.exists('/.root/.programs/.login/.accounts/'..logread..'.db') then
  291.   paintutils.drawPixel(25, 11, colors.green)
  292.   paintutils.drawPixel(28, 11, colors.green)
  293.   paintutils.drawPixel(25, 12, colors.green)
  294.   paintutils.drawPixel(25, 13, colors.green)
  295.   paintutils.drawPixel(26, 13, colors.green)
  296.   paintutils.drawPixel(27, 12, colors.green)
  297.   sleep(1)
  298.  
  299.   while true do
  300.   term.setTextColor(16384)
  301.   term.setBackgroundColor(1)
  302.   term.clear()
  303.   term.setCursorPos(19,3)
  304.   term.write("Authorization")
  305.  
  306.  
  307.   paintutils.drawLine(15, 9, 37, 9, colors.red)
  308.   paintutils.drawLine(15, 5, 37, 5, colors.red)
  309.   paintutils.drawLine(38, 5, 38, 9, colors.red)
  310.   paintutils.drawLine(14, 5, 14, 9, colors.red)
  311.  
  312.   paintutils.drawLine(1, 1, 51, 1, colors.red)
  313.   paintutils.drawLine(1, 1, 1, 19, colors.red)
  314.   paintutils.drawLine(1, 19, 51, 19, colors.red)
  315.   paintutils.drawLine(51, 19, 51, 1, colors.red)  
  316.  
  317.   paintutils.drawLine(16, 7, 36, 7, colors.red)
  318.  
  319.   term.setCursorPos(16,7)
  320.   term.setTextColor(1)
  321.   term.write("Password: ")
  322.   term.setCursorPos(26,7)
  323.  
  324.   pread = read()
  325.   logAPI.pauthlog(pread)
  326.  
  327.   local fp = fs.open('/.root/.programs/.login/.accounts/'..logread..'.db', 'r')
  328.   local fpl1 = fp.readLine(1)
  329.  
  330.   if pread == fpl1 then
  331.   paintutils.drawPixel(25, 11, colors.green)
  332.   paintutils.drawPixel(28, 11, colors.green)
  333.   paintutils.drawPixel(25, 12, colors.green)
  334.   paintutils.drawPixel(25, 13, colors.green)
  335.   paintutils.drawPixel(26, 13, colors.green)
  336.   paintutils.drawPixel(27, 12, colors.green)
  337.   sleep(1)
  338.   logAPI.reglog("Auth success.")
  339.   startwelcome()
  340.   end
  341. end
  342. end
  343. end
  344. end
  345.  
  346. auth()
Advertisement
Add Comment
Please, Sign In to add comment