PDA

View Full Version : Get User's Current Chat Channel?


Henna95
06-22-2018, 12:27 PM
Hi!

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

On the API documentation I could only find:
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.
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 (http://www.lotrointerface.com/downloads/info558).


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


Greetz Glafria