Chat Channel Join Macro

Discussion in 'Basic Tutorials' started by RyanBlocks2, Dec 29, 2015.

  1. RyanBlocks2

    RyanBlocks2 EcoLeader
    EcoLeader ⛰️⛰️⛰️ Ex-Tycoon ⚜️⚜️⚜️ Premium Upgrade

    Joined:
    Nov 29, 2012
    Messages:
    2,773
    Trophy Points:
    61,660
    Gender:
    Male
    Ratings:
    +946
    Chat Joiner Macro v 1.0
    [​IMG]


    There has been a bug recently that has caused players to leave channels. I believe it has to do with server restarts? but i'm not sure. Anyway, to deal with the problem I created this macro.
    Upon Entering the game the macro joins the following channels:

    - Local
    - Global
    - Auction
    - Trade
    - VIP
    - Alert

    There are also a few commands.
    /joinToggle will turn this macro on and off
    /chatToggle will toggle auto connections for specific channels on and off. Ex: /chatToggle auction will make it so auction wont be automatically joined when you start.

    Installation is pretty simple you can find instructions below:
    Step 1: Open Up Macro mod in game. This can be done by pressing SHIFT and ` at the same time.
    Step 2: On the bottom right click the symbol that looks like a little I (...I). It should say text editor when you hover over it.
    Step 3: You should get a text box saying "Create a new file:". In that box put "joinChat.txt" and hit create.
    Step4: A box should come up. Place the following code in that box:
    $${

    IF(%KEYNAME% == "onJoinGame")
    IF(%@test%)
    ELSE
    WAIT(1000ms)
    LOG("Chat Joiner: Joining Chat Channels")
    IF(@chat)


    IF(%@channel[0]% == "false")
    ECHO("/ch join local")
    WAIT(500ms)
    ENDIF

    IF(%@channel[1]% == "false")
    ECHO("/ch join global")
    WAIT(500ms)
    ENDIF

    IF(%@channel[2]% == "false")
    ECHO("/ch join trade")
    WAIT(500ms)
    ENDIF

    IF(%@channel[3]% == "false")
    ECHO("/ch join vip")
    WAIT(500ms)
    ENDIF

    IF(%@channel[4]% == "false")
    ECHO("/ch join auc")
    WAIT(500ms)
    ENDIF

    IF(%@channel[5]% == "false")
    ECHO("/ch join alert")
    WAIT(500ms)
    ENDIF


    ELSE

    TOGGLE(@chat)

    IF(%@channel[0]% == "false")
    ECHO("/ch join local")
    WAIT(500ms)
    ENDIF

    IF(%@channel[1]% == "false")
    ECHO("/ch join global")
    WAIT(500ms)
    ENDIF

    IF(%@channel[2]% == "false")
    ECHO("/ch join trade")
    WAIT(500ms)
    ENDIF

    IF(%@channel[3]% == "false")
    ECHO("/ch join vip")
    WAIT(500ms)
    ENDIF

    IF(%@channel[4]% == "false")
    ECHO("/ch join auc")
    WAIT(500ms)
    ENDIF

    IF(%@channel[5]% == "false")
    ECHO("/ch join alert")
    WAIT(500ms)
    ENDIF

    ENDIF

    LOG("Chat Joiner: All chat channels have been joined")
    TOGGLE(@chat)

    ENDIF






    ELSE

    IFMATCHES(%CHAT%, "^/help chatJoin")
    LOG(" &e---- &6Help: Chat Join &e-- &6Page &c1 &6of &c1 &e----")
    LOG("&7 Automatic chat joiner v 1.0 12/29/2015")
    LOG("/joinTogle - Toggles Chat Joiner on and off")
    LOG("/chatToggle <channel> - Toggles joiner for specified channel")
    FILTER
    ENDIF

    IFMATCHES(%CHAT%, "^/joinToggle")
    IF(%@test%)
    LOG("Chat joiner now activated")
    ELSE
    LOG("Chat joiner now deactivated")
    ENDIF
    TOGGLE(@test)
    FILTER
    ENDIF


    IFMATCHES(%CHAT%, "^/chatToggle (Local|local|l|L)")
    IF(%@channel[0]% == "true")
    SET(@channel[0],FALSE)
    LOG("Local chat will now be joined")
    ELSE
    SET(@channel[0],TRUE)
    LOG("Local chat will no longer be joined")
    ENDIF
    FILTER
    ENDIF

    IFMATCHES(%CHAT%, "^/chatToggle (Global|global|g|G)")
    IF(%@channel[1]% == "true")
    SET(@channel[1],FALSE)
    LOG("Global chat will now be joined")
    ELSE
    SET(@channel[1],TRUE)
    LOG("Global chat will no longer be joined")
    ENDIF
    FILTER
    ENDIF

    IFMATCHES(%CHAT%, "^/chatToggle (Trade|trade)")
    IF(%@channel[2]% == "true")
    SET(@channel[2],FALSE)
    LOG("Trade chat will now be joined")
    ELSE
    SET(@channel[2],TRUE)
    LOG("Trade chat will no longer be joined")
    ENDIF
    FILTER
    ENDIF

    IFMATCHES(%CHAT%, "^/chatToggle (VIP|vip|Vip|V|v)")
    IF(%@channel[3]% == "true")
    SET(@channel[3],FALSE)
    LOG("VIP chat will now be joined")
    ELSE
    SET(@channel[3],TRUE)
    LOG("VIP chat will no longer be joined")
    ENDIF
    FILTER
    ENDIF

    IFMATCHES(%CHAT%, "^/chatToggle (auc|AUC|Auc)")
    IF(%@channel[4]% == "true")
    SET(@channel[4],FALSE)
    LOG("Auction chat will now be joined")
    ELSE
    SET(@channel[4],TRUE)
    LOG("Auction chat will no longer be joined")
    ENDIF
    FILTER
    ENDIF

    IFMATCHES(%CHAT%, "^/chatToggle (Alert|alert|ALERT)")
    IF(%@channel[5]% == "true")
    SET(@channel[5],FALSE)
    LOG("Alert chat will now be joined")
    ELSE
    SET(@channel[5],TRUE)
    LOG("Alert chat will no longer be joined")
    ENDIF
    FILTER
    ENDIF

    IFMATCHES(%CHAT%, "^/chatToggle (Trv|trv|Trivia|trivia)")
    IF(%@channel[6]% == "true")
    SET(@channel[6],FALSE)
    LOG("Trivia chat will now be joined")
    ELSE
    SET(@channel[6],TRUE)
    LOG("Trivia chat will no longer be joined")
    ENDIF
    FILTER
    ENDIF

    ENDIF
    }$$

    Step5: Hit Save. Now, on the top left you should see "Macro Bindings:" with arrow keys on either side. Click these arrow keys until you come to "Macro Bindings: Events"
    Step6: Click OnJoinGame and in the box that allows you to type in it write $$<joinChat.txt>.
    Step7: Repeat step 6 just click onSendChatMessage instead of OnJoinGame.
    Step 8: Hit the little button in the far top left. Scroll down and click Edit Chat filter.
    Step 9: Paste the following code in there.

    IF(@chat)
    IFMATCHES(%CHATCLEAN%, "You are already in");
    FILTER();
    ENDIF();
    ENDIF();

    Step 10: You're done. Everything should work correctly. Try using the /help chatJoin command to check if it is setup.

    Disclaimer: When it is enabled chat joiner spams commands in the beginning in order to join all the chat channels. Writing more commands or text while the macro is running (it takes a couple seconds) could result in an auto kick.
     
    #1 RyanBlocks2, Dec 29, 2015
    Last edited: Dec 30, 2015
  2. Dccciz

    Dccciz Nicememer55
    Builder ⛰️ Ex-Tycoon ⚜️⚜️⚜️ Premium Upgrade

    Joined:
    Mar 8, 2013
    Messages:
    2,802
    Trophy Points:
    54,090
    EcoDollars:
    $0
    Ratings:
    +2,060
    1. What's the point of the 2nd script?
    2. You can replace (1000ms) with (1) :p
     
  3. RyanBlocks2

    RyanBlocks2 EcoLeader
    EcoLeader ⛰️⛰️⛰️ Ex-Tycoon ⚜️⚜️⚜️ Premium Upgrade

    Joined:
    Nov 29, 2012
    Messages:
    2,773
    Trophy Points:
    61,660
    Gender:
    Male
    Ratings:
    +946
    Welp since im lazy there is no conditional for joining chat channels so it just joins em all. The second one gets rid of all the "you are already in __ chat" messages.

    Also it was in ms cause I was testing how close I could get the messages without being auto kicked
     
    #3 RyanBlocks2, Dec 29, 2015
    Last edited: Dec 29, 2015
  4. RyanBlocks2

    RyanBlocks2 EcoLeader
    EcoLeader ⛰️⛰️⛰️ Ex-Tycoon ⚜️⚜️⚜️ Premium Upgrade

    Joined:
    Nov 29, 2012
    Messages:
    2,773
    Trophy Points:
    61,660
    Gender:
    Male
    Ratings:
    +946
    Fixed Wait times. Now runs half a second faster for each chat you have toggled off. Time to join all chats remains 3 seconds.