We have detected that cookies are not enabled on your browser. Please enable cookies to ensure the proper experience.
Results 1 to 11 of 11

Thread: Lua Chat objet

Hybrid View

  1. #1

    Lua Chat objet

    Because I am an utter spaz who can't wait the 1 - 2 days it'll take to get some documentation on the chat object, here's how it works:

    Code:
    function Turbine.Chat.Received(f, args)
    	for k, v in pairs(args) do
    		Turbine.Shell.WriteLine(k .. ": " .. tostring(v));
    	end
    end
    f will be the Turbine.Chat.Received function, and args will have the fields "Sender", "ChatType", and "Message". Looks like it'll need a handler manager so scripts aren't stomping on each other's chat handlers.

    Edit: Oh, and it looks like Turbine.Shell.WriteLines don't trigger the chat received event, so you can't send yourself into an infinite loop that way.
    Last edited by moebius92; Sep 26 2011 at 05:27 PM.

  2. #2

    Re: Lua Chat objet

    Thank you for posting this! I can now finish up some new plugins.
    [CENTER]Othrandir[/CENTER]
    [CENTER]Resistance - Brandywine[/CENTER]

  3. #3
    Join Date
    Aug 2007
    Posts
    62

    Re: Lua Chat objet

    Quote Originally Posted by moebius92 View Post
    Because I am an utter spaz who can't wait the 1 - 2 days it'll take to get some documentation on the chat object, here's how it works:

    Code:
    function Turbine.Chat.Received(f, args)
    	for k, v in pairs(args) do
    		Turbine.Shell.WriteLine(k .. ": " .. tostring(v));
    	end
    end
    f will be the Turbine.Chat.Received function, and args will have the fields "Sender", "ChatType", and "Message". Looks like it'll need a handler manager so scripts aren't stomping on each other's chat handlers.

    Edit: Oh, and it looks like Turbine.Shell.WriteLines don't trigger the chat received event, so you can't send yourself into an infinite loop that way.
    Very nice. Thanks for the research.
    Lycius [size=1][color="gray"][ELF HNT][/color][/size] / Dannav [size=1][color="gray"][MAN WDN][/color][/size] / Pius [size=1][color="gray"][HOB BUR][/color][/size]
    [i][color="gray"]Landroval[/color][/i]

  4. #4
    Join Date
    Mar 2007
    Posts
    1,780

    Re: Lua Chat objet

    Sweet, thanks. I'm probably going to get into this in a few days. Hopefully we do also get some documentation soon.
    [B]Elendilmir - [COLOR=#3333ff]Evenwyn[/COLOR][/B] Burglar[B] - [COLOR=#3333ff]Evendale[/COLOR][/B] Guardian
    [FONT=Verdana][COLOR=#ff0000][SIZE=2][B]Combat Analysis[/B] [/SIZE][/COLOR][SIZE=2]([B]v4.2.3b[/B]) - [/SIZE][/FONT]Download "[URL="http://www.lotrointerface.com/downloads/info502-CombatAnalysis.html"]here[/URL]"

  5. #5
    Join Date
    Aug 2007
    Posts
    62

    Re: Lua Chat objet

    I was able to put this to use in the Raid Rolls plugin: http://www.lotrointerface.com/downlo...nfo.php?id=607
    Lycius [size=1][color="gray"][ELF HNT][/color][/size] / Dannav [size=1][color="gray"][MAN WDN][/color][/size] / Pius [size=1][color="gray"][HOB BUR][/color][/size]
    [i][color="gray"]Landroval[/color][/i]

  6. #6
    Join Date
    Apr 2007
    Location
    Colorado Springs, Colorado
    Posts
    237

    Re: Lua Chat objet

    Quote Originally Posted by Lycius View Post
    I was able to put this to use in the Raid Rolls plugin: http://www.lotrointerface.com/downlo...nfo.php?id=607
    See the comment I posted on LotroInterface... It doesn't load for me.

  7. #7
    Join Date
    Mar 2007
    Posts
    108

    Re: Lua Chat objet

    Sender always seems to be the local player, are there any cases where it isn't? I would have thought Sender would be the name of the player sending the message in cases of chat.

 

 

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  

This form's session has expired. You need to reload the page.

Reload