Question regarding a macro

Discussion in 'Help & Support / Errors & Bugs' started by Serkroth, Jan 13, 2016.

  1. Serkroth

    Serkroth Builder
    Builder ⛰️ Ex-Resident ⚒️

    Joined:
    Jan 11, 2016
    Messages:
    5
    Trophy Points:
    10,105
    Gender:
    Male
    Ratings:
    +0
    Couldn't decide if this belongs here or in another section of the forums, so adjust accordingly.

    There is a macro I found on the forums that basically just counts the items you mine (Coal, Redstone etc).
    I have everything setup properly (or so I thought) but it doesn't seem to be registering the items I'm picking up.

    My question is, is %PICKUPITEM% even valid?

    I see no mention of it in the Macromod documentation, but that doesn't surprise me. There being no real mention of it on the net though, makes me think it's no longer valid.

    I attempted using itemID's (as a last resort since they have been removed), the proper item names (Redstone_Ore, Coal_Ore, Iron_Ore etc.) as well as the default names included with the script.

    My label names are correct. I have attempted just adding 1 (int) to the variable, no go there.

    My other question is, is if %PICKUPITEM% is not the right method (function, call, w/e), is there one that works the same if not similar?

    For your convenience, here's the code:

    Code:
    $${
    IF(%PICKUPITEM% = "Coal")
    @#coal = @#coal + 1
    SETLABEL(Stats_Coal,Coal:  %@#coal%)
    ENDIF
    
    IF(%PICKUPITEM% = "Iron_Ore")
    @#iron = @#iron + %PICKUPAMOUNT%
    SETLABEL(Stats_Iron,Iron:  %@#iron%)
    ENDIF
    
    IF(%PICKUPITEM% = "Gold_Ore")
    @#gold = @#gold + %PICKUPAMOUNT%
    SETLABEL(Stats_Gold,Gold:  %@#gold%)
    ENDIF
    
    IF(%PICKUPITEM% = "dye:4")
    @#lapis = @#lapis + %PICKUPAMOUNT%
    SETLABEL(Stats_Lapis,Lapis:  %@#lapis%)
    ENDIF
    
    IF(%PICKUPITEM% = "lit_redstone_ore")
    @#redstone = @#redstone + %PICKUPAMOUNT%
    SETLABEL(Stats_Redstone,Redstone: %@#redstone%)
    ENDIF
    
    IF(%PICKUPITEM% = "Diamond_Ore")
    @#diamond = @#diamond + %PICKUPAMOUNT%
    SETLABEL(Stats_Diamond,Diamond:  %@#diamond%)
    ENDIF
    
    IF(%PICKUPITEM% = "Emerald_Ore")
    @#emerald = @#emerald + %PICKUPAMOUNT%
    SETLABEL(Stats_Emerald,Emerald:  %@#emerald%)
    ENDIF
    }$$
     
  2. Dccciz

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

    Joined:
    Mar 8, 2013
    Messages:
    2,830
    Trophy Points:
    50,090
    EcoDollars:
    $0
    Ratings:
    +2,061
    @314 created this, I'm sure he knows the answers. I'm not too good at macromod scripts and he's an expert :p
     
  3. Serkroth

    Serkroth Builder
    Builder ⛰️ Ex-Resident ⚒️

    Joined:
    Jan 11, 2016
    Messages:
    5
    Trophy Points:
    10,105
    Gender:
    Male
    Ratings:
    +0
    Thank you. For the life of me, I could not find his thread when writing this up so I could at least reference it.
     
  4. Dccciz

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

    Joined:
    Mar 8, 2013
    Messages:
    2,830
    Trophy Points:
    50,090
    EcoDollars:
    $0
    Ratings:
    +2,061
  5. 314

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

    Joined:
    Apr 1, 2014
    Messages:
    7,055
    Trophy Points:
    97,160
    EcoDollars:
    $2,400,000
    Ratings:
    +4,921
    This is an old and abandoned macro, this functionality has been added to www.tinyurl.com/314sMacro inside the Statistics macro. I wouldn't recommend to use this version, although it should still work.


    If you look at the text of the item pickup event, you can see that %PICKUPITEM% is a global variable. The code I linked above still uses the same and works perfectly.

    I have, however, seen a few problems with SETLABEL() recently. I don't know whether that could be the reason.

    Thanks for the tag and the compliment. :p
     
  6. Serkroth

    Serkroth Builder
    Builder ⛰️ Ex-Resident ⚒️

    Joined:
    Jan 11, 2016
    Messages:
    5
    Trophy Points:
    10,105
    Gender:
    Male
    Ratings:
    +0
    I guess I should have actually looked through that collection rather than pushing it off until later. Thanks for the help!