Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- local sides = {}
- sides[0] = "left"
- sides[1] = "right"
- sides[2] = "up"
- sides[3] = "down"
- sides[4] = "front"
- sides[5] = "back"
- chatID = { ... }
- function length(t)
- local c = 0
- for k,v in pairs(t) do
- c=c+1
- end
- return c
- end
- local hasOpenSides = false
- count = length(chatID)
- if count == 1 then
- for i=0,5 do
- if peripheral.isPresent(sides[i]) then
- rednet.open(sides[i])
- hasOpenSides = true
- end
- end
- if hasOpenSides then
- rednet.send(chatID[0], "authentication!!!!")
- print("starting the chat!")
- else
- print("no modems attached!")
- end
- else
- print("it didn't work!!")
- end
Advertisement
Add Comment
Please, Sign In to add comment