VERY Simple Chat Clearing Macro

Discussion in 'Basic Tutorials' started by SnDxCH4RG3R, Aug 18, 2013.

  1. SnDxCH4RG3R

    SnDxCH4RG3R |Technical Tycoon|
    Builder ⛰️ Ex-Tycoon ⚜️⚜️⚜️ Premium Upgrade

    Joined:
    Feb 27, 2012
    Messages:
    1,174
    Trophy Points:
    42,990
    Gender:
    Male
    Ratings:
    +899
    It's all a personal preference but I usually find myself overwelmed by too many chat channels, therefore I have written my own macro to leave Global, Trade, Donator, and Auction and put you into Local chat. It's very simple and can be binded to a key "I use "c" for chat"

    Anyway this may be a VERY noobish macro and I understand. I still find it useful and am proud so any and all constructive criticism or ideas are welcome!

    Simply open up your MacroMod Menu, click what key you want to have activate the chat clearer and copy and paste this in...


    /ch l|/ch leave g|$${WAIT(3)}$$|/ch leave d|/ch leave tr|$${LOG("&bAlmost Done, Finishing Up!")}$$|$${WAIT(2)}$$|/ch leave auc|$${WAIT(3)}$$|$${LOG("&cChat Cleared!")}$$

    I couldve simply had it leave all chats at once but then it would've kicked you from game for spam.

    Enjoy and any question/comments feel free below!
     
    #1 SnDxCH4RG3R, Aug 18, 2013
    Last edited: Aug 18, 2013
  2. _TANSTAAFL

    _TANSTAAFL EcoLegend
    Builder ⛰️ Ex-EcoLegend ⚜️⚜️⚜️⚜️ Prestige ⭐ I ⭐ Premium Upgrade

    Joined:
    Jun 21, 2012
    Messages:
    1,851
    Trophy Points:
    56,990
    Gender:
    Male
    Ratings:
    +1,426
    This is useful to do before any big trades. It helps you to capture proper screenshot evidence without it scrolling away.
     
  3. GungnirIncarnate

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

    Joined:
    Jul 18, 2012
    Messages:
    3,226
    Trophy Points:
    47,340
    Gender:
    Male
    Ratings:
    +481
    Just a suggestion to keep it a little more organised but I would have gone with something more like:
    Code:
    $${ECHO("/ch l");WAIT(500ms);ECHO("/ch leave g");WAIT(500ms");ECHO("/ch leave d");WAIT(500ms);ECHO("/ch leave tr");LOG("&bAlmost Done, Finishing Up!");WAIT(500ms)ECHO("/ch leave auc");LOG("&cChat Cleared!")}$$
    It is however untested and it should not kick you for spam, but this would be my small adjustment to this code :)
     
  4. SnDxCH4RG3R

    SnDxCH4RG3R |Technical Tycoon|
    Builder ⛰️ Ex-Tycoon ⚜️⚜️⚜️ Premium Upgrade

    Joined:
    Feb 27, 2012
    Messages:
    1,174
    Trophy Points:
    42,990
    Gender:
    Male
    Ratings:
    +899

    Thanks jakey, although I'm not familiar with the Echo command and only started doing Macro scripts yesterday; can you give a brief explanation of $${ECHO}$$
     
  5. GungnirIncarnate

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

    Joined:
    Jul 18, 2012
    Messages:
    3,226
    Trophy Points:
    47,340
    Gender:
    Male
    Ratings:
    +481
    ECHO("") put simply is just a way to send a command or to say something in chat, for example:
    Code:
    $${ECHO("/bal")}$$
    Would send the command "/bal" to the server just like if you typed it into chat, whereas:
    Code:
     $${ECHO("hello")}$$
    Would send it into chat just like if you were typing it into chat and sending it
     
    #5 GungnirIncarnate, Aug 18, 2013
    Last edited: Aug 18, 2013
  6. Expipiplusone

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

    Joined:
    Sep 13, 2014
    Messages:
    1,591
    Trophy Points:
    37,590
    Gender:
    Male
    Ratings:
    +777
    How to get rid of the lottery and sg broadcast? I tried adding "/lot messages" and "sg messages" to the macro, but problem is: game does not always start with those enabled. When it does, it's ok, but when it starts with those disabled, then these commands would enable them!
    I would do this with some loop, ifmatch, match and echo command, but echo does not work, so I'm forced to enclose it in }$$ ... $${ instead of echo(" ... ") and, as a consequence, I can't ifmatch
     
  7. 3point

    3point Assαssιη Ex-EcoLegend
    Builder ⛰️ Ex-EcoLegend ⚜️⚜️⚜️⚜️ Prestige ⭐ II ⭐ Premium Upgrade

    Joined:
    Sep 3, 2012
    Messages:
    778
    Trophy Points:
    68,410
    Gender:
    Male
    Ratings:
    +728
    @Expipiplusone
    IFMATCHES works even if you need to send a message using the circumventing way. Here's the template.

    IFMATCHES(%&yourstring%,"yourstring!")
    }$$
    /whatevercommands
    $${
    ENDIF

    I have a macro following this that works fine.
     
  8. GStoner3

    GStoner3 President
    President ⛰️⛰️ Ex-President ⚒️⚒️

    Joined:
    Mar 24, 2012
    Messages:
    456
    Trophy Points:
    28,105
    Gender:
    Male
    Ratings:
    +364
    After my suggestion to have a command for leaving all chats, I am watching this thread VERY closely :)

    Someone have the entire macro (that works) to leave everything like SnDxCH4RG3R's with the lottery and SG included?
     
  9. Expipiplusone

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

    Joined:
    Sep 13, 2014
    Messages:
    1,591
    Trophy Points:
    37,590
    Gender:
    Male
    Ratings:
    +777
    I get the fully legitimate error message "Script terminated with uncollapsed stack: IF expects ELSEIF, ELSE or ENDIF".
    Anyway, I think I found a workaround, let me test it thoroughly and I'll post it!
     
  10. Expipiplusone

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

    Joined:
    Sep 13, 2014
    Messages:
    1,591
    Trophy Points:
    37,590
    Gender:
    Male
    Ratings:
    +777
    Wait, I was wrong. I did get that error message, but the missing ENDIF was another.
    What @3point14mp suggested works. Unbelievably.
    My inner computer scientist just died horrified seeing something that in a real language would have triggered a hundred error messages go totally unnoticed, but it works.
    I'll soon publish the script, just give me the time for a brief funeral.