Communication Window

Jeremy SaundersJeremy Saunders Administrator Posts: 1,158 admin
We have updated the GMCP for communication so that it actually works. Here is my trigger for putting all communication into it's own window for CMUD. 

<trigger type="GMCP" priority="1540" newline="false" id="154">
  <pattern>Comm.Channel.Text</pattern>
  <value>#WIN Communication %gmcp.Comm.Channel.Text.text</value>
</trigger>
 
Info that is sent:

%gmcp.Comm.Channel.Text.channel - This is the title on the channel such as Antioch, Market, Newbie, Say, Tell, etc
%gmcp.Comm.Channel.Text.talker - Who is talking - Jeremy, Garryn, etc
%gmcp.Comm.Channel.Text.text - The whole unedited line.



AhkanIniarAzefelDiceneLionasMenoch

Comments

  • Jeremy SaundersJeremy Saunders Administrator Posts: 1,158 admin
    If someone could post their scripts for Mudlet and anything else, that would be great.

  • AzefelAzefel SingaporeMember Posts: 730 ✭✭✭✭
    Could you make it send so we can request it to return a list of people online in that channel?

    i.e. like a clwho/gwho/cwho but without titles.
    image
  • DiceneDicene Member Posts: 913 ✭✭✭✭
    edited September 2013
    http://www.ironrealms.com/gmcp-doc

    sendGMCP("Comm.Channel.Players")


    with a trigger on

    gmcp.Comm.Channel.Players

    serves a similar function. Gets you a list of all the players in the realm with a table including any channels they have in common with you. Parsing that list for only people with the channel you're looking for should be trivial(in Lua =P).


        name = "Azefel",
        channels = {
          "The Wardancers"
        }

    Also, anyone more familiar with GMCP on Mudlet know how to properly tell Imperian you support Comm.Channel.Text and enable its use in Mudlet? I can write the function to parse the data just fine, but I'm either not receiving a "Comm.Channel.Text", or it's blank.

    With debugging on and using "display(gmcp.Comm.Channel.Text)" when receiving "Comm.Channel.Text", I get the following:
    System Message:
    GMCP event <gmcp.Comm.Channel.Text> display(gmcp) to see the full content
    nil

    Here's the actual function:

    image
    image
    Azefel
  • LionasLionas Member, Historian Posts: 765 ✭✭✭✭✭
    edited September 2013
    gmod.enableModule("<character name>", "Comm.Channel") should work. I think.

    EDIT: Reading comprehension. You already do that. Nevermind!
    I am the righteous one... 
    the claims are stated - it's the world I've created 
  • AzefelAzefel SingaporeMember Posts: 730 ✭✭✭✭
    needs tells
    image
  • LionasLionas Member, Historian Posts: 765 ✭✭✭✭✭
    Tells are included in the communication channel, I'm capturing them fine. Also says, including mob says.
    I am the righteous one... 
    the claims are stated - it's the world I've created 
    Azefel
  • AzefelAzefel SingaporeMember Posts: 730 ✭✭✭✭
    edited September 2013
    I'm getting everything BUT tells :(

    edit : after reconnecting several times it decided to show up now. 
    image
  • IniarIniar AustraliaMember Posts: 3,213 ✭✭✭✭✭
    Azefel said:
    I'm getting everything BUT tells :(

    edit : after reconnecting several times it decided to show up now. 

    obviously, at some stage, Azefel did 'snub world'
    wit beyond measure is a Sidhe's greatest treasure
    TaqjaMereliiMenoch
  • AzefelAzefel SingaporeMember Posts: 730 ✭✭✭✭
    no, the list of people to gag only has like, Shaylei Brishi Tavion :(
    image
    IniarMenoch
  • IniarIniar AustraliaMember Posts: 3,213 ✭✭✭✭✭
    Dicene said:
    http://www.ironrealms.com/gmcp-doc

    sendGMCP("Comm.Channel.Players")


    with a trigger on

    gmcp.Comm.Channel.Players

    serves a similar function. Gets you a list of all the players in the realm with a table including any channels they have in common with you. Parsing that list for only people with the channel you're looking for should be trivial(in Lua =P).


        name = "Azefel",
        channels = {
          "The Wardancers"
        }

    Also, anyone more familiar with GMCP on Mudlet know how to properly tell Imperian you support Comm.Channel.Text and enable its use in Mudlet? I can write the function to parse the data just fine, but I'm either not receiving a "Comm.Channel.Text", or it's blank.

    With debugging on and using "display(gmcp.Comm.Channel.Text)" when receiving "Comm.Channel.Text", I get the following:
    System Message:
    GMCP event <gmcp.Comm.Channel.Text> display(gmcp) to see the full content
    nil

    Here's the actual function:

    image
    Works for me, Dicene. I just registered user under my char name, and didn't use sendGMCP, the only two things I did differently. You got it working yet?
    wit beyond measure is a Sidhe's greatest treasure
  • DiceneDicene Member Posts: 913 ✭✭✭✭
    <321/303h 220/231m 0b <eb db>> 27.72 [None]'blah
    System Message:
    GMCP event <gmcp.Comm> display(gmcp) to see the full content
    System Message:
    GMCP event <gmcp.Comm.Channel> display(gmcp) to see the full content
    nil
    System Message:
    GMCP event <gmcp.Comm.Channel.Text> display(gmcp) to see the full content
    nil
    System Message:
    GMCP event <gmcp.Comm> display(gmcp) to see the full content
    System Message:
    GMCP event <gmcp.Comm.Channel> display(gmcp) to see the full content
    nil
    System Message:
    GMCP event <gmcp.Comm.Channel.Start> display(gmcp) to see the full content
    System Message:
    GMCP event <gmcp.Comm> display(gmcp) to see the full content
    System Message:
    GMCP event <gmcp.Comm.Channel> display(gmcp) to see the full content
    nil
    System Message:
    GMCP event <gmcp.Comm.Channel.End> display(gmcp) to see the full content
    System Message:
    GMCP event <gmcp.Char> display(gmcp) to see the full content
    System Message:
    GMCP event <gmcp.Char.Vitals> display(gmcp) to see the full content
    You say, "Blah."
    <321/303h 220/231m 0b <eb db>> 27.72 [None]

    =(
    image
  • ZakharZakhar Member Posts: 3
    Looks like I have the same problem as Dicene. Not getting the gmcp.Comm.Channel.Text table (doesn't exist) but the event is triggered so somehow it's just not parsed in. I get the following tables though: gmcp.Comm.Channel.Start, gmcp.Comm.Channel.End, gmcp.Comm.Channel.List. So from the looks of it I get all the old ones but not the new one. 

    This is the code I used to get things this far: 

    gmod.registerUser("Zakhar")

    gmod.enableModule("Zakhar", "Comm.Channel")

    gmod.enableModule("Zakhar", "Comm.Channel.Text")

    sendGMCP('Core.Supports.Add ["Comm.Channel 1"]')

    sendGMCP('Core.Supports.Add ["Comm.Channel Text 1"]')

    send("\n")

    function ChannelTest()

    display(gmcp.Comm)

    end


    Those who got it working on Mudlet, are you on some specific version perhaps?
  • IniarIniar AustraliaMember Posts: 3,213 ✭✭✭✭✭
    edited September 2013
    So...

    It stopped working. Then I got it to work again. Not sure if it's 100% but essentially, my inclusive code read:

    gmod.registerUser("Iniar")
    gmod.enableModule("Iniar", "Comm.Channel")
    gmod.enableModule("Iniar", "Comm.Channel.Text")
    sendGMCP("Comm.Channel.Players")
    sendGMCP('Core.Supports.Add ["Comm.Channel.Text 1"]')
    gmod.reenableModules()
    gmod.printModules()

    function do_stuff()
    yadayada
    end

    but right now I've distilled it to:

    trigger: Password correct. Welcome to Imperian
    script: tempTimer(1.5, function() gmod.enableModule("Iniar", "Comm.Channel.Text") end )

    And an event raiser tied to gmcp.Comm.Channel.Text

    Seems to be working ok. Intra-session, you'll need to do gmod.reenableModules(), is my guess.

    E: Only (Channels) go through gmcp.Comm.Channel.Text :s Says and Tells don't seem to. :s

    wit beyond measure is a Sidhe's greatest treasure
  • DiceneDicene Member Posts: 913 ✭✭✭✭

    Iniar said:
    E: Only (Channels) go through gmcp.Comm.Channel.Text :s Says and Tells don't seem to. :s

    Hmm. Part of my problem might be that I've been using says since I don't feel like bothering a million people testing on channels. =/
    image
  • ZakharZakhar Member Posts: 3
    I've only used says too by the way, my own and mobs. I still think it's weird that the event (gmcp.Comm.Channel.Text) is triggered on says but the gmcp table isn't filled though. So something must be right.. 
  • IniarIniar AustraliaMember Posts: 3,213 ✭✭✭✭✭
    Not working now. /unsure
    wit beyond measure is a Sidhe's greatest treasure
  • DiceneDicene Member Posts: 913 ✭✭✭✭
    Yeah. Same problem still. Tried channel as well, nothing. Yatco and Regex's work fine either way. *shrug*
    image
    Iniar
  • LionasLionas Member, Historian Posts: 765 ✭✭✭✭✭
    Replying to this a week late: Says and tells populate the table fine on CMud. The issue is with mudlet.
    I am the righteous one... 
    the claims are stated - it's the world I've created 
  • FeuFeu England!Member Posts: 8
    Just noticed this thread and here's my 2c.

    First of all, you don't need to register a user, merely sending the Comm request is sufficient. Personally, I am being lazy and triggering on 'Password correct. Welcome....'

    Now, as for actually capturing the data. There's a couple of ways, but the easiest to digest is to just hook onto gmcp.Comm.Channel.Start - For this, I have the following code:

    p, li { white-space: pre-wrap; } Start event

    As you see, this enables a trigger for us. The patterns I use to capture the channels are as follows. (Excuse my laziness in editing these properly for Imperian, but they do work fine):

    ^[A-Za-z\s\'\,\`\-\.]+ (?:says?|asks?|exclaims?|roars?|whispers?)(?: you| to you| to .+?| .+?)?\, \".+?\"$
    ^(\[Covenant\] )?([\(\<]+[A-Za-z'\- ]+[\)\>]+\: )?\w+ (?:\([A-Za-z'\-, ]+\) )?says?,( in \w+,)? \".+\"$

    Select your text and copy it over with appendBuffer() then just have the trigger disable itself.

    *** WARNING ***  --  I am not sure what the cause is, but DO NOT try and echo the contents of gmcp.Comm.Channel.Text.text. Bad things happen.

    Finally, for the channel types, I just store them in a table like so: Clicky.

    While not working as-is, I am sure that will help a bit.


    HTML Logging site: http://www.logsty.net
    Systems & Coding Support: support@pharanyx.com
    Saracen Combat & Utility system: (All IRE games): saracen@pharanyx.com
  • LeikaraLeikara Member Posts: 66 ✭✭✭
    This is a really old necro, but I can't for the life of me seem to get this to work in cmud. Imperian just isn't sending me anything in Comm.Channel - is there a protocol I need to allow or some trick to this?
  • EoghanEoghan Member, Immortal Posts: 723 mod
    edited May 2014
    Leikara said:
    This is a really old necro, but I can't for the life of me seem to get this to work in cmud. Imperian just isn't sending me anything in Comm.Channel - is there a protocol I need to allow or some trick to this?
    Open Preferences (click Prefs in the top menu). Select Protocols on the left (it should be the last option). Add the following lines to tell cmud to negotiate these options on connection:
    Comm.Channel 1
    Comm.Channel.Text 1

    You will need to reconnect for these changes to take effect.
    Like what we're doing? Why not take a second to vote? Vote for Imperian at http://www.imperian.com/vote
  • LeikaraLeikara Member Posts: 66 ✭✭✭
    Yeah I tried a range of permutations of protocols before posting. No dice.

    I currently have it just triggering on any gmcp input to see what is being sent back (and yes, I've been throwing random things in because I'm getting :( ):

    $channel=%gmcp.Comm.Channel.Text.Channel
    $text=%gmcp.Comm.Channel.Text.Text
    $test=%gmcp.Comm.Channel.Text
    $test1=%gmcp.Comm.Channel.Text.Talker
    $test2=%gmcp.Comm.Channel.1
    #say $channel: $text : $test : $test1 : $test2

    And all of these are returning as blank, except for .1. That sends me back null.
    Azefel
  • AzefelAzefel SingaporeMember Posts: 730 ✭✭✭✭
    I'll send you my stuff when I'm done making cakes today
    image
  • AzefelAzefel SingaporeMember Posts: 730 ✭✭✭✭
    this is what I use

    $comms=%json(%0)
    $n=Unknown
    $t=""
    #if %regex($comms.channel,^tell) {
      #if %subregex($comms.channel,^tell\s) {$n=%subregex($comms.channel,^tell\s)}
      #if !%ismember($n,@annoying_people) {
      #win tells %ansi(0)%time(hh:nn) %if($comms.talker=%gmcp.char.status.name,"To ","From ")$n:
      $t=%leftback(%copy($comms.text,%pos(",~"",$comms.text)+1),8)
      #win tells "      "%ansi(@channel_colours.tells)$t
      #if @channel_subs {
      tells_sub={%if($comms.talker=%gmcp.char.status.name,"To ","From ")$n:}
      }
      #write 3 {[%time(dd~ mmm~ -~ hh:mm:ss)] %if($comms.talker=%gmcp.char.status.name,"To ","From ")$n: $t}
      } {tells_sub=gag}
    }

    and works fine. You can just do #showt %gmcp.comm to get a slightly better formatted output.
    image
Sign In or Register to comment.