Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- local max = 10
- local test = peripheral.wrap("right")
- local pTable = {}
- local Users = {}
- test.clear()
- function addMessage(sender, message)
- if #pTable < max then
- print("test")
- pTable[#pTable+1] = test.addText(1, (#pTable+1)*10, pl..": "..com, colors.blue)
- else
- for x=1, #pTable-1 do
- pTable[x].setText(pTable[x+1].getText())
- end
- pTable[max].setText(pl..": "..com)
- end
- print(pl..": "..com)
- end
- while true do
- e, side, pl, p1, com = os.pullEvent("glasses_chat_command")
- --if com == "#clear" then
- --os.reboot()
- --end
- --if com == "#hist" then
- --local list = ""
- --for x=1,#Users do
- --list = list..Users[x].." "
- --end
- --addMessage("Terminal",list)
- --else
- addMessage(pl, com)
- --table.insert(Users, pl)
- --end
- end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement