PMC - Pi's Macro Collection

Discussion in 'Basic Tutorials' started by 314, Sep 5, 2015.

  1. SionainnSun

    SionainnSun Mayor
    Mayor ⛰️⛰️ Ex-Mayor ⚒️⚒️

    Joined:
    Apr 3, 2016
    Messages:
    71
    Trophy Points:
    10,400
    Gender:
    Female
    Ratings:
    +30
    Hi :) I know that in your macros, commands are entered with a period instead of a slash; I assume that's to prevent the server error message. However, how do you use these as commands without having it sent as a regular chat message, as well? If I entered a message that started with a period, it would usually just get sent as a normal chat message, and I have no idea how you avoided this. I looked through your code on github, but I still have no idea xD
     
  2. 314

    314 Irratioπal President, former ServerAdmin
    President ⛰️⛰️ Ex-President ⚒️⚒️ Premium Upgrade

    Joined:
    Apr 1, 2014
    Messages:
    6,961
    Trophy Points:
    81,660
    EcoDollars:
    $18,000,000
    Ratings:
    +4,860
    This is correct.

    The code is located in the PMC_Core file.
    Code:
    IF(@pmcerrorc)
         IFMATCHES(%@&pmccommand%,"^\.[A-Za-z0-9]")
             LOG("&2&l[&a&lPMC&2&l] &cError: Unknown command. Type &e.help &cto see valid commands.")
             FILTER()
         ENDIF
    ENDIF
    
    The IFMATCHES() is only executed if the pmcerrorc flag is active - i.e., if no command matched the input. It matches any string that starts with a period and is followed by a number or letter. I plan to add the ability to 'bypass' this mechanism. (I.e., writing "..message" would announce ".message" in chat.)
     
  3. SionainnSun

    SionainnSun Mayor
    Mayor ⛰️⛰️ Ex-Mayor ⚒️⚒️

    Joined:
    Apr 3, 2016
    Messages:
    71
    Trophy Points:
    10,400
    Gender:
    Female
    Ratings:
    +30
    Thanks so much!
     
  4. MatthewStevenGo

    MatthewStevenGo Builder
    Builder ⛰️ Ex-Resident ⚒️

    Joined:
    May 8, 2015
    Messages:
    773
    Trophy Points:
    20,410
    Gender:
    Male
    EcoDollars:
    $8,309
    Ratings:
    +571
    Nice! But does it not work in single player?
     
  5. 314

    314 Irratioπal President, former ServerAdmin
    President ⛰️⛰️ Ex-President ⚒️⚒️ Premium Upgrade

    Joined:
    Apr 1, 2014
    Messages:
    6,961
    Trophy Points:
    81,660
    EcoDollars:
    $18,000,000
    Ratings:
    +4,860
    Some macros do (e.g. the timer), others are specifically designed for ECC (e.g. voting statistics, ShoutIgnore) or simply don't have a use in Singleplayer (e.g. the JoinAlert).
     
  6. 314

    314 Irratioπal President, former ServerAdmin
    President ⛰️⛰️ Ex-President ⚒️⚒️ Premium Upgrade

    Joined:
    Apr 1, 2014
    Messages:
    6,961
    Trophy Points:
    81,660
    EcoDollars:
    $18,000,000
    Ratings:
    +4,860
    I added a new subsection to PMC - the "Specialized PMC" bonus. Macros in this section are too specific to be included in the actual PMC; but some people may find them useful.

    These are macros that contain bugs. Intermediate knowledge about macros should be existent if you wish to use them.
     
  7. aroston

    aroston Resident
    Resident ⛰️ Ex-Mayor ⚒️⚒️

    Joined:
    Apr 28, 2016
    Messages:
    18
    Trophy Points:
    10,345
    Gender:
    Male
    Ratings:
    +9
    Can you provide previous examples of your macros?
    Well, I just submitted a pull request on github, so that's more of a current example than a previous example, but close enough.

    Do you know how to use Git (and optionally GitHub)?
    Yes. I'm a software engineer irl.

    Do you have a particular module idea in mind?

    My pull request adds the ability to pause the PMC Timer. I also want to add the ability to cancel the timer, but I haven't started on that yet. I'll probably do it today or tomorrow. These are things I want, so I'll do them whether you want to pull them into the "official" repo or not.

    <Pre-made tag to alert @314 of the suggestion/application>
     
  8. 314

    314 Irratioπal President, former ServerAdmin
    President ⛰️⛰️ Ex-President ⚒️⚒️ Premium Upgrade

    Joined:
    Apr 1, 2014
    Messages:
    6,961
    Trophy Points:
    81,660
    EcoDollars:
    $18,000,000
    Ratings:
    +4,860
    Ah, so that was your PR. I have already seen the alert and plan to check it in the evening.

    That sounds very useful, thanks!

    /timer 0s causes it to become -1 until it is redefined, it was sufficient for me (although I realize that it isn't a proper way).

    I will most likely add the pause option PR in the evening. I don't think a cancel command is necessary (due to /timer 0s), but I'd be willing to add it as well.

    Thank you for the very first PMC pull request! :)
     
  9. 314

    314 Irratioπal President, former ServerAdmin
    President ⛰️⛰️ Ex-President ⚒️⚒️ Premium Upgrade

    Joined:
    Apr 1, 2014
    Messages:
    6,961
    Trophy Points:
    81,660
    EcoDollars:
    $18,000,000
    Ratings:
    +4,860
    Thanks, @aroston - I am a little late, but I have merged the PR. :)
    I added you to the list of coding contributors.
     
    #129 314, Aug 6, 2016
    Last edited: Aug 6, 2016
  10. aroston

    aroston Resident
    Resident ⛰️ Ex-Mayor ⚒️⚒️

    Joined:
    Apr 28, 2016
    Messages:
    18
    Trophy Points:
    10,345
    Gender:
    Male
    Ratings:
    +9
    Sounds good enough to me.

    I have another one for you. The farming stats code had a bug where "Cocoa Bean" should have been "Cocoa Beans" and it therefore wasn't counting them, so I fixed that. Then I noticed you didn't have Beetroots tracked in the stats, so I added that as well.
     
  11. 314

    314 Irratioπal President, former ServerAdmin
    President ⛰️⛰️ Ex-President ⚒️⚒️ Premium Upgrade

    Joined:
    Apr 1, 2014
    Messages:
    6,961
    Trophy Points:
    81,660
    EcoDollars:
    $18,000,000
    Ratings:
    +4,860
    Sorry for the delay, I haven't had much time available for the past few days. I have merged it, thank you! :)
     
  12. Elihir

    Elihir The Red Wolf that's not so red
    Builder ⛰️ Ex-EcoLeader ⚜️⚜️⚜️ Premium Upgrade

    Joined:
    Jun 1, 2015
    Messages:
    260
    Trophy Points:
    27,310
    Gender:
    Male
    Ratings:
    +130
    What is your problem? Game freezing
    What did you do to cause the problem? use .help
    What happened? Game froze
    What should have happened?
    Gotten the .help page

    <Pre-made tag to alert @314 of the report>
     
    #132 Elihir, Oct 3, 2016
    Last edited: Oct 3, 2016
  13. 314

    314 Irratioπal President, former ServerAdmin
    President ⛰️⛰️ Ex-President ⚒️⚒️ Premium Upgrade

    Joined:
    Apr 1, 2014
    Messages:
    6,961
    Trophy Points:
    81,660
    EcoDollars:
    $18,000,000
    Ratings:
    +4,860
    o_O

    Could you please send me a forum PM with a screenshot of your onSendChatMessage and onJoinGame event bindings?
     
  14. soyuzpixel

    soyuzpixel Builder
    Builder ⛰️ Ex-Tycoon ⚜️⚜️⚜️

    Joined:
    Dec 11, 2015
    Messages:
    267
    Trophy Points:
    14,710
    Gender:
    Male
    EcoDollars:
    $0
    Ratings:
    +826
    can i enqire bout the macro, is there one that logs transactions.
     
  15. 314

    314 Irratioπal President, former ServerAdmin
    President ⛰️⛰️ Ex-President ⚒️⚒️ Premium Upgrade

    Joined:
    Apr 1, 2014
    Messages:
    6,961
    Trophy Points:
    81,660
    EcoDollars:
    $18,000,000
    Ratings:
    +4,860
    Well, you could create a macro for it, but I use an external Python script to evaluate my client logs. Also, on any UNIX OS the alternative would be a simple grep command.

    It it possible, but I don't think there is a real reason for it if there are so many easy ways to do it. (Not to mention the fact that any alternative I mentioned can also filter past log files for transactions.
     
    • Informative Informative x 1
    • List
  16. RaginDevonian

    RaginDevonian Pro Pokemon Player
    Mayor ⛰️⛰️ Ex-Mayor ⚒️⚒️ Premium Upgrade

    Joined:
    Sep 22, 2013
    Messages:
    1,482
    Trophy Points:
    48,960
    Gender:
    Male
    EcoDollars:
    $47,000
    Ratings:
    +1,023
    What is your problem? Tool Switcher not working
    What did you do to cause the problem? Nothing followed the exact instructions
    What happened? Could not assign a tool to a slot
    What should have happened? Tool should be a assigned to a slot so i can use the tool switcher.

    The message said please choose a subcommand and the only subcommand is /tool none.

    <Pre-made tag to alert @314 of the report>
     
    #136 RaginDevonian, Dec 19, 2016
    Last edited: Dec 19, 2016
  17. 314

    314 Irratioπal President, former ServerAdmin
    President ⛰️⛰️ Ex-President ⚒️⚒️ Premium Upgrade

    Joined:
    Apr 1, 2014
    Messages:
    6,961
    Trophy Points:
    81,660
    EcoDollars:
    $18,000,000
    Ratings:
    +4,860
     
  18. RaginDevonian

    RaginDevonian Pro Pokemon Player
    Mayor ⛰️⛰️ Ex-Mayor ⚒️⚒️ Premium Upgrade

    Joined:
    Sep 22, 2013
    Messages:
    1,482
    Trophy Points:
    48,960
    Gender:
    Male
    EcoDollars:
    $47,000
    Ratings:
    +1,023
    Well then i feel dumb
     
  19. 314

    314 Irratioπal President, former ServerAdmin
    President ⛰️⛰️ Ex-President ⚒️⚒️ Premium Upgrade

    Joined:
    Apr 1, 2014
    Messages:
    6,961
    Trophy Points:
    81,660
    EcoDollars:
    $18,000,000
    Ratings:
    +4,860
    For those who haven't seen the thread: https://www.ecocitycraft.com/forum/threads/copy-and-paste.161293 gave me an idea for a new PMC addition. Now I'll present a preview.


    So, the recent macro mod updates have added something pretty neat... a LOGRAW command, which can be used to send JSON formatted messages to the client.
    [​IMG]
    Yes, JSON actually allows the creation of messages that have a hover text or behave like an actual URL when clicked.
    Yes, I want to add this macro to PMC semi-soon.
    Yes, I decided to make it available as a standalone script because I know the PMC update will take a while.


    Add it to a file called uuid.txt and bind $$<uuid.txt> to onChat.
    Code:
    $${
    IFMATCHES(%CHATCLEAN%,"^Notice: That (.+) is locked by ([\w\d]+) \(([a-f\d\-]+)\)\.$")
        MATCH(%CHATCLEAN%,"^Notice: That (.+) is locked by ([\w\d]+) \(([a-f\d\-]+)\)\.$",{null,null,&uuid})
        &json := "[\"\",{\"text\":\"%&uuid%\",\"color\":\"red\",\"clickEvent\":{\"action\":\"open_url\",\"value\":\"https://namemc.com/profile/%&uuid%\"},\"hoverEvent\":{\"action\":\"show_text\",\"value\":{\"text\":\"\",\"extra\":[{\"text\":\"Click this UUID to open its namemc.com page.\",\"color\":\"yellow\"}]}}}]"
        LOG("&6Link to this UUID's www.namemc.com page:")
        LOGRAW(%&json%)
    ENDIF
    }$$
    
    This will most likely prevent quite a lot of annoyance while searching for an unknown user's UUID during LWC removal request creation.
     
    • Winner Winner x 1
    • Informative Informative x 1
    • List
  20. strongpelt

    strongpelt ~*Alaskan Sponsor*~
    Mythic ⚔️ I ⚔️ ECC Sponsor President ⛰️⛰️ Ex-EcoLegend ⚜️⚜️⚜️⚜️ Prestige ⭐ IV ⭐ Premium Upgrade

    Joined:
    Apr 1, 2016
    Messages:
    1,070
    Trophy Points:
    59,660
    Gender:
    Female
    Ratings:
    +2,064
    What is your problem? The new uuid macro gives me an autokick as soon as i use it on ecc. (as in as soon as i set it up)
    What did you do to cause the problem? Followed your instructions lmao
    What happened? Autokicked for spamming chat
    What should have happened?
    Well i'd assume nothing should have happened as soon as it got done being set up. I didn't even make it to a chest to see.
    <Pre-made tag to alert @314 of the report>
     
    #140 strongpelt, Dec 30, 2016
    Last edited: Dec 30, 2016