just use an inmem db
This commit is contained in:
parent
31f70609e7
commit
d8dee4bede
@ -1,198 +1,184 @@
|
|||||||
#!/usr/bin/env python3
|
#!/usr/bin/env python3
|
||||||
|
|
||||||
|
import sqlite3
|
||||||
|
|
||||||
episodes = ['ep1', 'ep2', 'ep4']
|
episodes = ['ep1', 'ep2', 'ep4']
|
||||||
difficulties = ['normal', 'hard', 'veryhard', 'ultimate']
|
difficulties = ['normal', 'hard', 'veryhard', 'ultimate']
|
||||||
sectionids = ['viridia', 'greenill', 'skyly', 'bluefull', 'purplenum', 'pinkal', 'redria', 'oran', 'yellowboze', 'whitill']
|
sectionids = ['viridia', 'greenill', 'skyly', 'bluefull', 'purplenum', 'pinkal', 'redria', 'oran', 'yellowboze', 'whitill']
|
||||||
|
|
||||||
with open('drops','r') as infile:
|
with open('drops','r') as infile:
|
||||||
drops = infile.readlines()
|
drops = infile.readlines()
|
||||||
|
drops = [drop.strip() for drop in drops]
|
||||||
|
|
||||||
ep1drops = list(filter(lambda d: d.split(',')[0] == 'ep1', drops))
|
ep1monsters = [
|
||||||
ep2drops = list(filter(lambda d: d.split(',')[0] == 'ep2', drops))
|
'AlRappy',
|
||||||
ep4drops = list(filter(lambda d: d.split(',')[0] == 'ep4', drops))
|
'BarbarousWolf',
|
||||||
|
'Booma',
|
||||||
|
'Bulclaw',
|
||||||
|
'Canadine',
|
||||||
|
'Canane',
|
||||||
|
'ChaosBringer',
|
||||||
|
'ChaosSorcerer',
|
||||||
|
'Claw',
|
||||||
|
'DarkBelra',
|
||||||
|
'DarkGunner',
|
||||||
|
'Delsaber',
|
||||||
|
'Dimenian',
|
||||||
|
'Dubchic',
|
||||||
|
'EvilShark',
|
||||||
|
'Garanz',
|
||||||
|
'Gigobooma',
|
||||||
|
'Gillchic',
|
||||||
|
'Gobooma',
|
||||||
|
'GrassAssassin',
|
||||||
|
'GuilShark',
|
||||||
|
'Hidoom',
|
||||||
|
'Hildebear',
|
||||||
|
'Hildeblue',
|
||||||
|
'LaDimenian',
|
||||||
|
'Migium',
|
||||||
|
'Mothmant',
|
||||||
|
'NanoDragon',
|
||||||
|
'NarLily',
|
||||||
|
'PalShark',
|
||||||
|
'PanArms',
|
||||||
|
'PofuillySlime',
|
||||||
|
'PoisonLily',
|
||||||
|
'PouillySlime',
|
||||||
|
'RagRappy',
|
||||||
|
'SavageWolf',
|
||||||
|
'SinowBeat',
|
||||||
|
'SinowGold',
|
||||||
|
'SoDimenian',
|
||||||
|
'Dragon',
|
||||||
|
'DeRolLe',
|
||||||
|
'VolOpt',
|
||||||
|
'DarkFalz']
|
||||||
|
|
||||||
ep1monsters = list(set(line.split(',')[3] for line in ep1drops))
|
ep2monsters = [
|
||||||
ep2monsters = list(set(line.split(',')[3] for line in ep2drops))
|
'BarbarousWolf',
|
||||||
ep4monsters = list(set(line.split(',')[3] for line in ep4drops))
|
'ChaosSorcerer',
|
||||||
|
'DarkBelra',
|
||||||
|
'Delbiter',
|
||||||
|
'Deldepth',
|
||||||
|
'DelLily',
|
||||||
|
'Delsaber',
|
||||||
|
'Dimenian',
|
||||||
|
'Dolmdarl',
|
||||||
|
'Dolmolm',
|
||||||
|
'Dubchic',
|
||||||
|
'EasterRappy',
|
||||||
|
'Epsilon',
|
||||||
|
'Garanz',
|
||||||
|
'Gee',
|
||||||
|
'Gibbles',
|
||||||
|
'GiGue',
|
||||||
|
'Gillchic',
|
||||||
|
'GrassAssassin',
|
||||||
|
'HalloRappy',
|
||||||
|
'Hidoom',
|
||||||
|
'Hildebear',
|
||||||
|
'Hildeblue',
|
||||||
|
'IllGill',
|
||||||
|
'LaDimenian',
|
||||||
|
'LoveRappy',
|
||||||
|
'Mericarol',
|
||||||
|
'Mericus',
|
||||||
|
'Merikle',
|
||||||
|
'Merillia',
|
||||||
|
'Meriltas',
|
||||||
|
'Migium',
|
||||||
|
'Morfos',
|
||||||
|
'Mothmant',
|
||||||
|
'NarLily',
|
||||||
|
'PanArms',
|
||||||
|
'PoisonLily',
|
||||||
|
'RagRappy',
|
||||||
|
'Recon',
|
||||||
|
'SavageWolf',
|
||||||
|
'SinowBerill',
|
||||||
|
'SinowSpigell',
|
||||||
|
'SinowZele',
|
||||||
|
'SinowZoa',
|
||||||
|
'SoDimenian',
|
||||||
|
'StRappy',
|
||||||
|
'UlGibbon',
|
||||||
|
'ZolGibbon',
|
||||||
|
'BarbaRay',
|
||||||
|
'GolDragon',
|
||||||
|
'GalGryphon',
|
||||||
|
'OlgaFlow']
|
||||||
|
|
||||||
ep1monsters.sort()
|
ep4monsters = [
|
||||||
ep2monsters.sort()
|
'Astark',
|
||||||
ep4monsters.sort()
|
'BaBoota',
|
||||||
|
'Boota',
|
||||||
|
'DelRappyCrater',
|
||||||
|
'DelRappyDesert',
|
||||||
|
'Dorphon',
|
||||||
|
'DorphonEclair',
|
||||||
|
'Girtablulu',
|
||||||
|
'Goran',
|
||||||
|
'GoranDetonator',
|
||||||
|
'MerissaA',
|
||||||
|
'MerissaAA',
|
||||||
|
'PazuzuCrater',
|
||||||
|
'PazuzuDesert',
|
||||||
|
'PyroGoran',
|
||||||
|
'SandRappyCrater',
|
||||||
|
'SandRappyDesert',
|
||||||
|
'SatelliteLizardCrater',
|
||||||
|
'SatelliteLizardDesert',
|
||||||
|
'YowieCrater',
|
||||||
|
'YowieDesert',
|
||||||
|
'ZeBoota',
|
||||||
|
'ZuCrater',
|
||||||
|
'ZuDesert',
|
||||||
|
'SaintMillion',
|
||||||
|
'Shambertin',
|
||||||
|
'Kondrieu']
|
||||||
|
|
||||||
ep1normal = list(filter(lambda d: d.split(',')[1] == 'normal', ep1drops))
|
|
||||||
ep1hard = list(filter(lambda d: d.split(',')[1] == 'hard', ep1drops))
|
|
||||||
ep1veryhard = list(filter(lambda d: d.split(',')[1] == 'veryhard', ep1drops))
|
|
||||||
ep1ultimate = list(filter(lambda d: d.split(',')[1] == 'ultimate', ep1drops))
|
|
||||||
|
|
||||||
print('ep1 normal drops')
|
epmonsters = {
|
||||||
for monster in ep1monsters:
|
'ep1': ep1monsters,
|
||||||
monster_drops = list(filter(lambda d: d.split(',')[3] == monster, ep1normal)) # all drops for specific monster (list of strings)
|
'ep2': ep2monsters,
|
||||||
print('{},'.format(monster), sep='', end='')
|
'ep4': ep4monsters
|
||||||
for sectionid in sectionids:
|
}
|
||||||
for md in monster_drops:
|
|
||||||
if sectionid in md:
|
conn = sqlite3.connect('elsewaredrops.db')
|
||||||
print('{}'.format(md.split(',')[4]),sep='', end='')
|
#conn = sqlite3.connect('memory:')
|
||||||
print(',', sep='', end='')
|
curs = conn.cursor()
|
||||||
print()
|
|
||||||
|
def create_table():
|
||||||
print('\n\n')
|
curs.execute('CREATE TABLE IF NOT EXISTS drops (episode TEXT, difficulty TEXT, sectionid TEXT, monster TEXT, item TEXT, rate REAL)')
|
||||||
|
#conn.commit()
|
||||||
print('ep1 hard drops')
|
curs.execute("SELECT COUNT(*) FROM drops")
|
||||||
for monster in ep1monsters:
|
result = curs.fetchall()
|
||||||
monster_drops = list(filter(lambda d: d.split(',')[3] == monster, ep1hard)) # all drops for specific monster (list of strings)
|
if result[0][0] == 0:
|
||||||
print('{},'.format(monster), sep='', end='')
|
for drop in drops:
|
||||||
for sectionid in sectionids:
|
line = drop.strip().split(',')
|
||||||
for md in monster_drops:
|
curs.execute("INSERT INTO drops (episode, difficulty, sectionid, monster, item, rate) VALUES (?, ?, ?, ?, ?, ?)", (line[0], line[1], line[2], line[3], line[4], line[5]))
|
||||||
if sectionid in md:
|
else:
|
||||||
print('{}'.format(md.split(',')[4]),sep='', end='')
|
print("already data in the db")
|
||||||
print(',', sep='', end='')
|
conn.commit()
|
||||||
print()
|
|
||||||
|
print('elseware drops')
|
||||||
print('\n\n')
|
for episode in episodes:
|
||||||
|
for difficulty in difficulties:
|
||||||
print('ep1 veryhard drops')
|
print('{} {}'.format(episode, difficulty))
|
||||||
for monster in ep1monsters:
|
print('enemy', sep='', end='')
|
||||||
monster_drops = list(filter(lambda d: d.split(',')[3] == monster, ep1veryhard)) # all drops for specific monster (list of strings)
|
for sectionid in sectionids:
|
||||||
print('{},'.format(monster), sep='', end='')
|
print(',{}'.format(sectionid), sep='', end='')
|
||||||
for sectionid in sectionids:
|
print()
|
||||||
for md in monster_drops:
|
for monster in epmonsters[episode]:
|
||||||
if sectionid in md:
|
print('{}'.format(monster), sep='', end='')
|
||||||
print('{}'.format(md.split(',')[4]),sep='', end='')
|
curs.execute("SELECT item FROM drops WHERE episode = '{}' AND difficulty = '{}' AND monster = '{}'".format(episode, difficulty, monster))
|
||||||
print(',', sep='', end='')
|
rows = curs.fetchall()
|
||||||
print()
|
for row in rows:
|
||||||
|
print(',{}'.format(row[0]), sep='', end='')
|
||||||
print('\n\n')
|
print()
|
||||||
|
print()
|
||||||
print('ep1 ultimate drops')
|
|
||||||
for monster in ep1monsters:
|
|
||||||
monster_drops = list(filter(lambda d: d.split(',')[3] == monster, ep1ultimate)) # all drops for specific monster (list of strings)
|
|
||||||
print('{},'.format(monster), sep='', end='')
|
|
||||||
for sectionid in sectionids:
|
|
||||||
for md in monster_drops:
|
|
||||||
if sectionid in md:
|
|
||||||
print('{}'.format(md.split(',')[4]),sep='', end='')
|
|
||||||
print(',', sep='', end='')
|
|
||||||
print()
|
|
||||||
|
|
||||||
print('\n\n')
|
|
||||||
|
|
||||||
print('\n\n\n\n\n\n')
|
|
||||||
|
|
||||||
|
|
||||||
# print drops per difficulty
|
|
||||||
ep2normal = list(filter(lambda d: d.split(',')[1] == 'normal', ep2drops))
|
|
||||||
ep2hard = list(filter(lambda d: d.split(',')[1] == 'hard', ep2drops))
|
|
||||||
ep2veryhard = list(filter(lambda d: d.split(',')[1] == 'veryhard', ep2drops))
|
|
||||||
ep2ultimate = list(filter(lambda d: d.split(',')[1] == 'ultimate', ep2drops))
|
|
||||||
|
|
||||||
print('ep2 normal drops')
|
|
||||||
for monster in ep2monsters:
|
|
||||||
monster_drops = list(filter(lambda d: d.split(',')[3] == monster, ep2normal)) # all drops for specific monster (list of strings)
|
|
||||||
print('{},'.format(monster), sep='', end='')
|
|
||||||
for sectionid in sectionids:
|
|
||||||
for md in monster_drops:
|
|
||||||
if sectionid in md:
|
|
||||||
print('{}'.format(md.split(',')[4]),sep='', end='')
|
|
||||||
print(',', sep='', end='')
|
|
||||||
print()
|
|
||||||
|
|
||||||
print('\n\n')
|
|
||||||
|
|
||||||
print('ep2 hard drops')
|
|
||||||
for monster in ep2monsters:
|
|
||||||
monster_drops = list(filter(lambda d: d.split(',')[3] == monster, ep2hard)) # all drops for specific monster (list of strings)
|
|
||||||
print('{},'.format(monster), sep='', end='')
|
|
||||||
for sectionid in sectionids:
|
|
||||||
for md in monster_drops:
|
|
||||||
if sectionid in md:
|
|
||||||
print('{}'.format(md.split(',')[4]),sep='', end='')
|
|
||||||
print(',', sep='', end='')
|
|
||||||
print()
|
|
||||||
|
|
||||||
print('\n\n')
|
|
||||||
|
|
||||||
print('ep2 veryhard drops')
|
|
||||||
for monster in ep2monsters:
|
|
||||||
monster_drops = list(filter(lambda d: d.split(',')[3] == monster, ep2veryhard)) # all drops for specific monster (list of strings)
|
|
||||||
print('{},'.format(monster), sep='', end='')
|
|
||||||
for sectionid in sectionids:
|
|
||||||
for md in monster_drops:
|
|
||||||
if sectionid in md:
|
|
||||||
print('{}'.format(md.split(',')[4]),sep='', end='')
|
|
||||||
print(',', sep='', end='')
|
|
||||||
print()
|
|
||||||
|
|
||||||
print('\n\n')
|
|
||||||
|
|
||||||
print('ep2 ultimate drops')
|
|
||||||
for monster in ep2monsters:
|
|
||||||
monster_drops = list(filter(lambda d: d.split(',')[3] == monster, ep2ultimate)) # all drops for specific monster (list of strings)
|
|
||||||
print('{},'.format(monster), sep='', end='')
|
|
||||||
for sectionid in sectionids:
|
|
||||||
for md in monster_drops:
|
|
||||||
if sectionid in md:
|
|
||||||
print('{}'.format(md.split(',')[4]),sep='', end='')
|
|
||||||
print(',', sep='', end='')
|
|
||||||
print()
|
|
||||||
|
|
||||||
print('\n\n')
|
|
||||||
|
|
||||||
print('\n\n\n\n\n\n')
|
|
||||||
|
|
||||||
|
|
||||||
# print drops per difficulty
|
|
||||||
ep4normal = list(filter(lambda d: d.split(',')[1] == 'normal', ep4drops))
|
|
||||||
ep4hard = list(filter(lambda d: d.split(',')[1] == 'hard', ep4drops))
|
|
||||||
ep4veryhard = list(filter(lambda d: d.split(',')[1] == 'veryhard', ep4drops))
|
|
||||||
ep4ultimate = list(filter(lambda d: d.split(',')[1] == 'ultimate', ep4drops))
|
|
||||||
|
|
||||||
print('ep4 normal drops')
|
|
||||||
for monster in ep4monsters:
|
|
||||||
monster_drops = list(filter(lambda d: d.split(',')[3] == monster, ep4normal)) # all drops for specific monster (list of strings)
|
|
||||||
print('{},'.format(monster), sep='', end='')
|
|
||||||
for sectionid in sectionids:
|
|
||||||
for md in monster_drops:
|
|
||||||
if sectionid in md:
|
|
||||||
print('{}'.format(md.split(',')[4]),sep='', end='')
|
|
||||||
print(',', sep='', end='')
|
|
||||||
print()
|
|
||||||
|
|
||||||
print('\n\n')
|
|
||||||
|
|
||||||
print('ep4 hard drops')
|
|
||||||
for monster in ep4monsters:
|
|
||||||
monster_drops = list(filter(lambda d: d.split(',')[3] == monster, ep4hard)) # all drops for specific monster (list of strings)
|
|
||||||
print('{},'.format(monster), sep='', end='')
|
|
||||||
for sectionid in sectionids:
|
|
||||||
for md in monster_drops:
|
|
||||||
if sectionid in md:
|
|
||||||
print('{}'.format(md.split(',')[4]),sep='', end='')
|
|
||||||
print(',', sep='', end='')
|
|
||||||
print()
|
|
||||||
|
|
||||||
print('\n\n')
|
|
||||||
|
|
||||||
print('ep4 veryhard drops')
|
|
||||||
for monster in ep4monsters:
|
|
||||||
monster_drops = list(filter(lambda d: d.split(',')[3] == monster, ep4veryhard)) # all drops for specific monster (list of strings)
|
|
||||||
print('{},'.format(monster), sep='', end='')
|
|
||||||
for sectionid in sectionids:
|
|
||||||
for md in monster_drops:
|
|
||||||
if sectionid in md:
|
|
||||||
print('{}'.format(md.split(',')[4]),sep='', end='')
|
|
||||||
print(',', sep='', end='')
|
|
||||||
print()
|
|
||||||
|
|
||||||
print('\n\n')
|
|
||||||
|
|
||||||
print('ep4 ultimate drops')
|
|
||||||
for monster in ep4monsters:
|
|
||||||
monster_drops = list(filter(lambda d: d.split(',')[3] == monster, ep4ultimate)) # all drops for specific monster (list of strings)
|
|
||||||
print('{},'.format(monster), sep='', end='')
|
|
||||||
for sectionid in sectionids:
|
|
||||||
for md in monster_drops:
|
|
||||||
if sectionid in md:
|
|
||||||
print('{}'.format(md.split(',')[4]),sep='', end='')
|
|
||||||
print(',', sep='', end='')
|
|
||||||
print()
|
print()
|
||||||
|
|
||||||
|
curs.close()
|
||||||
|
conn.close()
|
||||||
|
Loading…
x
Reference in New Issue
Block a user