LoTROInterface

LoTROInterface (https://www.lotrointerface.com/forums/index.php)
-   Lua Programming Help (L) (https://www.lotrointerface.com/forums/forumdisplay.php?f=50)
-   -   Get User's Current Chat Channel? (https://www.lotrointerface.com/forums/showthread.php?t=3701)

Henna95 06-22-2018 12:27 PM

Get User's Current Chat Channel?
 
Hi!

I was wondering if there is a way to get user's current chat channel.

On the API documentation I could only find:
Code:

Turbine.Chat.Received = function (sender, args)
        chatChannel = args.ChatType;
end

Which returns excatly what I want after user types something into the chat, but I would like to get chat type without needing to first type something into the chat.


Here is a rough idea how my code is running at the moment, I use lotro quickslot to create alias for sending messages to the chat. It works fine If i specify chatType to be for example: "/kinship", "/lff" or "/world", but if I leave it empty the alias defaults to "/say" even if I have some other channel open.
Code:

sendButton = Turbine.UI.Lotro.Quickslot();
sendButton : SetShortcut(Turbine.UI.Lotro.Shortcut( Turbine.UI.Lotro.ShortcutType.Alias, getMessage() ));

function getMessage()
        local chatType = getChatType();
        return chatType  .. " test message";
end


Example of desired behaviour:
User has kinship chat opened, and 'send message' button is clicked.
-> message gets printed into the kinship channel.

I would appreciate any feedback/tips on how to solve this. Or information if there is a better way to post messages to chat than using quickslots and alias.

glafria 06-22-2018 03:19 PM

Hi,
I think this is not possible.
There ist no "active" channel selected till you send a message.
So this event will be triggerd only with the sending args.



There are some great plugins which solved this problem.
Have a look for rainbowchat for example.You find this here.


I think possible could be to set the standard chat one time in your plugins preferences.


Greetz Glafria


All times are GMT -5. The time now is 05:39 PM.

vBulletin® - Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
© MMOUI