User Tag List

Page 1 of 4 1 2 3 4 LastLast
Results 1 to 7 of 25

Thread: [Eluna] Simple World Chat System

  1. #1
    Mad Scientist <span style='color: #008000'><span class='glow_006400'>slp13at420</span></span>'s Avatar



    Join Date
    Dec 2013
    Location
    Idaho
    Posts
    2,492
    XP
    20,134,806
    Level
    500
    Thanks
    1,089
    Thanked 330 Times in 212 Posts

    [Eluna] Simple World Chat System

    World Chat

    <MOD><Release>

    a simple World Chat system with adjustable colors and channel name.

    this is a mutation of @Foereaper 's chat script.

    I modified this so you wont need to type '#chat' every time you type a message.
    to use this just change to `/say` channel then type '#chat on' to turn your access on then type away :D.
    Once your done just type '#chat off' to turn your access off.
    Name colors are team based. Ally blue, Horde red.

    Contains a duration timer to help manage rapid spamming.
    this should ignore add-on messages. - unteseted -
    now supports the `.reload Eluna` command.

    Code:
    
    -- by slp13at420 of EmuDevs.com
    -- a mutation of FoeReaper's world chat with basic bells an whistles.
    -- simple world chat WITHOUT the '#chat' command...WTF you say?
    -- just change to /say channel 
    -- turn it on
    -- and chat away.
    -- names are clickable for whispers and sub menu.
    
    local WorldChat = {};
    local channel_name = "World Chat";
    local on = "#chat on";
    local off = "#chat off";
    local duration = 5; -- in seconds.
    
    local Colors =  { -- colors for names and misc
    	[0] = "|cff3399FF", -- blue for alliance name
    	[1] = "|cffFF0000", -- red for horde name
    	[3] = "|cff000000", -- black for [channel name]
    	[4] = "|cff00cc00", -- green for "message"
    	[5] = "|cff3399ff", -- good responce
    	[6] = "|cffFF0000", -- bad responce
    		};
    	
    local function ChatSystem(event, player, msg, type, lang, channel)
    
    local acct_id = player:GetAccountId();
    
    	if not(WorldChat[acct_id])then
    	
    		WorldChat[acct_id] = {
    						chat = 0,
    						time = GetGameTime()-duration,
    		};
    	end
    	
    	if(lang ~= -1)then
    	
    		if(msg ~= "")then
    			
    			if(msg ~= "Away")then
    				
    					if(msg == off)then
    						WorldChat[acct_id].chat = 0;
    						player:SendBroadcastMessage(Colors[5].."World chat off.|r")
    					return false;
    					end
    				
    					if(msg == on)then
    						WorldChat[acct_id].chat = 1;
    				    	player:SendBroadcastMessage(Colors[5].."World chat on.|r")
    				    return false;
    					end
    					
    					if(WorldChat[acct_id].chat == 1)then -- 0 = world chat off :: 1 = world chat on
    	
    						local time = GetGameTime();
    
    						if(time-WorldChat[acct_id].time >= duration)then
    						
    								local t = table.concat{"[", Colors[3], channel_name, "|r]", "[", Colors[player:GetTeam()],"|Hplayer:", player:GetName(),  "|h", player:GetName(), "|h", "|r]:", Colors[4], msg, "|r"};
    								SendWorldMessage(t);
    								WorldChat[acct_id].time = time;
    						else
    					    		player:SendBroadcastMessage(Colors[6].."World chat spam timer detected.|r")
    						end				
    
    					return false;
    					end
    			end
    		end
    	end
    end
    	
    RegisterPlayerEvent(18, ChatSystem)
    
    print("Grumbo'z World Chat loaded.")
    
    Alliance:

    Horde:
    Last edited by slp13at420; 11-29-2016 at 02:58 PM.
    Achievements:
    Shopper Got a Sticky! Member 1 year registered Level XL Level D
    Awards:
    Pot Head LOL Raffle Winner Top Tagger Donator Hangman Scripter Repacker Drunk Support Member of Staff Da Bomb!
    "Cuz PvP's better with a bag 'o' weed"
    !! King Spade !!

    -Guild Plot System-
    Grumbo'z Guild Warz


    -VIP System-
    Grumbo'z VIP System

  2. The Following 4 Users Say Thank You to slp13at420 For This Useful Post:


  3. #2
    EOOQ <span style='color: #32CD32'><span class='glow_32CD32'>renatokeys</span></span>'s Avatar
    Join Date
    Jan 2014
    Location
    Brazil
    Posts
    191
    XP
    2,644,776
    Level
    311
    Thanks
    17
    Thanked 26 Times in 18 Posts
    aaaa.jpg
    look, carbonite addon spamm the world chat , how fix it ?
    Achievements:
    Shopper Member 1 year registered Referrer Level XL Level C
    Only two things are infinite: the universe and WINRAR test license

  4. #3
    Original Poster
    Mad Scientist <span style='color: #008000'><span class='glow_006400'>slp13at420</span></span>'s Avatar



    Join Date
    Dec 2013
    Location
    Idaho
    Posts
    2,492
    XP
    20,134,806
    Level
    500
    Thanks
    1,089
    Thanked 330 Times in 212 Posts
    hmm I need to add a check for duration of time passed...
    maybe adjustable .. duration 5000ms or 5 seconds ? good ?
    Achievements:
    Shopper Got a Sticky! Member 1 year registered Level XL Level D
    Awards:
    Pot Head LOL Raffle Winner Top Tagger Donator Hangman Scripter Repacker Drunk Support Member of Staff Da Bomb!
    "Cuz PvP's better with a bag 'o' weed"
    !! King Spade !!

    -Guild Plot System-
    Grumbo'z Guild Warz


    -VIP System-
    Grumbo'z VIP System

  5. #4
    EOOQ <span style='color: #32CD32'><span class='glow_32CD32'>renatokeys</span></span>'s Avatar
    Join Date
    Jan 2014
    Location
    Brazil
    Posts
    191
    XP
    2,644,776
    Level
    311
    Thanks
    17
    Thanked 26 Times in 18 Posts
    but is a addon message, cant block the addon to send messages ?
    Achievements:
    Shopper Member 1 year registered Referrer Level XL Level C
    Only two things are infinite: the universe and WINRAR test license

  6. #5
    Original Poster
    Mad Scientist <span style='color: #008000'><span class='glow_006400'>slp13at420</span></span>'s Avatar



    Join Date
    Dec 2013
    Location
    Idaho
    Posts
    2,492
    XP
    20,134,806
    Level
    500
    Thanks
    1,089
    Thanked 330 Times in 212 Posts
    the messages look repetitive .. does the addon just keep chatting the same message??
    Achievements:
    Shopper Got a Sticky! Member 1 year registered Level XL Level D
    Awards:
    Pot Head LOL Raffle Winner Top Tagger Donator Hangman Scripter Repacker Drunk Support Member of Staff Da Bomb!
    "Cuz PvP's better with a bag 'o' weed"
    !! King Spade !!

    -Guild Plot System-
    Grumbo'z Guild Warz


    -VIP System-
    Grumbo'z VIP System

  7. #6
    EOOQ <span style='color: #32CD32'><span class='glow_32CD32'>renatokeys</span></span>'s Avatar
    Join Date
    Jan 2014
    Location
    Brazil
    Posts
    191
    XP
    2,644,776
    Level
    311
    Thanks
    17
    Thanked 26 Times in 18 Posts
    yes , they are using same addon , CARBONITE
    Achievements:
    Shopper Member 1 year registered Referrer Level XL Level C
    Only two things are infinite: the universe and WINRAR test license

  8. #7
    Founder <span style='color: #FF4500'>Tommy</span>'s Avatar
    Join Date
    Apr 2013
    Posts
    7,391
    XP
    3,449,104
    Level
    378
    Thanks
    889
    Thanked 1,856 Times in 1,119 Posts
    Quote Originally Posted by renatokeys View Post
    but is a addon message, cant block the addon to send messages ?
    You can still do what slp said even when it is an addon message. Though, I'm not sure how it will handle regardless.

    You can see if the language type is of addon by doing:

    Code:
    if (lang == -1) then
        -- Addon message
    end
    But you have to take into account some of the addons people use that don't specifically spam everyone but themselves. e.g. raid addons, etc.

    I think a lot of people try to prevent actions like these and tend to overthink the code process. Not sure if you can prevent players from spamming addon messages or not, but there are ways to catch players doing this so you can kick or ban them. Could try implementing a mute system. Disabling addons? Not completely sure if you can do that, maybe, who knows. I guess this is the downside of a world chat nowadays?

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

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
  •