Macromod - Chat channel display

Discussion in 'Basic Tutorials' started by rockboy2000, Jun 7, 2013.

  1. rockboy2000

    rockboy2000 Builder
    Builder ⛰️ Ex-Tycoon ⚜️⚜️⚜️ Premium Upgrade

    Joined:
    Oct 19, 2012
    Messages:
    1,344
    Trophy Points:
    25,660
    Gender:
    Male
    EcoDollars:
    $132,000
    Ratings:
    +298
    I have made a macro mod that displays the chat channel you are in. I always forget what chat I am in and use this to stop me from typing in the wrong chat.

    [​IMG]

    Thanks to jakeyray18 for allowing me to use some of his screenshots from his tutorial.

    First you must access the macro mod menu. To find the key press the Esc key. Then go to "Options", click on "Controls" and then use the arrows keys to find your "Macro activate" key. Default is grave which is the "~" key.

    [​IMG]

    Now you want to open the Macro Mod menu. Do this by pressing the shift key and your "macro activate" key simultaneously. Then click the GUI editor button located in the bottom right corner, circled in the screenshot below.

    [​IMG]

    Now you must double click on the tab called "ingame" listed under the available screens as shown in the screenshot below.

    [​IMG]

    Now we want to create a label in the "ingame" screen so first click on the "Button Panel Commands" icon. Then click on the "Add Label" button.

    [​IMG]

    Now you must choose where you would like to place the label, I have it at the top middle of my screen but it is up to you. It can be changed later on so it does not really matter. Once you have placed the label a box should appear. In the "Label text" box type "Chat Channel: %%" without the quotation marks. In the box below labelled "binding" type "@&channel" again without the quotes. Then click "OK". Simply put the word "channels" in the the Control Name box and the macro will do the rest.

    Picture coming soon.

    Now we must add the script that will show which channel you are in. To do this go back to the screen with the keyboard on it. At the top it should have a box saying "Macro bindings: Keys", click the right arrow once, it should then say "Macro bindings: Events". Then click the "Text editor" button in the lower right corner as shown in the picture.

    [​IMG]

    Now you want to create a new file. Type the word "ChatChannel" without quotes in the box under "Create a new file:". Then click "Create".

    [​IMG]

    A screen like this should appear:

    [​IMG]

    In the editor copy and paste this code:

    Code:
    $${
    STRIP(&chat,%CHAT%)
    IFMATCHES(%&chat%,Now chatting (in|with) (.*)\.)
        MATCH(%&chat%,Now chatting (in|with) (.*)\.,{&chpm,&chname})
        IFMATCHES(%&chpm%,with)
            IF(party)
                SET(&mem,"&eChatting with &d%&chname%)
                STOP
            ENDIF
            SETLABEL(channels,&eChatting with &d%&chname%)
        ELSE
            IFMATCHES(%&chpm%,in)
                IF(party)
                    SET(&mem,"&eChatting in %&color%%&chname%)
                    STOP
                ENDIF
                IF(%&chname% = "Global")
                    &color = &f
                ELSEIF(%&chname% = "Auction")
                    &color = &b
                ELSEIF(%&chname% = "Trade")
                    &color = &7
                ELSEIF(%&chname% = "Nether")
                    &color = &d
                ELSEIF(%&chname% = "Mining")
                    &color = &e
                ELSEIF(%&chname% = "Aether")
                    &color = &e
                ELSEIF(%&chname% = "Local")
                    &color = &e
                ELSEIF(%&chname% = "VIP")
                    &color = &a
                ELSEIF(%&chname% = "Pvp")
                    &color = &5
                ELSEIF(%&chname% = "hg")
                    &color = &e
                ENDIF
            SETLABEL(channels,&eChatting in %&color%%&chname%)
            ENDIF
        ENDIF
    ENDIF
    IFMATCHES(%&chat%,Party Chat only On)
        SET(&mem,"&eChatting %&chpm% %&color%%&chname%)
        SET(party)
        SETLABEL(channels,&eChatting in &aParty Chat)
    ENDIF
    IFMATCHES(%&chat%,Party Chat only Off)
        UNSET(party)
        SETLABEL(channels,%&mem%)
    ENDIF
    }$$
    
    After clicking the save button you need to go back to the "Macro bindings: Events" page and click on "onChat" In the box at the bottom type "$$<ChatChannel.txt>" without the quotes. If you already have something in the box separate it with "|". For example:
    $$<random.txt>|$$<ChatChannel.txt>

    Save it then re-log. Then join a channel such as trade or donator. The label should change to saying your chat channel.

    I must add each channel individually. The current list of channels are:
    Global
    Trade
    Auction
    Local
    Donator
    Aether
    Nether
    Mining
    PVP

    I will keep the list updated. If you would like any channel added post below. I suggest updating the code regularly as I will be updating it with the new channels.
     
    #1 rockboy2000, Jun 7, 2013
    Last edited: Mar 21, 2014
  2. Da_Tirtow

    Da_Tirtow Builder
    Builder ⛰️ Prestige ⭐ I ⭐ Ex-EcoLegend ⚜️⚜️⚜️⚜️

    Joined:
    Jan 15, 2012
    Messages:
    723
    Trophy Points:
    26,690
    Gender:
    Male
    Ratings:
    +112
    Nice macro rockboy :)
    I messed around with the code on mine some so that the channel name is in the color of the channel. I found it was easier to quickly glance at.
    For example:
    Code:
    IFMATCHES(%&chat%,Now chatting in Global\.)
      SET(@&channel,&fGlobal)
    ENDIF
    IFMATCHES(%&chat%,Now chatting in Trade\.)
      SET(@&channel,&7Trade)
    ENDIF
    
    And so on for each color.
     
  3. Falconaire

    Falconaire Builder
    Builder ⛰️ Ex-Tycoon ⚜️⚜️⚜️

    Joined:
    May 19, 2013
    Messages:
    2,077
    Trophy Points:
    19,990
    Gender:
    Male
    Ratings:
    +1,417
    Omg, love you for making this! Kiss kiss
     
    #3 Falconaire, Jun 7, 2013
    Last edited: Mar 9, 2014
  4. rockboy2000

    rockboy2000 Builder
    Builder ⛰️ Ex-Tycoon ⚜️⚜️⚜️ Premium Upgrade

    Joined:
    Oct 19, 2012
    Messages:
    1,344
    Trophy Points:
    25,660
    Gender:
    Male
    EcoDollars:
    $132,000
    Ratings:
    +298
    May implement that when I have some time, thanks for the idea.
     
  5. rockboy2000

    rockboy2000 Builder
    Builder ⛰️ Ex-Tycoon ⚜️⚜️⚜️ Premium Upgrade

    Joined:
    Oct 19, 2012
    Messages:
    1,344
    Trophy Points:
    25,660
    Gender:
    Male
    EcoDollars:
    $132,000
    Ratings:
    +298
    Added colours that match to chat colour:
    Code:
    $${
    STRIP(&chat,%CHAT%)
    IFMATCHES(%&chat%,Now chatting in Global\.)
      SET(@&channel,&fGlobal)
    ENDIF
    IFMATCHES(%&chat%,Now chatting in Trade\.)
      SET(@&channel,&7Trade)
    ENDIF
    IFMATCHES(%&chat%,Now chatting in Auction\.)
      SET(@&channel,&3Auction)
    ENDIF
    IFMATCHES(%&chat%,Now chatting in Local\.)
      SET(@&channel,&eLocal)
    ENDIF
    IFMATCHES(%&chat%,Now chatting in Donator\.)
      SET(@&channel,&aDonator)
    ENDIF
    IFMATCHES(%&chat%,Now chatting in Pvp\.)
      SET(@&channel,&5PVP)
    ENDIF
    IFMATCHES(%&chat%,Now chatting in Aether\.)
      SET(@&channel,&eAether)
    ENDIF
    IFMATCHES(%&chat%,Now chatting in Nether\.)
      SET(@&channel,&dNether)
    ENDIF
    IFMATCHES(%&chat%,Now chatting in Mining\.)
      SET(@&channel,&eMining)
    ENDIF
    }$$
     
  6. rockboy2000

    rockboy2000 Builder
    Builder ⛰️ Ex-Tycoon ⚜️⚜️⚜️ Premium Upgrade

    Joined:
    Oct 19, 2012
    Messages:
    1,344
    Trophy Points:
    25,660
    Gender:
    Male
    EcoDollars:
    $132,000
    Ratings:
    +298
    I welcome all feedback and any suggestions such as channels to add. I accept even private channels, you must simply provide me with a screenshot of the chat colour and name of the channel.
     
    #6 rockboy2000, Jun 11, 2013
    Last edited: Jun 11, 2013
  7. sick24

    sick24 Tycoon by day, best doctor by night
    Mayor ⛰️⛰️ Prestige ⭐ I ⭐ Ex-Tycoon ⚜️⚜️⚜️ Premium Upgrade

    Joined:
    Dec 9, 2012
    Messages:
    4,143
    Trophy Points:
    40,170
    Gender:
    Male
    Ratings:
    +564
    Well,

    I am trying to get it to successfully log chatting with players. Here is the script I have tried:
    Code:
    IFMATCHES(%&chat%,Now chatting with %PLAYER%\.)
      SET(@&channel,&5%PLAYER%)
    ENDIF
    
    I am very confused as to why this doesn't work. Maybe I am not using the %PLAYER% correctly but I am sure jakeyray18 could help me with this dilemma.
     
    #7 sick24, Jun 13, 2013
    Last edited: Jun 13, 2013
  8. rockboy2000

    rockboy2000 Builder
    Builder ⛰️ Ex-Tycoon ⚜️⚜️⚜️ Premium Upgrade

    Joined:
    Oct 19, 2012
    Messages:
    1,344
    Trophy Points:
    25,660
    Gender:
    Male
    EcoDollars:
    $132,000
    Ratings:
    +298
    Well you need to use MATCH to assign the player name to the variable. Try this:
    Code:
    IFMATCHES(%&chat%,Now chatting with [A-Za-z0-9_]+\.)
      MATCH((%&chat%,Now chatting with [A-Za-z0-9_]+\.),&player,[A-Za-z0-9_]+)
      SET(@&channel,&5%&player%)
    ENDIF
    
    This should work I think, try it out, check the regex and syntax. I am not able to test it myself atm.
    If it doesn't work try isolating the problem by putting an echo to see if it matches, make it echo the variable &player between the match and set etc.
     
    #8 rockboy2000, Jun 13, 2013
    Last edited: Jun 13, 2013
  9. kukelekuuk

    kukelekuuk C͕̹̲̽ͪ͐ͩ̔L̜̦̝͈ͦ̿̾̿ḘA̻̗̤̳̐ͭ̆̿̃̑ͭN̊̓͑̇ͯ
    President ⛰️⛰️ Ex-EcoLeader ⚜️⚜️⚜️ Premium Upgrade

    Joined:
    May 25, 2011
    Messages:
    10,135
    Trophy Points:
    74,230
    Ratings:
    +6,988
    Code:
    $${
    IFMATCHES(%CHATCLEAN%,^Now chatting (in|with) ([^ ]+).);
        MATCH(%CHAT%,^§eNow chatting (in|with) ([^ ]+).,{&ispm,&channel});
        SET(@&lchannel,%&channel%);
    ENDIF;
    }$$
    I had this script lying around. ( I recommend using improved chat litemod for keeping track of channels though )
     
  10. The_Tailor

    The_Tailor Builder
    Builder ⛰️ Ex-Tycoon ⚜️⚜️⚜️

    Joined:
    Mar 9, 2013
    Messages:
    1,460
    Trophy Points:
    15,840
    Gender:
    Male
    Ratings:
    +228
    I find macros vary stupid and not needed.
     
  11. rockboy2000

    rockboy2000 Builder
    Builder ⛰️ Ex-Tycoon ⚜️⚜️⚜️ Premium Upgrade

    Joined:
    Oct 19, 2012
    Messages:
    1,344
    Trophy Points:
    25,660
    Gender:
    Male
    EcoDollars:
    $132,000
    Ratings:
    +298
    Thanks for the code, I will keep it as it is as I would like to keep colours. Thanks anyway.

    There was no need to reply here then, and it begs the question, why bother even clicking on this thread?
     
  12. kukelekuuk

    kukelekuuk C͕̹̲̽ͪ͐ͩ̔L̜̦̝͈ͦ̿̾̿ḘA̻̗̤̳̐ͭ̆̿̃̑ͭN̊̓͑̇ͯ
    President ⛰️⛰️ Ex-EcoLeader ⚜️⚜️⚜️ Premium Upgrade

    Joined:
    May 25, 2011
    Messages:
    10,135
    Trophy Points:
    74,230
    Ratings:
    +6,988
    And you are saying that in here why?
     
  13. MattBrpQc

    MattBrpQc Builder
    Builder ⛰️ Ex-EcoLeader ⚜️⚜️⚜️

    Joined:
    Feb 2, 2013
    Messages:
    679
    Trophy Points:
    14,690
    Gender:
    Male
    Ratings:
    +305
    Shotgun, why do you go around looking for trouble?
     
  14. kukelekuuk

    kukelekuuk C͕̹̲̽ͪ͐ͩ̔L̜̦̝͈ͦ̿̾̿ḘA̻̗̤̳̐ͭ̆̿̃̑ͭN̊̓͑̇ͯ
    President ⛰️⛰️ Ex-EcoLeader ⚜️⚜️⚜️ Premium Upgrade

    Joined:
    May 25, 2011
    Messages:
    10,135
    Trophy Points:
    74,230
    Ratings:
    +6,988
    There's no need to continue on this.
     
  15. MattBrpQc

    MattBrpQc Builder
    Builder ⛰️ Ex-EcoLeader ⚜️⚜️⚜️

    Joined:
    Feb 2, 2013
    Messages:
    679
    Trophy Points:
    14,690
    Gender:
    Male
    Ratings:
    +305
  16. rockboy2000

    rockboy2000 Builder
    Builder ⛰️ Ex-Tycoon ⚜️⚜️⚜️ Premium Upgrade

    Joined:
    Oct 19, 2012
    Messages:
    1,344
    Trophy Points:
    25,660
    Gender:
    Male
    EcoDollars:
    $132,000
    Ratings:
    +298
    Bump, in-case you have never seen it.
     
  17. GungnirIncarnate

    GungnirIncarnate President
    President ⛰️⛰️ Ex-President ⚒️⚒️ Premium Upgrade

    Joined:
    Jul 18, 2012
    Messages:
    3,232
    Trophy Points:
    32,410
    Gender:
    Male
    Ratings:
    +481
    Just my little update for this, works for all your pms and also party chat too, it remember if you change channels while in party chat and or hat channel/who you were pm'ing when you began to chat in party. In short it will always display the correct channel, It hasn't been thoroughly tested but I have done what I can to test it myself you are more then welcome to tell me if something is wrong with it, please do tell me, I just ran out of practical stuff to do so I tweaked this.There is one other small change, instead of setting up the label and setting the binding and everything, all you have to do is create a labal and change the Control Name to "channels" (no capitals). Anyway here is my update to this:
    Code:
    $${
    STRIP(&chat,%CHAT%)
    IFMATCHES(%&chat%,Now chatting (in|with) (.*)\.)
        MATCH(%&chat%,Now chatting (in|with) (.*)\.,{&chpm,&chname})
        IFMATCHES(%&chpm%,with)
            IF(party)
                SET(&mem,"&eChatting with &d%&chname%)
                STOP
            ENDIF
            SETLABEL(channels,&eChatting with &d%&chname%)
        ELSE
            IFMATCHES(%&chpm%,in)
                IF(party)
                    SET(&mem,"&eChatting in %&color%%&chname%)
                    STOP
                ENDIF
                IF(%&chname% = "Global")
                    &color = &f
                ELSEIF(%&chname% = "Auction")
                    &color = &b
                ELSEIF(%&chname% = "Trade")
                    &color = &7
                ELSEIF(%&chname% = "Nether")
                    &color = &d
                ELSEIF(%&chname% = "Mining")
                    &color = &e
                ELSEIF(%&chname% = "Aether")
                    &color = &e
                ELSEIF(%&chname% = "Local")
                    &color = &e
                ELSEIF(%&chname% = "Donator")
                    &color = &a
                ELSEIF(%&chname% = "Pvp")
                    &color = &5
                ELSEIF(%&chname% = "hg")
                    &color = &e
                ENDIF
            SETLABEL(channels,&eChatting in %&color%%&chname%)
            ENDIF
        ENDIF
    ENDIF
    IFMATCHES(%&chat%,Party Chat only On)
        SET(&mem,"&eChatting %&chpm% %&color%%&chname%)
        SET(party)
        SETLABEL(channels,&eChatting in &aParty Chat)
    ENDIF
    IFMATCHES(%&chat%,Party Chat only Off)
        UNSET(party)
        SETLABEL(channels,%&mem%)
    ENDIF
    }$$
    - Jakey
     
  18. Espeyaar

    Espeyaar aka sprayware
    Resident ⛰️ Ex-Tycoon ⚜️⚜️⚜️ Premium Upgrade

    Joined:
    Jul 22, 2012
    Messages:
    279
    Trophy Points:
    21,840
    Gender:
    Female
    Ratings:
    +98
    I made a tiny change to jakeyray18 's script to allow users to use the display on more than one gui.

    When making the label leave the control name box empty
    put %% in the label name box
    and in the binding box put @&channel
    :D

    Code:
    $${
    STRIP(&chat,%CHATCLEAN%)
    IFMATCHES(%&chat%,"^Now chatting (in|with) (.*)\.")
        MATCH(%&chat%,"^Now chatting (in|with) (.*)\.",{&chpm,&chname})
        IFMATCHES(%&chpm%,with)
            IF(party)
                SET(&mem,&eChatting with &d%&chname%)
                STOP
            ENDIF
            SET(@&channel,&eChatting with &d%&chname%)
        ELSE
            IFMATCHES(%&chpm%,in)
                IF(party)
                    SET(&mem,&eChatting in %&color%%&chname%)
                    STOP
                ENDIF
                IF(%&chname% = "Global")
                    &color = &f
                ELSEIF(%&chname% = "Auction")
                    &color = &b
                ELSEIF(%&chname% = "Trade")
                    &color = &7
                ELSEIF(%&chname% = "Nether")
                    &color = &d
                ELSEIF(%&chname% = "Mining")
                    &color = &e
                ELSEIF(%&chname% = "Aether")
                    &color = &e
                ELSEIF(%&chname% = "Local")
                    &color = &e
                ELSEIF(%&chname% = "Donator")
                    &color = &a
                ELSEIF(%&chname% = "Pvp")
                    &color = &5
                ELSEIF(%&chname% = "hg")
                    &color = &e
                ENDIF
            SET(@&channel,&eChatting in %&color%%&chname%)
            ENDIF
        ENDIF
    ENDIF
    IFMATCHES(%&chat%,"^Party Chat only On")
        SET(&mem,&eChatting %&chpm% %&color%%&chname%)
        SET(party)
        SET(@&channel,&eChatting in &aParty Chat)
    ENDIF
    IFMATCHES(%&chat%,"^Party Chat only Off")
        UNSET(party)
        SET(@&channel,%&mem%)
    ENDIF
    }$$
     
    #18 Espeyaar, Aug 11, 2013
    Last edited: Aug 12, 2013
  19. rockboy2000

    rockboy2000 Builder
    Builder ⛰️ Ex-Tycoon ⚜️⚜️⚜️ Premium Upgrade

    Joined:
    Oct 19, 2012
    Messages:
    1,344
    Trophy Points:
    25,660
    Gender:
    Male
    EcoDollars:
    $132,000
    Ratings:
    +298
    When I have time I will edit the tutorial and use jakey's script, atm I am working on the lottery macro, fixing a few things.

    Sent from my GT-I9300 using Tapatalk 4 Beta
     
  20. AndyCYXU

    AndyCYXU Builder
    Builder ⛰️ Ex-President ⚒️⚒️

    Joined:
    Jan 20, 2014
    Messages:
    87
    Trophy Points:
    7,635
    Gender:
    Male
    Ratings:
    +7
    I know its kinda old post but i just found it , so i wanted to add this and having problem with 'pipe' '|" it doesn't seem to work and i get kicked out for spamming chat...?

    i don't have many macros "new to them" only Balance Display, Auto Repair and Tool Durability,

    Balance display uses something in the "onChat" which is $$<balchecker.txt>

    so I wrote $$<balchecker.txt>|$$<Channel.txt> and got kicked out for spam.


    So i went to single player just to test it out and indeed it keeps on shooting message

    <AndyCYXU> $$ {
    .....
    .....

    over and over again

    thanks for any help

    the other 3 macros mentioned above work perfect no problem only got kicked once because I used these {...} in $$<balchecker.txt> instead of <..> in the "onChat", fixed it and its fine now but again when i try to add the channel display this '"|" doesn't seem to work... :( ... or for that matter anything that needs to be separated by this '"|" might not work,

    I use the script provided in the very first post, not sure if it matters,

    also the PIPE is white when typed in the GUI editor the file names are kinda orange.... when i used these guys {...} i recall name was purple in color i suppose indicating it is wrong but i had no idea so i did it got kicked , changed to use these <..> and text in editor was orange.. Indicating.. correct i guess and it worked fine,

    when i type this looks like that $$<balchecker.txt>|$$<Channel.txt>


    ....anyways thanks for any help

    Andy