mc1030

chat_bot

Jan 22nd, 2022 (edited)
288
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. -- CHAT BOT 1.1
  2. -- by mcprog
  3.  
  4. local chatBox = peripheral.find("chatBox")
  5.  
  6. CHAT_PREFIX = "MC ChatBot 1.1"
  7.  
  8. function listen()
  9.     event, username, message = os.pullEvent("chat")
  10.  
  11.     if message == "o/" then
  12.         chatBox.sendMessageToPlayer("o/", username, CHAT_PREFIX)
  13.     elseif message == "o/ black" then
  14.         chatBox.sendMessageToPlayer("§0o/", username, CHAT_PREFIX)
  15.     elseif message == "o/ dark blue" then
  16.         chatBox.sendMessageToPlayer("§1o/", username, CHAT_PREFIX)
  17.     elseif message == "o/ dark green" then
  18.         chatBox.sendMessageToPlayer("§2o/", username, CHAT_PREFIX)
  19.     elseif message == "o/ dark aqua" or message == "o/ cyan" then
  20.         chatBox.sendMessageToPlayer("§3o/", username, CHAT_PREFIX)
  21.     elseif message == "o/ dark red" then
  22.         chatBox.sendMessageToPlayer("§4o/", username, CHAT_PREFIX)
  23.     elseif message == "o/ dark purple" or message == "o/ magenta" then
  24.         chatBox.sendMessageToPlayer("§5o/", username, CHAT_PREFIX)
  25.     elseif message == "o/ gold" then
  26.         chatBox.sendMessageToPlayer("§6o/", username, CHAT_PREFIX)
  27.     elseif message == "o/ gray" then
  28.         chatBox.sendMessageToPlayer("§7o/", username, CHAT_PREFIX)
  29.     elseif message == "o/ dark gray" then
  30.         chatBox.sendMessageToPlayer("§8o/", username, CHAT_PREFIX)
  31.     elseif message == "o/ blue" then
  32.         chatBox.sendMessageToPlayer("§9o/", username, CHAT_PREFIX)
  33.     elseif message == "o/ green" then
  34.         chatBox.sendMessageToPlayer("§ao/", username, CHAT_PREFIX)
  35.     elseif message == "o/ aqua" or message == "o/ light blue" then
  36.         chatBox.sendMessageToPlayer("§bo/", username, CHAT_PREFIX)
  37.     elseif message == "o/ red" then
  38.         chatBox.sendMessageToPlayer("§co/", username, CHAT_PREFIX)
  39.     elseif message == "o/ light purple" or message == "o/ pink" then
  40.         chatBox.sendMessageToPlayer("dfo/", username, CHAT_PREFIX)
  41.     elseif message == "o/ yellow" then
  42.         chatBox.sendMessageToPlayer("§eo/", username, CHAT_PREFIX)
  43.     end
  44. end
  45.  
  46. while true do
  47.     listen()
  48. end
RAW Paste Data Copied