SHOW:
|
|
- or go back to the newest paste.
| 1 | --Assigning Local Variables | |
| 2 | local server = "computer_58" | |
| 3 | local channel = 3573 | |
| 4 | local side = "right" | |
| 5 | local verification = "AE0047Proc" | |
| 6 | local deny = "AE0047Den" | |
| 7 | local running = true | |
| 8 | local waiting = true | |
| 9 | local user = "" | |
| 10 | local pass = "" | |
| 11 | ||
| 12 | --Assigning Functions | |
| 13 | local function setup() | |
| 14 | modem = peripheral.wrap(side) | |
| 15 | modem.open(channel) | |
| 16 | end | |
| 17 | ||
| 18 | local function matchDomain(user1,pass1) | |
| 19 | if user1 == "ldshadowlord" and pass1 == "LibERTY" then | |
| 20 | modem.transmit(channel,channel,verification) | |
| 21 | print(user1.." was logged in succesfully") | |
| 22 | elseif user1 == "tydorius" and pass1 == "CensorEd" then | |
| 23 | modem.transmit(channel,channel,verification) | |
| 24 | else | |
| 25 | modem.transmit(channel,channel,deny) | |
| 26 | end | |
| 27 | end | |
| 28 | ||
| 29 | local function receive() | |
| 30 | local waiting = true | |
| 31 | while waiting do | |
| 32 | local event,nill,newchannel,nill,user,nill = os.pullEvent("modem_message")
| |
| 33 | print (user.." attempted to log in...") | |
| 34 | local event,nill,newchannel,nill,pass,nill = os.pullEvent("modem_message")
| |
| 35 | print ("Password was received..."..pass)
| |
| 36 | waiting = false | |
| 37 | end | |
| 38 | end | |
| 39 | ||
| 40 | --Main Program() | |
| 41 | setup() | |
| 42 | while running do | |
| 43 | receive() | |
| 44 | matchDomain(user,pass) | |
| 45 | end |