Advertisement
Faited

Jadebot

May 20th, 2023 (edited)
918
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Lua 0.88 KB | None | 0 0
  1. local chatBox = peripheral.find("chatBox")
  2. local pDetector = peripheral.find("playerDetector")
  3. -- chatBox.sendMessage("Welcome friends! <3", "Jadebot", "<>")
  4.  
  5.  
  6. while true do
  7.     local event, username, message, uuid, isHidden = os.pullEvent("chat")
  8.     print("The 'chat' event was fired with the username " .. username .. " and the message " .. message)
  9.     messageTranslate = string.upper(message)
  10.     if messageTranslate == "HI JADEBOT"
  11.     then
  12.         JadeResponse = "Hi " .. username .. "!~"
  13.         chatBox.sendMessage(JadeResponse, "Jadebot", "<>")
  14.     end
  15.     if messageTranslate == "JADEBOT WHERE AM I?"
  16.     then
  17.         playerData = pDetector.getPlayerPos(username)
  18.         JadeResponse = "I think you are in " .. playerData.dimension .. " at " .. "x: " .. playerData.x .. " y: " .. playerData.y .. " z: " .. playerData.z .. "!"
  19.         chatBox.sendMessage(JadeResponse, "Jadebot", "<>")
  20.     end
  21. end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement