SHOW:
|
|
- or go back to the newest paste.
1 | os.pullEvent = os.pullEventRaw | |
2 | w,h = term.getSize() | |
3 | - | rednet.open("back") |
3 | + | |
4 | term.setBackgroundColor(colors.black) | |
5 | shell.run("clear") | |
6 | term.setTextColor(colors.yellow) | |
7 | print("Cre3peYsTim3ouT1.7 OS") | |
8 | term.setTextColor(colors.white) | |
9 | end | |
10 | function loadImage() | |
11 | if fs.exists("Image/image") == false then | |
12 | shell.run("pastebin","get","xiz4Yg8E","Image/image") | |
13 | image = paintutils.loadImage("Image/image") | |
14 | else | |
15 | image = paintutils.loadImage("Image/image") | |
16 | end | |
17 | end | |
18 | loadImage() | |
19 | function TaskBar() | |
20 | term.setCursorPos(1,1) | |
21 | term.setBackgroundColor(colors.lightBlue) | |
22 | term.clearLine() | |
23 | term.setTextColor(colors.white) | |
24 | term.setCursorPos(w-string.len("ID: "..os.getComputerID())+1,1) | |
25 | term.write("ID: "..os.getComputerID()) | |
26 | end | |
27 | function Screen() | |
28 | term.setBackgroundColor(colors.white) | |
29 | term.clear() | |
30 | TaskBar() | |
31 | loadImage() | |
32 | end | |
33 | function Pass() | |
34 | term.setBackgroundColor(colors.white) | |
35 | term.setTextColor(colors.black) | |
36 | term.setCursorPos(2,3) | |
37 | print("User :") | |
38 | term.setCursorPos(2,4) | |
39 | print("Password:") | |
40 | term.setCursorPos(2,5) | |
41 | print("Code :") | |
42 | for l = 1, 3 do | |
43 | term.setCursorPos(2,h-1) | |
44 | term.clearLine() | |
45 | print("Loading Users.") | |
46 | sleep(0,5) | |
47 | term.setCursorPos(2,h-1) | |
48 | term.clearLine() | |
49 | print("Loading Users..") | |
50 | sleep(0,5) | |
51 | term.setCursorPos(2,h-1) | |
52 | term.clearLine() | |
53 | print("Loading Users...") | |
54 | sleep(0,5) | |
55 | end | |
56 | term.setCursorPos(2,h-1) | |
57 | term.clearLine() | |
58 | end | |
59 | Screen() | |
60 | paintutils.drawImage(image,16,6) | |
61 | if fs.exists("Pass/Pass") == false then | |
62 | term.setBackgroundColor(colors.white) | |
63 | term.setTextColor(colors.black) | |
64 | term.setCursorPos(2,3) | |
65 | print("Not Users Avalible") | |
66 | term.setCursorPos(2,4) | |
67 | print("Skip Login Screen") | |
68 | - | print("Waiting of Administrator...") |
68 | + | |
69 | - | while true do |
69 | + | return |
70 | - | id,message = rednet.receive() |
70 | + | |
71 | - | if message == "unlock" then |
71 | + | |
72 | term.setTextColor(colors.black) | |
73 | - | break |
73 | + | |
74 | - | elseif message == "lock" then |
74 | + | |
75 | user = read() | |
76 | - | term.setTextColor(colors.red) |
76 | + | |
77 | passkey = read("*") | |
78 | - | print("Access Denied") |
78 | + | |
79 | code = read("*") | |
80 | - | os.shutdown() |
80 | + | |
81 | p = 0 | |
82 | fs.makeDir("Pass") | |
83 | local file = fs.open("Pass/Pass","r") | |
84 | local fileData = {} | |
85 | local line = file.readLine() | |
86 | repeat | |
87 | table.insert(fileData,line) | |
88 | line = file.readLine() | |
89 | until line == nil | |
90 | file.close() | |
91 | layer = #fileData | |
92 | while z <= layer do | |
93 | if user == fileData[z] and passkey == fileData[z+1] then | |
94 | if code == string.sub(fileData[z+2], 1,string.len(fileData[z+2])-2) then | |
95 | p = 1 | |
96 | end | |
97 | elseif user == fileData[z] and passkey ~= fileData[z+1] then | |
98 | p = 2 | |
99 | end | |
100 | z = z + 3 | |
101 | end | |
102 | if p == 0 then | |
103 | term.setBackgroundColor(colors.white) | |
104 | term.setTextColor(colors.black) | |
105 | term.setCursorPos(2,7) | |
106 | print("Try Again") | |
107 | sleep(3) | |
108 | shell.run("startup") | |
109 | elseif p == 1 then | |
110 | Screen() | |
111 | paintutils.drawImage(image,16,6) | |
112 | term.setBackgroundColor(colors.white) | |
113 | term.setTextColor(colors.black) | |
114 | term.setCursorPos(2,3) | |
115 | print("Hello "..user) | |
116 | sleep(3) | |
117 | Log() | |
118 | elseif p == 2 then | |
119 | term.setBackgroundColor(colors.white) | |
120 | term.setTextColor(colors.black) | |
121 | term.setCursorPos(2,7) | |
122 | print("Try Again") | |
123 | sleep(3) | |
124 | shell.run("startup") | |
125 | end | |
126 | end |