[V9.0] [INTERNATIONAL] [RNN] LogChat menu

Shout-Out

User Tag List

Page 1 of 2 12 LastLast
Results 1 to 15 of 20
  1. #1
    RNN's Avatar Legendary
    Reputation
    846
    Join Date
    Sep 2018
    Posts
    1,109
    Thanks G/R
    107/808
    Trade Feedback
    0 (0%)
    Mentioned
    15 Post(s)
    Tagged
    0 Thread(s)

    [V9.0] [INTERNATIONAL] [RNN] LogChat

    Supported TurboHUD version: 9.0

    -Features:
    .Store in a file (logs\Chat.txt) all the messages received by the Chat. To deactivate it, change SaveChat to false.
    .Store in a file (logs\ChatWhisper.txt) all whispers. To disable it, change SaveWhisper to false.
    .Notify with a sound (sounds\Whisper.wav) if a whisper has been received.
    .Pressing the "/" key of BLoqNum or opening the chat dialog will show the last 20 whispers on the screen


    Download: LogChat.cs and Whisper.wav

    Installation: Place LogChat.cs in "plugins\RNN\LogChat.cs" , and Whisper.wav in "sounds\Whisper.wav"

    Knowns Issues: So far I have only tried it with version 19.03.26.1 of TH. In this version if we receive a repeated message is usually ignored, perhaps due to some flood protection or a bug, but also if we receive a message and then go to the menu or start game, the last message is repeated. If it is a bug of the TH will be corrected in future versions surely, and if it is a problem of my code I will review it these days. This plugin I did to test the new added function, I hope it's useful to someone.
    Update: I have decided to also discard the received messages identical to the previous one, to be coherent, but still there are inconsistencies when leaving or entering a game (to/from menu)

    Custom code (Plugins\User\PluginEnablerOrDisablerPlugin.cs , it's not mandatory) :

    Code:
    	using System.Windows.Forms;  // This line at the beginning of the file, if not exist
    
    	//The following lines place in ..   public void Customize() {  -HERE-  }
    
    	Hud.GetPlugin<RNN.LogChat>().Enabled = true;
    
    		Hud.RunOnPlugin<RNN.LogChat>(plugin => 
    		{		
    			plugin.xpos = 0.65f; // 0 ... 1
    			plugin.ypos = 0.45f; // 0 ... 1
     			plugin.SoundWhisper = true; // Notify if we receive a Whisper, it will be used .. sounds\Whisper.wav
    			plugin.SaveChat = true; // Save all chat messages, once formatted, to logs\Chat.txt
    			plugin.SaveWhisper = true; // Save whispers messages, once formatted, to logs\ChatWhisper.txt
    			plugin.HotKey = Keys.Divide; // Press and hold "/" of BLoqNum to show the last whispers
    			plugin.WhispMax = 20;	// maximum number of whispers that will be displayed on the screen
    			plugin.ShowWithHotKey = true; // Show Whispers when you keep press HotKey ("/" by default) , true -> enabled and false -> disabled
    			plugin.ShowWithEditLine = true; // Show Whispers when you open the Chat,  true -> enabled and false -> disabled
    
    		}  );
    if you liked the plugin, raise your thumb
    Last edited by RNN; 04-05-2019 at 10:38 AM. Reason: Edited text only

    [V9.0] [INTERNATIONAL] [RNN] LogChat
  2. Thanks iThinkiWin, (Sarge), afrojax, BeeAntOS, 731113, Kiseph, ljj16 (7 members gave Thanks to RNN for this useful post)
  3. #2
    jaeheung09's Avatar Active Member
    Reputation
    23
    Join Date
    Nov 2017
    Posts
    109
    Thanks G/R
    8/21
    Trade Feedback
    0 (0%)
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    It works with the latest TH version.
    I'm just curious why you create a chat/chatWhisper log files when you never use them but just read the dictionary you made in your plugin.

  4. #3
    JackCeparou's Avatar Savvy ? 🐒
    Reputation
    534
    Join Date
    Mar 2017
    Posts
    588
    Thanks G/R
    51/490
    Trade Feedback
    0 (0%)
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Originally Posted by jaeheung09 View Post
    It works with the latest TH version.
    I'm just curious why you create a chat/chatWhisper log files when you never use them but just read the dictionary you made in your plugin.
    Hud plugins can log to txt files but not read from them.
    So, it's.. well, for logging purpose I guess ;p
    Hide the Rum! --> Default theme customization 101 <--

  5. #4
    JarJarD3's Avatar Contributor
    Reputation
    106
    Join Date
    Oct 2017
    Posts
    395
    Thanks G/R
    41/101
    Trade Feedback
    0 (0%)
    Mentioned
    0 Post(s)
    Tagged
    1 Thread(s)
    Originally Posted by jaeheung09 View Post
    It works with the latest TH version.
    I'm just curious why you create a chat/chatWhisper log files when you never use them but just read the dictionary you made in your plugin.
    Log files can be very useful as it is the only way to communicate with outer world except reading pixel colors, AFAIK.

    For example you can collect statistics or other useful info in separate background "log listener" process and write results back to C# plugin files so when you restart THUD you have updated you state as well

  6. #5
    jaeheung09's Avatar Active Member
    Reputation
    23
    Join Date
    Nov 2017
    Posts
    109
    Thanks G/R
    8/21
    Trade Feedback
    0 (0%)
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Originally Posted by JarJarD3 View Post
    Log files can be very useful as it is the only way to communicate with outer world except reading pixel colors, AFAIK.

    For example you can collect statistics or other useful info in separate background "log listener" process and write results back to C# plugin files so when you restart THUD you have updated you state as well
    That's right. Log files can be the only way to to communicate with outer world together with reading pixel colors and key events.
    We can make good use of log files created in user plugins.
    Last edited by jaeheung09; 03-27-2019 at 04:00 PM.

  7. #6
    RNN's Avatar Legendary
    Reputation
    846
    Join Date
    Sep 2018
    Posts
    1,109
    Thanks G/R
    107/808
    Trade Feedback
    0 (0%)
    Mentioned
    15 Post(s)
    Tagged
    0 Thread(s)
    The whispers that are shown on the screen are saved in a dictionary, I only keep 20 records, I'm deleting the oldest one as I add a new one, although all could easily be retained by removing a line (until TH is closed)

    Well, the logs I did, in part, to be able to consult them later, sometimes you need to know who said what, or what exactly, and at what moment. The general chat is not saved anywhere, and whispers only if you have the open batllenet launcher, or so it was before. I also found it practical to add the exact day and time. Sometimes you give data that you do not want to lose, such as web addresses, and you do not have to write them down. The main reason to create them was to see what I could do: D, I was curious about the text format that was sent, and if I could extract it easily.
    Last edited by RNN; 03-27-2019 at 04:04 PM.

  8. #7
    RNN's Avatar Legendary
    Reputation
    846
    Join Date
    Sep 2018
    Posts
    1,109
    Thanks G/R
    107/808
    Trade Feedback
    0 (0%)
    Mentioned
    15 Post(s)
    Tagged
    0 Thread(s)
    Updated
    Comment only useful for plugin developers:
    I Change the regular expression to separate the parts of the message. The separator is the character "|" , and this can be followed by H or h. If it is H the text that follows will not be shown to the user, if it is h it will be displayed. You have to take the precaution of not taking as a separator the "|" that the users write, they will be received as "\ |" . Change SaveChatDebug = true for view text received
    Last edited by RNN; 03-29-2019 at 10:33 AM.

  9. #8
    iThinkiWin's Avatar Active Member
    Reputation
    28
    Join Date
    Oct 2018
    Posts
    104
    Thanks G/R
    25/25
    Trade Feedback
    0 (0%)
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Instead remove the hotkey, and make it appear like so; only while chat line is active (another possibility)

    Code:
    	private IUiElement chatentry
            {
                get { return Hud.Render.GetUiElement("Root.NormalLayer.chatentry_dialog_backgroundScreen.chatentry_content.chat_editline"); }
            }
    
            public void PaintWorld(WorldLayer layer)
    	{
    		if (!chatentry.Visible) return;
    		//if (!Hud.Input.IsKeyDown(HotKey)) return;

  10. Thanks RNN (1 members gave Thanks to iThinkiWin for this useful post)
  11. #9
    RNN's Avatar Legendary
    Reputation
    846
    Join Date
    Sep 2018
    Posts
    1,109
    Thanks G/R
    107/808
    Trade Feedback
    0 (0%)
    Mentioned
    15 Post(s)
    Tagged
    0 Thread(s)
    Oh Interesting, thank you, it's a good alternative, and even I could leave both options::

    Code:
    	public bool ShowWithHotKey { get; set; }
    	public bool ShowWithEditLine { get; set; }
    	private IUiElement chatentry
            {
                get { return Hud.Render.GetUiElement("Root.NormalLayer.chatentry_dialog_backgroundScreen.chatentry_content.chat_editline"); }
            }
    		
    	public override void Load(IController hud)
    	{
    		ShowWithHotKey = true; // Show Whispers when you keep press HotKey ("/" by default) , true -> enabled and false -> disabled
    		ShowWithEditLine = true; // Show Whispers when you open the Chat,  true -> enabled and false -> disabled
    		.....
    	}
    	public void PaintWorld(WorldLayer layer)
    	{
    		if ( (!ShowWithEditLine || !chatentry.Visible) && (!ShowWithHotKey || !Hud.Input.IsKeyDown(HotKey))) return;
    		.....
    	}
    I will include it when I update

  12. Thanks iThinkiWin (1 members gave Thanks to RNN for this useful post)
  13. #10
    RNN's Avatar Legendary
    Reputation
    846
    Join Date
    Sep 2018
    Posts
    1,109
    Thanks G/R
    107/808
    Trade Feedback
    0 (0%)
    Mentioned
    15 Post(s)
    Tagged
    0 Thread(s)
    updated, with the changes mentioned before.

  14. #11
    FoxPox's Avatar Member
    Reputation
    12
    Join Date
    Jun 2018
    Posts
    83
    Thanks G/R
    19/11
    Trade Feedback
    0 (0%)
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    no work 19.5.9.0

  15. Thanks RNN (1 members gave Thanks to FoxPox for this useful post)
  16. #12
    RNN's Avatar Legendary
    Reputation
    846
    Join Date
    Sep 2018
    Posts
    1,109
    Thanks G/R
    107/808
    Trade Feedback
    0 (0%)
    Mentioned
    15 Post(s)
    Tagged
    0 Thread(s)
    At first glance there seems to be a bug in the latest version of TH and the plugin can not collect any text that appears in the chat (there are no calls to OnChatLineChanged every time the chat text changes). I wrote to KJ to check if this is so. Currently this plugin does not give exceptions but it does not work, I will warn when I do.
    Last edited by RNN; 05-13-2019 at 09:30 AM.

  17. #13
    RNN's Avatar Legendary
    Reputation
    846
    Join Date
    Sep 2018
    Posts
    1,109
    Thanks G/R
    107/808
    Trade Feedback
    0 (0%)
    Mentioned
    15 Post(s)
    Tagged
    0 Thread(s)
    With the current version (19.5.15.2 BETA) the plugint works again

  18. #14
    s4000's Avatar Contributor
    Reputation
    286
    Join Date
    Oct 2018
    Posts
    490
    Thanks G/R
    18/273
    Trade Feedback
    0 (0%)
    Mentioned
    3 Post(s)
    Tagged
    0 Thread(s)
    can this plugin modify to log the encounter / kill elite , rare??

  19. #15
    RNN's Avatar Legendary
    Reputation
    846
    Join Date
    Sep 2018
    Posts
    1,109
    Thanks G/R
    107/808
    Trade Feedback
    0 (0%)
    Mentioned
    15 Post(s)
    Tagged
    0 Thread(s)
    I made this plugin for general use, I don't want to focus it on specific functions during the game (it would be a subject for another plugin).
    Some time ago I considered doing an elite counter using chat messages but there are two problems:
    1) You have to find the format / pattern that follows the text and it can be different for each language (regular expressions are useful for this), in addition there is no direct way to find out in TH the language in which the game is configured nor the TH itself.
    2) The biggest problem: To improve the readability and management of the text of the chat, TH eliminates the color codes, this makes it difficult to distinguish between elites yellow/blue and the rare .

Page 1 of 2 12 LastLast

Similar Threads

  1. [V7.7] [INTERNATIONAL] [RNN] BountiesTracking
    By RNN in forum TurboHUD Community Plugins
    Replies: 42
    Last Post: 05-24-2024, 08:04 PM
  2. [V8.0] [INTERNATIONAL] [RNN] PoolsBanditsList
    By RNN in forum TurboHUD Community Plugins
    Replies: 31
    Last Post: 07-05-2020, 03:13 PM
  3. [V8.0] [INTERNATIONAL] [RNN] DeathInMap
    By RNN in forum TurboHUD Community Plugins
    Replies: 2
    Last Post: 03-24-2020, 09:18 AM
  4. [V8.0] [INTERNATIONAL] [RNN] Ip4Meta
    By RNN in forum TurboHUD Community Plugins
    Replies: 13
    Last Post: 09-14-2019, 10:10 AM
  5. President Bush, CAUGHT SWEARING at international meeting
    By mantalcore in forum Community Chat
    Replies: 15
    Last Post: 08-14-2006, 09:41 AM
All times are GMT -5. The time now is 05:57 PM. Powered by vBulletin® Version 4.2.3
Copyright © 2024 vBulletin Solutions, Inc. All rights reserved. User Alert System provided by Advanced User Tagging (Pro) - vBulletin Mods & Addons Copyright © 2024 DragonByte Technologies Ltd.
Digital Point modules: Sphinx-based search