Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- id = 35
- --[Functions]--
- function draw()
- term.setCursorPos(1,17)
- term.setBackgroundColor(colors.gray)
- term.clearLine()
- term.setBackgroundColor(colors.black)
- term.setCursorPos(1,16)
- term.clearLine()
- end
- local nick = read()
- --rednet.send(31,nick..": "..read())
- --local id, msg, dst = rednet.receive()
- --print(msg)
- function event()
- local event, a, b, c = os.pullEventRaw()
- if event == "mouse_click" and c == 17 then
- term.setCursorPos(2,17)
- term.setBackgroundColor(colors.gray)
- local msg = read()
- rednet.send(id,nick..": "..msg)
- term.setBackgroundColor(colors.black)
- draw()
- elseif event == "rednet_message" then
- term.scroll(1)
- draw()
- term.setCursorPos(2,14)
- term.write(b)
- elseif event == "terminate" then
- rednet.send(id,"Server: "..nick.." has left the chat")
- os.reboot()
- end
- end
- --[Code]--
- rednet.open("right")
- term.clear()
- draw()
- rednet.send(id,"Server: "..nick.." has joined the chat")
- while true do
- event()
- end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement