Tutorial - Show Balance w/ MacroMod

Discussion in 'Basic Tutorials' started by mcdoodify, May 27, 2013.

  1. mcdoodify

    mcdoodify Builder
    Builder ⛰️ Ex-Mayor ⚒️⚒️

    Joined:
    Apr 28, 2013
    Messages:
    23
    Trophy Points:
    25,200
    Gender:
    Male
    Ratings:
    +0
    This is how you get your balance to show on the game screen at all times using the Macromod/Keybind mod.

    Create a script called check_chat.txt:
    Code:
    $${
    // trim chat
    STRIP(&chat,%CHAT%);
    // update balance
    IFMATCHES(%&chat%,^\[EcoDollars\] (.*));
      MATCH(%&chat%,^\[EcoDollars\] \$(.*),{@&balance});
      IFMATCHES(%@&balance%,^([0-9]+)\.([0-9]+));
        MATCH(%@&balance%,^([0-9]+)\.([0-9]+),{@&balanceround,@&rest});
          SET(@#balance,%@&balanceround%);
      ELSE;
        SET(@#balance,%@&balance%);
      ENDIF;
    SETLABEL(balance,$%@&balance%,balance);
    ENDIF;
    }$$
    On the Events binding for onChat type in
    Code:
    $$<check_chat.txt>
    Create a second script called loop_bal.txt:
    Code:
    $${
    DO;
    ECHO("/bal");
    WAIT(90);
    }$$
    On the Events binding for onJoinGame type in
    Code:
    $$<loop_bal.txt>
    To make it show up all the time, go to the Macro Buttons screen, click Edit GUI in the lower right, and select the ingame screen. Create a label named balance with a binding of balance, and place it wherever you want the balance to show up.

    Tada.
     
    #1 mcdoodify, May 27, 2013
    Last edited: May 27, 2013
  2. sick24

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

    Joined:
    Dec 9, 2012
    Messages:
    4,108
    Trophy Points:
    53,660
    Gender:
    Male
    Ratings:
    +550
    Uhh I think Jakeyray already did this unless you added something to it.
     
  3. mcdoodify

    mcdoodify Builder
    Builder ⛰️ Ex-Mayor ⚒️⚒️

    Joined:
    Apr 28, 2013
    Messages:
    23
    Trophy Points:
    25,200
    Gender:
    Male
    Ratings:
    +0
    Yeah, his didn't really make it clear how to have it show up on the screen all the time, but yes it is mostly his. I didn't see the link.
     
  4. kukelekuuk

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

    Joined:
    May 25, 2011
    Messages:
    10,061
    Trophy Points:
    80,160
    Ratings:
    +6,925
  5. GungnirIncarnate

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

    Joined:
    Jul 18, 2012
    Messages:
    3,229
    Trophy Points:
    47,340
    Gender:
    Male
    Ratings:
    +481
    Another thing to add, I have also updated mine to the point it does not need the loop anymore only to echo /bal on login as it now updates the display on all transactions immediately. mcdoodify
     
  6. GungnirIncarnate

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

    Joined:
    Jul 18, 2012
    Messages:
    3,229
    Trophy Points:
    47,340
    Gender:
    Male
    Ratings:
    +481
    also the only reason that mine doesn't stay ingame all the time now is because of a recent macromod update that changed the way you accessed your ingame GUI due to the ability to now have custon GUIs.
     
  7. mcdoodify

    mcdoodify Builder
    Builder ⛰️ Ex-Mayor ⚒️⚒️

    Joined:
    Apr 28, 2013
    Messages:
    23
    Trophy Points:
    25,200
    Gender:
    Male
    Ratings:
    +0
    awesome. jake's is clearly better. use his.
     
  8. mcdoodify

    mcdoodify Builder
    Builder ⛰️ Ex-Mayor ⚒️⚒️

    Joined:
    Apr 28, 2013
    Messages:
    23
    Trophy Points:
    25,200
    Gender:
    Male
    Ratings:
    +0
    Care to share that RegEx string with the rest of us?
     
  9. GungnirIncarnate

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

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

    I have already created the tutorial here on the forums, most users who had the old one now have upgraded to the new one. mcdoodify