SHOW:
|
|
- or go back to the newest paste.
| 1 | --Loading External API's | |
| 2 | os.loadAPI("disk/nt")
| |
| 3 | ||
| 4 | --Assigning Local Variables | |
| 5 | local server = "computer_58" | |
| 6 | local channel = 3573 | |
| 7 | - | local side = "back" |
| 7 | + | local version = 2.4 |
| 8 | local side = "left" | |
| 9 | local user = "" | |
| 10 | local pass = "" | |
| 11 | ||
| 12 | - | local function setup() |
| 12 | + | |
| 13 | function setup() | |
| 14 | modem = peripheral.wrap(side) | |
| 15 | modem.open(channel) | |
| 16 | end | |
| 17 | - | local function drawScreen() |
| 17 | + | |
| 18 | - | nt. |
| 18 | + | local function boot() |
| 19 | nt.clearPage() | |
| 20 | nt.centerPrint("VirtuSoft Systems")
| |
| 21 | nt.centerPrint("-------------------")
| |
| 22 | nt.centerPrint(" ")
| |
| 23 | print("User logged in as "..user)
| |
| 24 | end | |
| 25 | ||
| 26 | function drawScreen() | |
| 27 | nt.clearPage() | |
| 28 | term.setTextColour(colours.lightGrey) | |
| 29 | nt.centerPrint(" Control Panel")
| |
| 30 | term.setCursorPos(15,1) | |
| 31 | term.setTextColour(colours.red) | |
| 32 | print("Virtu")
| |
| 33 | term.setCursorPos(20,1) | |
| 34 | term.setTextColour(colours.cyan) | |
| 35 | print("Soft")
| |
| 36 | term.setTextColour(colours.white) | |
| 37 | nt.centerPrint("-------------------------")
| |
| 38 | term.setCursorPos(1,18) | |
| 39 | nt.centerPrint("DigiTec Login Software // V"..version)
| |
| 40 | term.setCursorPos(1,4) | |
| 41 | nt.centerPrint("Please enter your username & password")
| |
| 42 | print(" ")
| |
| 43 | print(" ")
| |
| 44 | print(" ")
| |
| 45 | term.setTextColour(colours.red) | |
| 46 | term.write(" Username: ")
| |
| 47 | term.setTextColour(colours.white) | |
| 48 | ui = read() | |
| 49 | term.setTextColour(colours.cyan) | |
| 50 | term.write(" Password: ")
| |
| 51 | term.setTextColour(colours.white) | |
| 52 | pi = read("*")
| |
| 53 | user = string.lower(ui) | |
| 54 | pass = pi | |
| 55 | end | |
| 56 | ||
| 57 | function newveri() | |
| 58 | print("1")
| |
| 59 | modem.transmit(channel,channel,user) | |
| 60 | modem.transmit(channel,channel,pass) | |
| 61 | local running = true | |
| 62 | while running do | |
| 63 | print("2")
| |
| 64 | local event,nill,newchannel,nill,veri,nill = os.pullEvent("modem_message")
| |
| 65 | print("Got Event!"..veri)
| |
| 66 | running = false | |
| 67 | print("3")
| |
| 68 | sleep(2) | |
| 69 | if veri == "AE0047Proc" then | |
| 70 | boot() | |
| 71 | clocking = false | |
| 72 | elseif veri == "AE0047Den" then | |
| 73 | nt.clearPage() | |
| 74 | term.settextColour(colours.red) | |
| 75 | nt.centerPrint("Failed Login!")
| |
| 76 | sleep(3) | |
| 77 | end | |
| 78 | print(" 4 ")
| |
| 79 | sleep(2) | |
| 80 | end | |
| 81 | end |