Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- --Anti CtrlT
- os.pullEvent=os.pullEventRaw
- --Variables
- ntapiloc = shell.resolve("nerdtalk")
- sendchan = 14003
- replchan = 4862
- auth = 8246
- compid = os.getID()
- --Loading API's
- if not fs.exists(ntapiloc) then
- print("Nerdtalk is not present on this system, attempting to download...")
- if http then
- local wHandle = http.get("http://pastebin.com/raw.php?i=9zdaF9SV")
- if wHandle then
- local fHandle = fs.open(ntapiloc, "w")
- if fHandle then
- fHandle.write(wHandle.readAll())
- fHandle.close()
- else
- print("Could not open executable for writing.")
- end
- wHandle.close()
- else
- print("Could not connect to pastebin.")
- end
- else
- print("HTTP is disabled.")
- end
- end
- os.loadAPI(ntapiloc)
- --Modem Detection
- for a,b in pairs(rs.getSides()) do
- if peripheral.getType(b) == 'modem' then
- m = peripheral.wrap(b)
- m.open(sendchan)
- m.open(replchan)
- break
- end
- end
- --Sub Functions
- function checkID()
- if compid == 469 then
- logging = false
- end
- end
- function header()
- nerdtalk.clearPage()
- nerdtalk.centerPrint("| Magpie Industries |")
- nerdtalk.centerPrint(" ------------------- ")
- end
- --Main Program
- function login()
- header()
- print(" ")
- print(" ")
- print(" ")
- nerdtalk.leftWrite(" Password: ")
- ui = read("*")
- m.transmit(sendchan, replchan, ui)
- local event, nil1, id, authchan, msg, nil2 = os.pullEvent("modem_message")
- if authchan == auth then
- if msg == "AuthAccept" then
- header()
- nerdtalk.centerPrint("Connection Accepted")
- logging = false
- elseif msg == "NoBall" then
- nerdtalk.centerPrint("Incorrect")
- else
- nerdtalk.clearPage()
- term.setCursorPos(1, 9)
- nerdtalk.centerPrint("Incorrect Password")
- end
- end
- end
- logging = true
- checkID()
- while logging do
- login()
- end
Advertisement
Add Comment
Please, Sign In to add comment