Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- --MF stands for Multi Function
- --Author of API: CoolParker15
- --CC Forums: Pth1515
- --..if you try running it(bugged)
- --print("THIS IS A API, NOT A PROGRAM!, Use os.loadAPI((location of file)) to load it. Also, to run a function type in mfAPI.(function (1,2,etc.)")
- --------------------------------------
- --Functions
- --------------------------------------------------
- function download(url, name)
- local download = http.get(url)
- fstype = "w"
- local data = download.readAll()
- download.close()
- local file = fs.open(name, fstype)
- file.write(data)
- file.close()
- print()
- print("Connected to: "..url)
- print()
- print("Downloaded: "..name)
- print()
- end
- function clear()
- term.clear()
- term.setCursorPos(1,1)
- end
- function osClear()
- --Clears screen and emulates boot up screen
- term.clear()
- term.setCursorPos(1,1)
- term.setTextColor(colors.yellow)
- print("CraftOS ".._CC_VERSION)
- term.setTextColor(colors.white)
- end
- function cPrint(text, x, y)
- term.setCursorPos(x, y)
- print(text)
- end
- function randomnum()
- number = math.random()
- print(number)
- end
- function randomnum2(startnum, endnum)
- number = math.random(startnum, endnum)
- print(number)
- end
- function login(username, password, ctc)
- os.pullEvent = os.pullEventRaw
- tonumber(ctc)
- term.setCursorPos(20,1)
- term.clear()
- print("Login:")
- term.setCursorPos(1,3)
- write("Username: ")
- p1 = read()
- print()
- write("Password: ")
- p2 = read("*")
- term.setCursorPos(14,1)
- term.clear()
- print("Checking Credentials...")
- sleep(3)
- if p1 == username and p2 == password then
- term.setCursorPos(18,1)
- term.clear()
- term.setTextColor(colors.green)
- print("Access Granted")
- sleep(3)
- term.setCursorPos(1,1)
- term.clear()
- term.setTextColor(ctc)
- print("Welcome, "..username..".")
- print()
- else
- term.setCursorPos(18,1)
- term.clear()
- term.setTextColor(colors.red)
- print("Access Denied")
- sleep(3)
- os.reboot()
- end
- end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement