Hello & Welcome to our community. Is this your first visit? Register
Follow us on
Follow us on Facebook Follow us on Twitter Watch us on YouTube


MMOCoin

Likes Likes:  0
Results 1 to 3 of 3
  1. #1
    Scout
    ^_^ Electrify's Avatar
    Join Date
    Jul 2011
    Posts
    20
    Post Thanks / Like
    Rep Power
    14
    Reputation
    19

    [Lua] Chat Working Commands


    Register to remove this ad
    Jusst copy/paste in a txt and save it as lua.For chat /4 MESSAGE

    Code:
    local CMD = { LIST = "#commands",
                  REZ = "#ress",
                  MALL = "#mall",
                  FOOD = "#food",
                  BUFFS = "#buffs",
                  HEAL = "#heal",
                  REPAIR = "#repair",
                  GMLIST = "#gms",
                  SAVE = "#save",
                  AURAS = "#remove" }
                  
    local RANKS = { }
    RANKS["az"] = "<ADMIN>"
    RANKS["a"] = "<GM>"
    RANKS["g"] = "<TGM>"
    RANKS[""] = "<PLAYER>"
    
    local owner = "OWNER" --The account name of the server owner.
    
    function CustomChatHandler(event, player, message, type, language)
        if (type == 17 and message:sub(1, 1) ~= "." and message:sub(1, 1) ~= "#") then
            local LogFile = io.open("logs/GlobalChat.txt", "a")
            local t = player:GetTeam()
            if (string.sub(message, 1, 8) ~= "GmTicket") then
                for _,v in pairs(GetPlayersInWorld()) do
                    if (player:GetGmRank() == "az") and (string.lower(player:GetAccountName()) == owner:lower()) then
                        v:SendBroadcastMessage(string.format("|cFFDC143C[WORLD]|r |cFF00FFFF<Owner> %s|r: |cFFFFA07A%s|r", player:GetName(), message))
                    elseif (player:GetGmRank() == "az") then
                        v:SendBroadcastMessage(string.format("|cFFDC143C[WORLD]|r |cFF00FFFF<Admin> %s|r: |cFFFFA07A%s|r", player:GetName(), message))
                    elseif (player:GetGmRank() == "a") then
                        v:SendBroadcastMessage(string.format("|cFFDC143C[WORLD]|r |cFF00FFFF<GM> %s|r: |cFFFFA07A%s|r", player:GetName(), message))
                    elseif (player:GetGmRank() == "g") then
                        v:SendBroadcastMessage(string.format("|cFFDC143C[WORLD]|r |cFF00FFFF<Ticket GM> %s|r: |cFFFFA07A%s|r", player:GetName(), message))
                    elseif (t == 0) then
                        v:SendBroadcastMessage(string.format("|cFFDC143C[WORLD]|r |cff2B65EC[Alliance]|r |cffffcc00[%s]:|r |cffffffff%s|r", player:GetName(), message))
                    else
                        v:SendBroadcastMessage(string.format("|cFFDC143C[WORLD]|r |cffC11B17[Horde]|r |cffffcc00[%s]:|r |cffffffff%s|r", player:GetName(), message))
                    end
                end
                LogFile:write(string.format("%s %s %s [Account - %s]:: %s\n", GetTimeStamp(), RANKS[player:GetGmRank()], player:GetName(), string.upper(player:GetAccountName()), message))
            end
            LogFile:close()
            return 0
        elseif (type == 17 and message:lower() == CMD.LIST or message:lower() == CMD.LIST) then
            player:SendBroadcastMessage("-------------------------------------------------")
            player:SendBroadcastMessage("Your player command list")
            player:SendBroadcastMessage("#commands <--- Displays your commands")
            player:SendBroadcastMessage("#mall <---- Ports you to the Mall")
            player:SendBroadcastMessage("#food  <--- Gathers food for you to eat!")
            player:SendBroadcastMessage("#buffs <--- Gives you buffs!")
            player:SendBroadcastMessage("#heal me <---- Heals You From Damage!")
            player:SendBroadcastMessage("#remove <---- Removes all auras from you.")
            player:SendBroadcastMessage("#repair <--- Spawns a handy repair bot!")
            player:SendBroadcastMessage("#ress <--- Revives you if your dead!")
            player:SendBroadcastMessage("#gms <--- Shows a list of all online GMs and their rank.")
            player:SendBroadcastMessage("#save <--- Saves your character to the database.")
            player:SendBroadcastMessage("-------------------------------------------------")
            return 0
        elseif (message:lower() == CMD.SAVE) then
            if (player:IsInCombat() == true) then
                player:SendAreaTriggerMessage("You cannot save in combat!")
            else
                player:SavePlayer()
                player:SendAreaTriggerMessage("Your character has been saved.")
            end
            return 0
        elseif (message:lower() == CMD.AURAS) then
            if (player:IsInCombat() == true) then
                player:SendAreaTriggerMessage("You cannot remove auras in combat!")
            else
                player:RemoveAllAuras()
                player:SendAreaTriggerMessage("All auras have been removed.")
            end
            return 0
        elseif (message:lower() == CMD.REZ) then
            if (player:IsAlive() ~= true) then
                player:ResurrectPlayer()
            else
                player:SendAreaTriggerMessage("You are not dead!")
            end
            return 0
        elseif (message:lower() == CMD.MALL) then
            player:Teleport(MAP, X, Y, Z)
            return 0
        elseif (message:lower() == CMD.FOOD) then
            if (player:IsInCombat() ~= false) then
                player:SendAreaTriggerMessage("You can not use this command in combat.")
            else
                player:AddItem(21215, 20)
            end
            return 0
        elseif (message:lower() == CMD.BUFFS) then
            if (player:IsInCombat() ~= false) then
                player:SendAreaTriggerMessage("You cannot buff while in combat.")
            else
                player:CastSpell(9884)
                player:CastSpell(9910)
                player:CastSpell(10938)
                player:CastSpell(48102)
                player:CastSpell(48100)
                player:CastSpell(48104)
                player:CastSpell(27126)
                player:CastSpell(25898)
                player:SendAreaTriggerMessage("You have been buffed.")
            end
            return 0
        elseif (message:lower() == CMD.HEAL) then
            if (player:IsInCombat() ~= false) then
                player:SendAreaTriggerMessage("You cannot heal while in combat.")
            else
                player:CastSpell(68013)
                player:SendAreaTriggerMessage("You've been healed.")
            end
            return 0
        elseif (message:lower() == CMD.REPAIR) then
            if (player:IsInCombat() ~= false) then
                player:SendAreaTriggerMessage("You cannot repair while in combat.")
            else
                player:RepairAllPlayerItems()
                player:SendAreaTriggerMessage("Your items have been repaired.")
            end
            return 0
        elseif (message:lower() == CMD.GMLIST) then
            local c = 0
            player:SendBroadcastMessage("------------------------------")
            for k,v in pairs(GetPlayersInWorld()) do
                if (v:GetGmRank() == "g") or (v:GetGmRank() == "a") or (v:GetGmRank() == "az") then
                    if(v:HasFlag(150, 2) == false and v:HasFlag(150, 4) == false and v:HasFlag(150, 8) == true) then
                        player:SendBroadcastMessage(string.format(" - %s%s is online", RANKS[v:GetGmRank()], v:GetName()))
                        c = c + 1
                    end
                end
            end
            player:SendBroadcastMessage("------------------------------")
            if (c == 0) then
                player:SendBroadcastMessage("There are currently no GMs online.")
            elseif (c == 1) then
                player:SendBroadcastMessage("There is currently 1 GM online.")
            else
                player:SendBroadcastMessage(string.format("There are currently %u GMs online.", c))
            end
            return 0
        end
    end
    
    function GetTimeStamp()
        local RAWTIME = os.time()
        local DATE = os.date("%x", RAWTIME)
        local TIME = nil
        local HOUR = tonumber(string.sub(tostring(os.date("%X", RAWTIME)), 1, 2))
        local MINUTE = tonumber(string.sub(tostring(os.date("%X", RAWTIME)), 4, 5))
        local SECOND = tonumber(string.sub(tostring(os.date("%X", RAWTIME)), 7, 8))
        if (HOUR == 13) then
            HOUR = 1
        elseif (HOUR == 14) then
            HOUR = 2
        elseif (HOUR == 15) then
            HOUR = 3
        elseif (HOUR == 16) then
            HOUR = 4
        elseif (HOUR == 17) then
            HOUR = 5
        elseif (HOUR == 18) then
            HOUR = 6
        elseif (HOUR == 19) then
            HOUR = 7
        elseif (HOUR == 20) then
            HOUR = 8
        elseif (HOUR == 21) then
            HOUR = 9
        elseif (HOUR == 22) then
            HOUR = 10
        elseif (HOUR == 23) then
            HOUR = 11
        elseif (HOUR == 00) then
            HOUR = 12
        end
        TIME = string.format("%u:%u:%u %s", HOUR, MINUTE, SECOND, tostring(os.date("%p", RAWTIME)))
        return string.format("[%s, %s]", TIME, DATE)
    end



    › See More: [Lua] Chat Working Commands

  2. #2
    Scout
    BeoDwarf's Avatar
    Join Date
    Jul 2011
    Posts
    16
    Post Thanks / Like
    Rep Power
    14
    Reputation
    14
    Nice Lua

  3. #3
    Beginner

    Join Date
    Jan 2009
    Posts
    1
    Post Thanks / Like
    Rep Power
    16
    Reputation
    1

    Register to remove this ad
    Is dont work .




  4. Related Threads - Scroll Down after related threads if you are only interested to view replies for above post/thread

 

 

Visitors found this page by searching for:

lua chat

wow lua chat

wow api getplayersinworld

lua rezz command

wow .lua chat comands

chat command arcemu lua

wow chat.lua

wow rezz lua

prot warrior hit cap and expertise 3.3.5

.lua chat

wow lua chat command

trinity os rez player

wow rezz befehl lua

chat in lua

chat window lua command

arcemu .lua server commands

wow lua hour x

trinity chat message lua

cataclysm blizzlike

lua :sendareatriggermessage

wow admin commands .lua

cff00ffff

wow send command to chat lua

special characters wo chat arcemu lua

lua chat commands

wow send cmd chat lua

WoW lua chat message

Ascent 3.5 lua chat window

wow lua read chat

wow lua sendareatriggermessage

SEO Blog

Tags for this Thread

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
All times are GMT -5. The time now is 04:12 PM.
Powered by vBulletin® Copyright ©2000-2024, Jelsoft Enterprises Ltd.
See More links by ForumSetup.net. Feedback Buttons provided by Advanced Post Thanks / Like (Lite) - vBulletin Mods & Addons Copyright © 2024 DragonByte Technologies Ltd.
vBulletin Licensed to: MMOPro.org