Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- --Listing Variables
- sendchan = 4862
- replchan = 14003
- auth = 8246
- accept = "AuthAccept"
- denied = "NoBall"
- --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
- --Functions
- function modtran(type)
- if type == "a" then
- m.transmit(sendchan, auth, accept)
- elseif type == "d" then
- m.transmit(sendchan, auth, denied)
- end
- end
- function PassCheck()
- local event, nil1, id, replyChannel, msg, nil2 = os.pullEvent("modem_message")
- if msg == "lucozade" then
- modtran(a)
- print("Connection Accepted")
- elseif msg == "su25tmflanker" then
- modtran(a)
- print("Connection Accepted")
- elseif msg == "dgm10" then
- modtran(a)
- print("Connection Accepted")
- else
- modtran(d)
- print("Connection Refused")
- end
- end
- --Main Program
- while true do
- PassCheck()
- end
Advertisement
Add Comment
Please, Sign In to add comment