You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

184 lines
3.4 KiB

  1. #!/usr/bin/env python3
  2. import sqlite3
  3. episodes = ['ep1', 'ep2', 'ep4']
  4. difficulties = ['normal', 'hard', 'veryhard', 'ultimate']
  5. sectionids = ['viridia', 'greenill', 'skyly', 'bluefull', 'purplenum', 'pinkal', 'redria', 'oran', 'yellowboze', 'whitill']
  6. with open('drops','r') as infile:
  7. drops = infile.readlines()
  8. drops = [drop.strip() for drop in drops]
  9. ep1monsters = [
  10. 'AlRappy',
  11. 'BarbarousWolf',
  12. 'Booma',
  13. 'Bulclaw',
  14. 'Canadine',
  15. 'Canane',
  16. 'ChaosBringer',
  17. 'ChaosSorcerer',
  18. 'Claw',
  19. 'DarkBelra',
  20. 'DarkGunner',
  21. 'Delsaber',
  22. 'Dimenian',
  23. 'Dubchic',
  24. 'EvilShark',
  25. 'Garanz',
  26. 'Gigobooma',
  27. 'Gillchic',
  28. 'Gobooma',
  29. 'GrassAssassin',
  30. 'GuilShark',
  31. 'Hidoom',
  32. 'Hildebear',
  33. 'Hildeblue',
  34. 'LaDimenian',
  35. 'Migium',
  36. 'Mothmant',
  37. 'NanoDragon',
  38. 'NarLily',
  39. 'PalShark',
  40. 'PanArms',
  41. 'PofuillySlime',
  42. 'PoisonLily',
  43. 'PouillySlime',
  44. 'RagRappy',
  45. 'SavageWolf',
  46. 'SinowBeat',
  47. 'SinowGold',
  48. 'SoDimenian',
  49. 'Dragon',
  50. 'DeRolLe',
  51. 'VolOpt',
  52. 'DarkFalz']
  53. ep2monsters = [
  54. 'BarbarousWolf',
  55. 'ChaosSorcerer',
  56. 'DarkBelra',
  57. 'Delbiter',
  58. 'Deldepth',
  59. 'DelLily',
  60. 'Delsaber',
  61. 'Dimenian',
  62. 'Dolmdarl',
  63. 'Dolmolm',
  64. 'Dubchic',
  65. 'EasterRappy',
  66. 'Epsilon',
  67. 'Garanz',
  68. 'Gee',
  69. 'Gibbles',
  70. 'GiGue',
  71. 'Gillchic',
  72. 'GrassAssassin',
  73. 'HalloRappy',
  74. 'Hidoom',
  75. 'Hildebear',
  76. 'Hildeblue',
  77. 'IllGill',
  78. 'LaDimenian',
  79. 'LoveRappy',
  80. 'Mericarol',
  81. 'Mericus',
  82. 'Merikle',
  83. 'Merillia',
  84. 'Meriltas',
  85. 'Migium',
  86. 'Morfos',
  87. 'Mothmant',
  88. 'NarLily',
  89. 'PanArms',
  90. 'PoisonLily',
  91. 'RagRappy',
  92. 'Recon',
  93. 'SavageWolf',
  94. 'SinowBerill',
  95. 'SinowSpigell',
  96. 'SinowZele',
  97. 'SinowZoa',
  98. 'SoDimenian',
  99. 'StRappy',
  100. 'UlGibbon',
  101. 'ZolGibbon',
  102. 'BarbaRay',
  103. 'GolDragon',
  104. 'GalGryphon',
  105. 'OlgaFlow']
  106. ep4monsters = [
  107. 'Astark',
  108. 'BaBoota',
  109. 'Boota',
  110. 'DelRappyCrater',
  111. 'DelRappyDesert',
  112. 'Dorphon',
  113. 'DorphonEclair',
  114. 'Girtablulu',
  115. 'Goran',
  116. 'GoranDetonator',
  117. 'MerissaA',
  118. 'MerissaAA',
  119. 'PazuzuCrater',
  120. 'PazuzuDesert',
  121. 'PyroGoran',
  122. 'SandRappyCrater',
  123. 'SandRappyDesert',
  124. 'SatelliteLizardCrater',
  125. 'SatelliteLizardDesert',
  126. 'YowieCrater',
  127. 'YowieDesert',
  128. 'ZeBoota',
  129. 'ZuCrater',
  130. 'ZuDesert',
  131. 'SaintMillion',
  132. 'Shambertin',
  133. 'Kondrieu']
  134. epmonsters = {
  135. 'ep1': ep1monsters,
  136. 'ep2': ep2monsters,
  137. 'ep4': ep4monsters
  138. }
  139. conn = sqlite3.connect('elsewaredrops.db')
  140. #conn = sqlite3.connect('memory:')
  141. curs = conn.cursor()
  142. def create_table():
  143. curs.execute('CREATE TABLE IF NOT EXISTS drops (episode TEXT, difficulty TEXT, sectionid TEXT, monster TEXT, item TEXT, rate REAL)')
  144. #conn.commit()
  145. curs.execute("SELECT COUNT(*) FROM drops")
  146. result = curs.fetchall()
  147. if result[0][0] == 0:
  148. for drop in drops:
  149. line = drop.strip().split(',')
  150. curs.execute("INSERT INTO drops (episode, difficulty, sectionid, monster, item, rate) VALUES (?, ?, ?, ?, ?, ?)", (line[0], line[1], line[2], line[3], line[4], line[5]))
  151. else:
  152. print("already data in the db")
  153. conn.commit()
  154. print('elseware drops')
  155. for episode in episodes:
  156. for difficulty in difficulties:
  157. print('{} {}'.format(episode, difficulty))
  158. print('enemy', sep='', end='')
  159. for sectionid in sectionids:
  160. print(',{}'.format(sectionid), sep='', end='')
  161. print()
  162. for monster in epmonsters[episode]:
  163. print('{}'.format(monster), sep='', end='')
  164. curs.execute("SELECT item FROM drops WHERE episode = '{}' AND difficulty = '{}' AND monster = '{}'".format(episode, difficulty, monster))
  165. rows = curs.fetchall()
  166. for row in rows:
  167. print(',{}'.format(row[0]), sep='', end='')
  168. print()
  169. print()
  170. print()
  171. curs.close()
  172. conn.close()