Tonight I had a few beers and maybe a shot of whiskey or two and was trying to collect some items. I was looking through my groups bags to see if everyone had a collection and decided to write a script to do that for me, cause its a PITA to look through your bags.
I wrote a python script that will show me all the items that all six of my toons have in inventory. This can be used for different things, but I wrote it mainly for collections. Maybe you'll find it useful if you like Python. I know most people have shifted to Lua and this is totally doable in Lua. Like I said already, I've had a few beers and don't know Lua as well as others, so I wrote this in python. Just trying to give back to the community.
Assumptions:
[CODE lang="python" title="RG_weHaveSix.py"]
# Requirements as I run it.... YMMV
# Windows 11
# Python 3.9.13 - you can have lower or higher version of Python 3
# Lootly
#
# Run the following command on your six toon team, depending on which in game broadcast you use
# Dannet: /dgga /outputfile inventory
# or
# EQBC: /bcga /outputfile inventory
import re
####################
# Replace with your path to your Lootly INI file
lootlyPath = 'C:\\Games\\MQ2Next\\config\\Lootly_Loot.ini'
# Replace with your path to Everquest
eqPath = 'C:\\Games\\Everquest\\'
# Replace with your character names in your group
Goup1 = ['Tank', 'DPS1', 'DPS2', 'CC', 'Utility', 'Healer']
# Replace "server" with the server you play on
f_Inventory = '_server-Inventory.txt'
# Replace "Tank" with the name of your main looter
focusPlayer = 'Tank'
# Replace with items that you DON'T want to match on
ignore = "(Tailored Legendary Backpack|Heroic Satchel of the Adventurer|\
Extraplanar Trade Satchel|Scuffed Journeyman's Rucksack|\
Scuffed Journeyman's Rucksack|Primary Anchor Transport Device|\
Fellowship Registration Insignia|Philter of Major Translocation|\
Extraplanar Trade Satchel|Gouda Cheese|Modulation Shard|Philter of the Ant|\
Bottle of Milk|Dire Tuning Crystal)"
####################
#################################################################################################################
# Don't edit below this line unless your customizing this script, which you will be responsible for supporting. #
#################################################################################################################
lootlyData = []
tankInv = []
othersInv = []
weHaveSix = []
# Populate lootlyData list
def listLootly(data):
for obj in data:
obj = obj.strip()
lootlyData.append(obj)
# Lets get data from the Lootly.ini
def getLootlyData():
with open(lootlyPath, 'r') as data:
lines = data.readlines()
listLootly(lines)
# Get the tanks inventory and append to tankInv
def getTankInv():
tankInvFile = eqPath + focusPlayer + f_Inventory
with open(tankInvFile, 'r') as data:
for line in data:
line = line.strip()
m1 = re.search('(Empty)', line)
m2 = re.search(rf"^(.*{ignore}.*)$", line)
m3 = re.search('^(General)\s+(\d+)(-Slot\d+\s+|\s+)(\w+\D\w+\D+)(\d+)\s+(\d+)\s+(\d+)$', line)
if m1:
continue
elif m2:
continue
elif m3:
tankInv.append(f"{m3.group(4)}")
# Inventory all toons except the focusePlayer(Tank) and append to othersInv
def getToonsInvetory():
for name in Goup1:
if name == focusPlayer:
continue
else:
playerInv = eqPath + name + f_Inventory
with open(playerInv, 'r') as data:
for line in data:
m1 = re.search('(Empty)', line)
m2 = re.search(rf"^(.*{ignore}.*)$", line)
m3 = re.search('^(General)\s+(\d+)(-Slot\d+\s+|\s+)(\w+\D\w+\D+)(\d+)\s+(\d+)\s+(\d+)$', line)
if m1:
continue
elif m2:
continue
elif m3:
#print(f"{m3.group(4)}")
othersInv.append(f"{m3.group(4)}")
# Find items that all toons have and append to weHaveSix list
def findSixItems():
count = 0
for tank in tankInv:
count = 1
for other in othersInv:
if tank == other:
count = count+1
if count >= 6:
weHaveSix.append(tank)
# Loop through your results and count your findings of six
def loop(y):
c = 0
for x in y:
c = c+1
z = x.strip()
print(f"{c}: {z}")
# execute your defined functions
getLootlyData()
getTankInv()
getToonsInvetory()
findSixItems()
loop(weHaveSix)
[/CODE]
Example of output from VS Code:
-Taz
I wrote a python script that will show me all the items that all six of my toons have in inventory. This can be used for different things, but I wrote it mainly for collections. Maybe you'll find it useful if you like Python. I know most people have shifted to Lua and this is totally doable in Lua. Like I said already, I've had a few beers and don't know Lua as well as others, so I wrote this in python. Just trying to give back to the community.
Assumptions:
- Your running MacroQuest
- Your running Lootly
- You have added the collections for the zone your in to your Lootly_Loot.ini file, Example:
Code:
Votive Candle=Keep|1 - You have a version of Python 3.x installed
- You need to dump your inventory on all your toons
- Then run this python script (after following the instructions in the script)
- I also utilize VS Code for my scripts
[CODE lang="python" title="RG_weHaveSix.py"]
# Requirements as I run it.... YMMV
# Windows 11
# Python 3.9.13 - you can have lower or higher version of Python 3
# Lootly
#
# Run the following command on your six toon team, depending on which in game broadcast you use
# Dannet: /dgga /outputfile inventory
# or
# EQBC: /bcga /outputfile inventory
import re
####################
# Replace with your path to your Lootly INI file
lootlyPath = 'C:\\Games\\MQ2Next\\config\\Lootly_Loot.ini'
# Replace with your path to Everquest
eqPath = 'C:\\Games\\Everquest\\'
# Replace with your character names in your group
Goup1 = ['Tank', 'DPS1', 'DPS2', 'CC', 'Utility', 'Healer']
# Replace "server" with the server you play on
f_Inventory = '_server-Inventory.txt'
# Replace "Tank" with the name of your main looter
focusPlayer = 'Tank'
# Replace with items that you DON'T want to match on
ignore = "(Tailored Legendary Backpack|Heroic Satchel of the Adventurer|\
Extraplanar Trade Satchel|Scuffed Journeyman's Rucksack|\
Scuffed Journeyman's Rucksack|Primary Anchor Transport Device|\
Fellowship Registration Insignia|Philter of Major Translocation|\
Extraplanar Trade Satchel|Gouda Cheese|Modulation Shard|Philter of the Ant|\
Bottle of Milk|Dire Tuning Crystal)"
####################
#################################################################################################################
# Don't edit below this line unless your customizing this script, which you will be responsible for supporting. #
#################################################################################################################
lootlyData = []
tankInv = []
othersInv = []
weHaveSix = []
# Populate lootlyData list
def listLootly(data):
for obj in data:
obj = obj.strip()
lootlyData.append(obj)
# Lets get data from the Lootly.ini
def getLootlyData():
with open(lootlyPath, 'r') as data:
lines = data.readlines()
listLootly(lines)
# Get the tanks inventory and append to tankInv
def getTankInv():
tankInvFile = eqPath + focusPlayer + f_Inventory
with open(tankInvFile, 'r') as data:
for line in data:
line = line.strip()
m1 = re.search('(Empty)', line)
m2 = re.search(rf"^(.*{ignore}.*)$", line)
m3 = re.search('^(General)\s+(\d+)(-Slot\d+\s+|\s+)(\w+\D\w+\D+)(\d+)\s+(\d+)\s+(\d+)$', line)
if m1:
continue
elif m2:
continue
elif m3:
tankInv.append(f"{m3.group(4)}")
# Inventory all toons except the focusePlayer(Tank) and append to othersInv
def getToonsInvetory():
for name in Goup1:
if name == focusPlayer:
continue
else:
playerInv = eqPath + name + f_Inventory
with open(playerInv, 'r') as data:
for line in data:
m1 = re.search('(Empty)', line)
m2 = re.search(rf"^(.*{ignore}.*)$", line)
m3 = re.search('^(General)\s+(\d+)(-Slot\d+\s+|\s+)(\w+\D\w+\D+)(\d+)\s+(\d+)\s+(\d+)$', line)
if m1:
continue
elif m2:
continue
elif m3:
#print(f"{m3.group(4)}")
othersInv.append(f"{m3.group(4)}")
# Find items that all toons have and append to weHaveSix list
def findSixItems():
count = 0
for tank in tankInv:
count = 1
for other in othersInv:
if tank == other:
count = count+1
if count >= 6:
weHaveSix.append(tank)
# Loop through your results and count your findings of six
def loop(y):
c = 0
for x in y:
c = c+1
z = x.strip()
print(f"{c}: {z}")
# execute your defined functions
getLootlyData()
getTankInv()
getToonsInvetory()
findSixItems()
loop(weHaveSix)
[/CODE]
Example of output from VS Code:
Code:
PS Z:\Scripts> & C:/Users/Taz/AppData/Local/Microsoft/WindowsApps/python3.9.exe z:/Scripts/Python/Everquest/RG_weHaveSix.py
1: Votive Candle
2: Candelabra
3: Golden Censer
4: Medallion of the Dragon
5: Writ of the Scale
6: Vestment of the Dragon
7: Blood Chalice
8: Kneeling Pad
9: Piece of a Medallion
PS Z:\Scripts>
-Taz
Last edited:


