AFK display macro tutorial

Discussion in 'Basic Tutorials' started by GungnirIncarnate, Aug 27, 2013.

  1. GungnirIncarnate

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

    Joined:
    Jul 18, 2012
    Messages:
    3,226
    Trophy Points:
    47,340
    Gender:
    Male
    Ratings:
    +481
    Plain and simple this macro display on screen "AFK: True" if you are afk or "AFK: False" if you are not afk.

    now you want to create a new text file for the main script so go to your macro bindings event screen and click the '..I' button in the bottom right corner of the screen as shown below:
    [​IMG]

    On the next screen we want to create a new text file and we are going to call it "afkdisplay" and then hit create (ignore the 'balchecker in the next screenshot it is a reused image):
    [​IMG]

    Once you hit create an text document like screen will come up in this screen you will need to copy and paste the following code:
    Code:
    $${
    STRIP(&chat,%CHAT%)
    IFMATCHES(%&chat%,"^You are now AFK\.")
        SET(@&afk,AFK: &4True)
    ELSE
        IFMATCHES(%&chat%,"^You are no longer AFK\.")
            SET(@&afk,AFK: &bFalse)
        ENDIF
    ENDIF
    }$$
    Now once you paste that script into the text file hit save in the lower right corner, there you have created the afkdisplay.txt, now we have to bind it to the onChat event. To do this go back to your macro bindings events screen and click the onChat event. In this screen type:
    Code:
    $$<afkdisplay.txt>
    into the box, remember if you have other macros there you must separate them with a pipe "|".
    Now we need to set up a way to set it to un-afk if you relog while afk, to do this go to the onJoinGame event in the macro bindings: events screen and input:
    Code:
    $${SET(@&afk,AFK: &bFalse)}$$
    Remember once again if you have other scripts here to separate with a pipe, "|".

    Now just one thing left to do, create the on screen label where it will be displayed, So head back to the macro bindings: events screen and in the lower right corner click the "GUI editor" button. Then double click on the "in-game" GUI in the left hand tab. This will display your on screen GUI. In the lower left corner of this screen click the "Button panel commands" button and click add label, place the label wherever you want it (you can change this afterwards), When you place the label a properties window will appear, this time we are going to ignore the "control name" and jump straight to the "label text" in this I want you to simple enter in two percent signs like below:
    Code:
    %%
    Then in the next binding option I want you to enter:
    Code:
    @&afk
    Then you can click 'ok' and change the label settings at will.
    You should be all set up now, test it out make sure it works, if you have any problems please post below, and mind you if there is a problem with the script just give me a shout I did write it up in this thread not in my minecraft with macromod so it is all written from memory.
    and I guess have fun.

    ~Jakey
     
  2. lurkblader

    lurkblader Hardcore-Farmer Giftcards-Buyer EcoMaster
    Builder ⛰️ Ex-EcoMaster ⚜️⚜️⚜️⚜️ Premium Upgrade

    Joined:
    May 6, 2013
    Messages:
    142
    Trophy Points:
    40,490
    Gender:
    Male
    Ratings:
    +135
    Thank you so much Jakey! I wanted this AFK display so much! And now, just by changing all the keywords "afk" to "vanish", and changing the sentences on chat, it also works for displaying vanish too!!. Always thank you for your hard work in macro mod!
     
    #2 lurkblader, Aug 28, 2013
    Last edited: Aug 28, 2013
  3. GungnirIncarnate

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

    Joined:
    Jul 18, 2012
    Messages:
    3,226
    Trophy Points:
    47,340
    Gender:
    Male
    Ratings:
    +481

    You are most welcome, I normally get around to doing most major requests that people want, private ones often get side tracked though.
     
  4. Lee1104

    Lee1104 Builder
    Builder ⛰️ Ex-Tycoon ⚜️⚜️⚜️

    Joined:
    Oct 5, 2012
    Messages:
    1,913
    Trophy Points:
    31,940
    Gender:
    Male
    Ratings:
    +322
    You deserve a rating! :D
     
  5. GungnirIncarnate

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

    Joined:
    Jul 18, 2012
    Messages:
    3,226
    Trophy Points:
    47,340
    Gender:
    Male
    Ratings:
    +481
    Bump because users have been asking me about these and none of my macros break any rules.
     
  6. Monkeyz505

    Monkeyz505 Builder
    Builder ⛰️ Ex-Mayor ⚒️⚒️

    Joined:
    Feb 11, 2013
    Messages:
    1,730
    Trophy Points:
    32,140
    Gender:
    Male
    EcoDollars:
    $0
    Ratings:
    +512
    I'm not sure what the macro actually does.. I assume it puts something on-screen that says if you're afk or not?
     
  7. GungnirIncarnate

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

    Joined:
    Jul 18, 2012
    Messages:
    3,226
    Trophy Points:
    47,340
    Gender:
    Male
    Ratings:
    +481
    Thats exactly what it does.
     
  8. 314

    314 Irrational GameAdmin, former ServerAdmin
    EcoLegend ⛰️⛰️⛰️⛰️ Ex-President ⚒️⚒️ Prestige ⭐ VI ⭐ Premium Upgrade

    Joined:
    Apr 1, 2014
    Messages:
    7,219
    Trophy Points:
    97,160
    EcoDollars:
    $6,000,000
    Ratings:
    +4,955
    Tested this macro...I must be doing something wrong. The onJoinGame to set the variable to false doesn't work for me. :/
     
  9. GungnirIncarnate

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

    Joined:
    Jul 18, 2012
    Messages:
    3,226
    Trophy Points:
    47,340
    Gender:
    Male
    Ratings:
    +481
    Did you by chance have anything else in your onJoinGame Event?
     
  10. 314

    314 Irrational GameAdmin, former ServerAdmin
    EcoLegend ⛰️⛰️⛰️⛰️ Ex-President ⚒️⚒️ Prestige ⭐ VI ⭐ Premium Upgrade

    Joined:
    Apr 1, 2014
    Messages:
    7,219
    Trophy Points:
    97,160
    EcoDollars:
    $6,000,000
    Ratings:
    +4,955
    ECHO /lot, ECHO /bal and coordinates.txt. But all separated with a |.

    (Aside from that, what is the difference between |$${ECHO("/bal")}$$| and |/bal|? Tried to add /ch g for onJoinGame, but that never works.)