Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- function C()
- term.clear()
- end
- function CP(x,y)
- term.setCursorPos(x,y)
- end
- function BC(bgC)
- term.setBackgroundColor(bgC)
- end
- function TC(ttC)
- term.setTextColor(ttC)
- end
- function Write(text,Wx,Wy,Wbc,Wtc)
- CP(Wx,Wy)
- BC(Wbc)
- TC(Wtc)
- term.write(text)
- end
- function Input(text,rd,Ix,Iy,Ibc,Itc)
- CP(Ix,Iy)
- BC(Ibc)
- TC(Itc)
- term.write(text)
- return read(rd)
- end
- function F(Fy,Fcol)
- Write(" ",1,Fy,Fcol,Fcol)
- end
- function FS(fillCol,effect,eTime)
- y = 1
- if effect then
- for y = 1,19 do
- F(y,fillCol)
- sleep(eTime)
- end
- elseif not effect then
- for y = 1,19 do
- F(y,fillCol)
- end
- end
- end
- function ShellEvent(evt)
- a,b,c,d = os.pullEventRaw()
- if a == evt then
- return b,c,d
- end
- end
- function ShellEventAdv(a,b,c,d,e,f)
- evt,button,x,y = os.pullEventRaw()
- if evt == a then
- if button == b then
- if x >= c then
- if x <= d then
- if y >= e then
- if y <= f then
- return true
- else
- return false
- end
- else
- return false
- end
- else
- return false
- end
- else
- return false
- end
- else
- return false
- end
- else
- return false
- end
- end
- function PastebinGet(PBcode,Fpath)
- http.get(PBcode,Fpath)
- end
- function FsDel(Fpath)
- fs.delete(Fpath)
- end
- function FsMkdir(dir)
- fs.makeDir(dir)
- end
- function FsExists(file)
- return fs.exists(file)
- end
- function OsReboot()
- os.reboot()
- end
- function OsShutdown()
- os.shutdown()
- end
- function Api(api)
- os.loadAPI(api)
- end
- function Image(Image,x,y)
- img = paintutils.loadImage(Image)
- paintutils.drawImage(img,x,y)
- end
- function Button(text,x,midY,bgC,ttC)
- for x1 = x,(x + (string.len(text))) + 1 do
- Write(" ",x1,midY - 1,bgC,ttC)
- end
- Write(" "..text.." ",x,midY,bgC,ttC)
- for x1 = x,(x + (string.len(text))) + 1 do
- Write(" ",x1,midY + 1,bgC,ttC)
- end
- end
- FS(colors.white)
- F(1,colors.gray)
- F(2,colors.gray)
- F(3,colors.gray)
- Write("Nano Smart Apps",5,2,colors.gray,colors.white)
- Write("Installation and Setup",22,2,colors.gray,colors.lightGray)
- Write("Username - ",7,10,colors.white,colors.black)
- Write("Password - ",7,12,colors.white,colors.black)
- FsMkdir("/ProgramFiles/Nano/Users/Data/Logon")
- PastebinGet("RJabCAPR","/ProgramFiles/Nano/Users/Data/Logon/List")
- function Users()
- local file = fs.open("/ProgramFiles/Nano/Users/Data/Logon/List")
- data = file.readAll()
- return data
- end
- d = Users()
- u = true
- while u do
- user = Input("Username - ",nil,13,10,colors.white,colors.gray)
- if table.find(user,d) then
- pass = Input("Password - ","o",13,12,colors.white,colors.gray)
- truePassword = d[user]
- if pass == truePassword then
- Write("Correct",7,17,colors.white,colors.lime)
- sleep(2)
- u = false
- else
- Write("Incorrect",7,17,colors.white,colors.red)
- sleep(2)
- u = true
- end
- else
- Write("User Does not exist",7,17,colors.white,colors.orange)
- sleep(2)
- u = true
- end
- end
Advertisement
Add Comment
Please, Sign In to add comment