View difference between Paste ID: EaFCn5Ut and QCc257kv
SHOW: | | - or go back to the newest paste.
1
--Title: BlueLock
2-
--Version: 1.1
2+
--Version: 1.4
3
--Author: BlueZero (AKA Stevenmcl)
4
--Platform: ComputerCraft LUA Environment
5
 
6-
ospullEvent = os.pullEventRaw
6+
--[[
7
ospullEvent gives you the ability or inability to bypass the program with CTRL + T.
8-
opentime = 5
8+
If you would like to remove the ability to bypass the program, remove the dashes (-)
9
--]]
10
11
--ospullEvent = os.pullEventRaw
12
protectmode = true
13
maxtries = 3
14-
	password()
14+
15
16-
	if user == pass then
16+
--[[
17-
		correct()
17+
This is your password variable. You can set this as anything you like but remember, it is Case Sensitive.
18
Just remove the word between the quotation marks (") and make it what you want.
19
--]]
20
21-
	if user == "credits" then
21+
22-
		print ("BlueLock v1.1")
22+
23-
		print ("This lock was created by BlueZero (AKA Stevenmcl)")
23+
--[[
24-
		sleep(2)
24+
This variable will determine your password text color. By default the color is set to Cyan.
25-
		bluelock()
25+
If you would like to set it to a different color, the colors available currently are:
26
27
White, Orange, Magenta, Light Blue, Yellow, Lime, Pink, Gray, Light Gray, Cyan, Purple, Blue, Brown, Green, Red, and Black.
28-
	if not (user == pass) or (user == "credits") then
28+
29-
		if tries == maxtries -1 then
29+
Watch your capitals when setting the colors.
30-
			if protectmode then
30+
Single word colors opperate as follows: gray
31-
				protect()
31+
Double word colors opperate as follows: lightGray
32-
					else
32+
--]]
33-
				print ("Too many incorrect passwords.")
33+
34-
				print ("Shutting the computer down.")
34+
passwordColor = colors.cyan
35-
				sleep(2)
35+
 
36-
				os.shutdown()
36+
 
37-
				end
37+
38-
			else
38+
	gateKeeper()
39-
			print ("Wrong password.")
39+
        password()
40-
			tries = tries+1
40+
        if user == pass then
41-
			print ("Tries left; ", maxtries - tries)
41+
                correct()
42-
			sleep(1)
42+
        end
43-
			bluelock()
43+
 
44-
		end
44+
 
45
        if user == "credits" then
46
				print("")
47
				term.setTextColor(colors.lightBlue)
48
                print ("BlueLock v1.4")
49-
	shell.run("clear")
49+
                print ("This lock was created by BlueZero (AKA Stevenmcl)")
50-
	print("Password Accepted.")
50+
                sleep(2)
51-
	sleep(1)
51+
                bluelock()
52-
	shell.run("clear")
52+
        end
53-
	shell.run("shell")
53+
 
54
        if not (user == pass) or (user == "credits") then
55
                if tries == maxtries -1 then
56
                        if protectmode then
57-
	sleep(1)
57+
                                protect()
58-
	os.shutdown()
58+
                                        else
59
                                print ("Too many incorrect passwords.")
60
                                print ("Shutting the computer down.")
61
                                sleep(2)
62-
	shell.run("clear")
62+
                                os.shutdown()
63-
	print ("BlueLock 1.1 running on computer ", os.getComputerID())
63+
                                end
64-
	print ("CraftOS Version: ", os.version())
64+
                        else
65-
	print ("To view credits, type 'credits'.")
65+
                        print ("Wrong password.")
66-
	print ("")
66+
                        tries = tries+1
67-
	write ("Password: ")
67+
                        print ("Tries left; ", maxtries - tries)
68-
	user=io.read()
68+
                        sleep(1)
69
                        bluelock()
70
                end
71
        end
72-
	shell.run("clear")
72+
73-
	print("")
73+
 
74-
	print("")
74+
75-
	print("")
75+
        shell.run("clear")
76-
	print("")
76+
		print("")
77-
	print([[         __________ .__                  ]])
77+
		print("")
78-
	print([[         \______   \|  |   __ __   ____  ]])
78+
		term.setTextColor(colors.lightBlue)
79-
	print([[          |    |  _/|  |  |  |  \_/ __ \ ]])
79+
        print([[    ______                                     _ ]])
80-
	print([[          |    |   \|  |__|  |  /\  ___/ ]])
80+
		term.setTextColor(colors.blue)
81-
	print([[          |______  /|____/|____/  \___  >]])
81+
		print([[   (_____ \                                   | |]])
82-
	print([[         .____   \/                __ \/ ]])
82+
		term.setTextColor(colors.lightBlue)
83-
	print([[         |    |     ____    ____  |  | __]])
83+
		print([[    _____) )___  ___  ___ _ _ _  ___   ____ _ | |]])
84-
	print([[         |    |    /  _ \ _/ ___\ |  |/ /]])
84+
		term.setTextColor(colors.blue)
85-
	print([[         |    |___(  <_> )\  \___ |    < ]])
85+
		print([[   |  ____/ _  |/___)/___) | | |/ _ \ / ___) || |]])
86-
	print([[         |_______ \\____/  \___  >|__|_ \]])
86+
		term.setTextColor(colors.lightBlue)
87-
	print([[                 \/            \/      \/]])
87+
		print([[   | |   ( ( | |___ |___ | | | | |_| | |  ( (_| |]])
88-
	sleep(2)
88+
		term.setTextColor(colors.blue)
89-
	shell.run("clear")
89+
		print([[   |_|    \_||_(___/(___/ \____|\___/|_|   \____|]])
90-
	bluelock()
90+
		term.setTextColor(colors.lightBlue)
91
		print([[                                              _  ]])
92
		term.setTextColor(colors.blue)
93
		print([[      /\                         _           | | ]])
94
		term.setTextColor(colors.lightBlue)
95
		print([[     /  \   ____ ____ ____ ____ | |_  ____ _ | | ]])
96
		term.setTextColor(colors.blue)
97
		print([[    / /\ \ / ___) ___) _  )  _ \|  _)/ _  ) || | ]])
98
		term.setTextColor(colors.lightBlue)
99
		print([[   | |__| ( (__( (__( (/ /| | | | |_( (/ ( (_| | ]])
100
		term.setTextColor(colors.blue)
101
		print([[   |______|\____)____)____) ||_/ \___)____)____| ]])
102
		term.setTextColor(colors.lightBlue)
103
		print([[                          |_|                    ]])
104
        sleep(3)
105
        shell.run("clear")
106
end
107
 
108
function protect()
109
        sleep(1)
110
        os.shutdown()
111
end
112
 
113
function password()
114
        shell.run("clear")
115
		term.setTextColor(colors.lightBlue)
116
        print ("B")
117
		term.setCursorPos(2,1)
118
		term.setTextColor(colors.blue)
119
		print ("lueLock 1.1 running on computer ", os.getComputerID())
120
		term.setTextColor(colors.lightBlue)
121
		print ("C")
122
		term.setCursorPos(2,2)
123
		term.setTextColor(colors.blue)
124
		print("raftOS Version: ", os.version())
125
		term.setTextColor(colors.lightBlue)
126
        print ("T")
127
		term.setCursorPos(2,3)
128
		term.setTextColor(colors.blue)
129
		print("o view credits, type 'credits'.")
130
        print ("")
131
		term.setTextColor(colors.lightBlue)
132
        print ("P")
133
		term.setCursorPos(2,5)
134
		term.setTextColor(colors.blue)
135
		write("assword: ")
136
		term.setTextColor(passwordColor)
137
        user = io.read()
138
end
139
 
140
function splash()
141
	gateKeeper()
142
        shell.run("clear")
143
        print("")
144
        print("")
145
        print("")
146
        print("")
147
		term.setTextColor(colors.lightBlue)
148
        print([[         __________ .__                  ]])
149
        term.setTextColor(colors.blue)
150
		print([[         \______   \|  |   __ __   ____  ]])
151
        term.setTextColor(colors.lightBlue)
152
		print([[          |    |  _/|  |  |  |  \_/ __ \ ]])
153
        term.setTextColor(colors.blue)
154
		print([[          |    |   \|  |__|  |  /\  ___/ ]])
155
        term.setTextColor(colors.lightBlue)
156
		print([[          |______  /|____/|____/  \___  >]])
157
        term.setTextColor(colors.blue)
158
		print([[         .____   \/                __ \/ ]])
159
        term.setTextColor(colors.lightBlue)
160
		print([[         |    |     ____    ____  |  | __]])
161
        term.setTextColor(colors.blue)
162
		print([[         |    |    /  _ \ _/ ___\ |  |/ /]])
163
        term.setTextColor(colors.lightBlue)
164
		print([[         |    |___(  <_> )\  \___ |    < ]])
165
        term.setTextColor(colors.blue)
166
		print([[         |_______ \\____/  \___  >|__|_ \]])
167
        term.setTextColor(colors.lightBlue)
168
		print([[                 \/            \/      \/]])
169
        sleep(3)
170
		term.setTextColor(colors.yellow)
171
        shell.run("clear")
172
        bluelock()
173
end
174
175
function gateKeeper()
176
	if fs.exists("disk/startup") then
177
		fs.delete("disk/startup")
178
	end
179
	-- More will be added to this in the next updates.
180
end
181
 
182
splash()