From 12b85e40e221ac9a47a8634e63a36b6120c8a95d Mon Sep 17 00:00:00 2001 From: Ale32bit Date: Fri, 2 Sep 2016 12:58:39 +0200 Subject: [PATCH] Create chat.lua --- src/apps/chat.lua | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) create mode 100644 src/apps/chat.lua diff --git a/src/apps/chat.lua b/src/apps/chat.lua new file mode 100644 index 0000000..c02c31d --- /dev/null +++ b/src/apps/chat.lua @@ -0,0 +1,17 @@ +term.setBackgroundColor(sPhone.theme["backgroundColor"]) +term.clear() +term.setCursorPos(1,1) +term.setTextColor(sPhone.theme["text"]) +sPhone.header("RedNet Chat") +term.setBackgroundColor(sPhone.theme["backgroundColor"]) +term.setTextColor(sPhone.theme["text"]) +term.setCursorPos(2, 5) +if not peripheral.isPresent("back") or not peripheral.getType("back") == "modem" then + print("Modem not found") + print(" Press any key") + os.pullEvent("key") + return +end +write("Host: ") +local h = read() term.setCursorPos(2,6) +shell.run("/rom/programs/rednet/chat", "join", h, sPhone.user)