Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- rednet.open("top")
- mon = peripheral.wrap("left")
- term.clear()
- mon.clear()
- term.setCursorPos(16,2)
- mon.setCursorPos(9,1)
- term.setTextColor(32)
- mon.setTextColor(32)
- print("Welcome in global chat")
- mon.write("Welcome in glogal chat")
- term.setCursorPos(11,3)
- mon.setCursorPos(3,2)
- print("Click to speak and press e to left")
- mon.write("Click to speak and presse e to left")
- term.setTextColor(1)
- mon.setTextColor(1)
- while true do
- local event, param1, message = os.pullEvent()
- if event == "mouse_click" then
- term.setCursorPos(3,15)
- mon.setCursorPos(3,12)
- term.setTextColor(8)
- mon.setTextColor(8)
- write("#1 : ")
- local msg = read()
- mon.write("#1 : "..msg)
- rednet.broadcast(msg)
- term.scroll(1)
- mon.scroll(1)
- term.setCursorPos(3,15)
- mon.setCursorPos(3,12)
- term.setTextColor(1)
- mon.setTextColor(1)
- end
- if event == "rednet_message" then
- term.setCursorPos(3,15)
- mon.setCursorPos(3,12)
- if message == " ooO #2 has disconected Ooo " then
- term.setTextColor(16384)
- mon.setTextColor(16384)
- write(message)
- mon.write(message)
- term.setTextColor(1)
- mon.setTextColor(1)
- term.scroll(1)
- mon.scroll(1)
- term.setCursorPos(3,15)
- mon.setCursorPos(3,12)
- else
- term.setTextColor(4)
- mon.setTextColor(4)
- write("#2 : "..message)
- mon.write("#2 : "..message)
- term.scroll(1)
- mon.scroll(1)
- term.setCursorPos(3,15)
- mon.setCursorPos(3,12)
- term.setTextColor(1)
- mon.setTextColor(1)
- end
- end
- if event == "key" and param1 == 18 then
- term.setTextColor(16384)
- mon.setTextColor(16384)
- term.setCursorPos(13,4)
- mon.setCursorPos(9,3)
- print("Do you really want to quit")
- mon.write("Do you really want to quit ?")
- term.setCursorPos(15,5)
- mon.setCursorPos(11,4)
- print("[ENTER] yes [SUPPR] no")
- mon.write("[ENTER] yes [SUPPR] no")
- local event, touche = os.pullEvent("key")
- if touche == 28 then
- rednet.broadcast(" ooO #2 has disconected Ooo ")
- term.setCursorPos(15,7)
- mon.setCursorPos(12,6)
- term.setTextColor(2)
- mon.setTextColor(2)
- write("Disconecting .")
- mon.write("Disconecting .")
- sleep(0.5)
- write(".")
- mon.write(".")
- sleep(0.25)
- write(".")
- mon.write(".")
- sleep(0.25)
- mon.clear()
- term.setTextColor(1)
- mon.setTextColor(2)
- os.reboot()
- elseif touche == 211 then
- shell.run("chat")
- end
- end
- end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement