World of Warcraft

I use the Mizus RaidTracker addon to record loot awards in our raids. I made this python script to put the awards into Discord.

Content of the article: "I use the Mizus RaidTracker addon to record loot awards in our raids. I made this python script to put the awards into Discord."



First a shout out to the guys who made Mizus RaidTracker. Its a legit good addon for tracking attendance and awards. It does other things but thats what we use it for, you can find it here: https://www.curseforge.com/wow/addons/mizusraidtracker

And now the script. Note this is probably not perfect python but it works. Feel free to use/fix/share/ignore as you please. This is running under the ubuntu subsystem for windows but you can use a windows version of python if you want. Make sure you give it your path to the MRT lua file & the webhook url of the discord channel you want to post into.

This will post rewards about 20 at a time & will pause between them to avoid the rate limit. The output looks like this https://i.imgur.com/PMujRxx.png

#!/usr/bin/python3 from datetime import datetime from pytz import timezone import pytz, time as thyme from discord_webhook import DiscordWebhook lootRecordFile='/mnt/c/Program Files (x86)/World of Warcraft/_classic_/WTF/Account/ACCOUNTNAMEHERE/SavedVariables/MizusRaidTracker.lua' lootURLBase='https://classic.wowhead.com/item=' hookURL='https://discord.com/api/webhooks/YOURWEBHOOKHERE' itemDb={} startDate='' invalidDate = True while invalidDate: startDate=input('Enter the start date in the format YYYY-MM-DD: ') try: startDate=datetime.strptime(startDate, '%Y-%m-%d') invalidDate = False except Exception as e: print(str(e)) print('Invalid date. Try again.') def putItOnDiscord(message): print(message) webhook = DiscordWebhook(url=hookURL, content=message) response = webhook.execute() thyme.sleep(5) with open(lootRecordFile,'r') as sourceFile: for cnt,line in enumerate(sourceFile): data=str(line).strip().replace(',','').replace('"','').replace('<','').replace('>','') itemDb=data parsedDb=<> for row,value in itemDb.items(): if 'MRT_PlayerDB =' in value: break if 'ItemName' in value: item=value.replace('ItemName = ','') looter='' dtime='' quality='' itemId='' for x in range(1,10): r=row+x rowAhead=itemDb if 'ItemName' in rowAhead: break if 'Looter' in rowAhead: looter=rowAhead.replace('Looter = ','') if 'Time' in rowAhead: dtime=datetime.fromtimestamp(int(rowAhead.replace('Time = ',''))).astimezone(timezone('US/Pacific')).strftime('%Y-%m-%d') if 'ItemColor' in rowAhead: quality=rowAhead.replace('ItemColor = ','') if 'ItemId' in rowAhead: itemId=rowAhead.replace('ItemId = ','') itemLink = lootURLBase + itemId if quality == 'ff9d9d9d': quality = 'trash' if quality == 'ffffffff': quality = 'common' if quality == 'ff1eff00': quality = 'uncommon' if quality == 'ff0070dd': quality = 'rare' if quality == 'ffa335ee': quality = 'epic' if quality == 'ffff8000': quality = 'legendary' if datetime.strptime(dtime, '%Y-%m-%d') >= startDate: parsedDb.append({'item':item, 'looter':looter, 'quality':quality, 'time':dtime, 'url':itemLink}) chunk=1 messageChunks=<> messageBlock='Loot! n' for loot in parsedDb: thisRow=loot<'looter'>+' won <' + loot<'item'> + '>(<'+ loot<'url'> +'>) on ' + loot<'time'> if (loot<'quality'> == 'epic') or (loot<'quality'> == 'legendary'): messageBlock=messageBlock+thisRow+' n' chunk = chunk + 1 if chunk > 20: chunk=1 messageChunks.append(messageBlock) messageBlock='Loot! n' messageChunks.append(messageBlock) for chunk in messageChunks: putItOnDiscord(chunk) 

Source: reddit.com



Similar Guides


More about World of Warcraft

Post: "I use the Mizus RaidTracker addon to record loot awards in our raids. I made this python script to put the awards into Discord." specifically for the game World of Warcraft. Other useful information about this game:





Top 10 NEW Games of November 2020

November 2020 is filled with tons of games to pay attention to thanks to the upcoming launch of PS5 /Xbox Series X and beyond. Here's a roundup of the big ones.


Top 10 Best Video Games of 2020 (So Far)

In times of uncertainty, video games allow us to escape from the stress of the real world. For this list, we’ll be looking at some of the best games released in the first half of 2020.


You Might Also Like

Leave a Reply

Your email address will not be published. Required fields are marked *