The Script aka How Gilgamech Knows Who Sells What

Discussion in 'Discussion' started by Gilgamech, May 24, 2019.

  1. Gilgamech
    Offline

    Gilgamech Member

    Joined:
    May 24, 2019
    Messages:
    25
    Hi all

    You might have seen someone ask in chat "Who sells glass" and I give 5-6 shop names. Some of you have asked how this works, so here it is in all its ugly glory. Please beware, this is Powershell, which sits atop .NET, so may be unsuitable to those allergic to MS:

    1. Visit your island and right-click each shop.
    - This puts in your chat log the data: item, price, transactions remaining.
    - Minecraft writes these to its client folder, zipping old ones as gzip to save space.
    2. The script (it's in Powershell): GitHub - Gilgamech/MinecraftShopScrape: Parses Minecraft chat logs to pull shop data from them.
    - ConvertFrom-Gzip - I found this somewhere else, and use it to unzip chat files and lump them together.
    - Parse-MCChat - I wrote this to parse the output from ConvertFrom-Gzip into .NET objects. It adds a shopkeeper to each object from the last visited island, and a timestamp from the file name that it sends to ConvertFrom-Gzip.
    - Get-MCItemPrices - I wrote this to recombine Parse-MCChat into shop objects. This is the foundation of my scripts.

    I have 2 more that I forgot to add, starting to run out of names:
    Get-Who2 - Runs Get-MCItemPrices, then reduces that to a list of shopkeepers, then adds "These shops sell" and make it a sentence.
    Get-MCW2 - Runs Get-MCItemPrices in an easy-to-read format.

    One of the essential bits to this is having someone check every shop every day - it gets to be a lot of going shop-to-shop, but if a shop is checked often enough, we can get real-time inventory and trends data. Is that overkill? :D
     
    • Winner Winner x 2
    • Like Like x 1
    • Useful Useful x 1
  2. Archie38
    Offline

    Archie38 Well-Known Member

    Joined:
    Mar 29, 2019
    Messages:
    674
    IGN:
    Archie38
    Thanks so much for the info Gil! Always wondered :D
     
  3. Terminator966
    Offline

    Terminator966 Member

    Joined:
    Apr 17, 2019
    Messages:
    19
    Gilg that's awesome dude! I always thought you just had a large notepad and copy/pasted whenever someone asked.

    Keep up the great work!
     

Share This Page