This week only. Pastebin PRO Accounts Christmas Special! Don't miss out!Want more features on Pastebin? Sign Up, it's FREE!
Guest

Warframe Tier 3 Defense Rewards Python Program

By: Hassohappa on Jun 11th, 2013  |  syntax: None  |  size: 10.52 KB  |  views: 569  |  expires: Never
download  |  raw  |  embed  |  report abuse  |  print
Text below is selected. Please press Ctrl+C to copy to your clipboard. (⌘+C on Mac)
  1. # -*- coding: utf-8 -*-
  2. """
  3. Created on Sun Jun 09 21:54:14 2013
  4.  
  5. @author: Andrew Tharp
  6. """
  7.  
  8. import wx
  9.  
  10. class WarframeDefenseDrops(wx.Frame):
  11.  
  12.     def __init__(self, parent, id):
  13.         wx.Frame.__init__(self, parent)
  14.  
  15.         raceBox = wx.SingleChoiceDialog(None, 'What race are you fighting?', 'Select Race', ['Corpus', 'Grineer', 'Infested'])
  16.         if raceBox.ShowModal() == wx.ID_OK:
  17.             race = raceBox.GetStringSelection()
  18.         else:
  19.             return(None)
  20.  
  21.         if race == 'Corpus':
  22.             waveFiveBox = wx.SingleChoiceDialog(None, 'What mod dropped in wave 5?', 'Select Mod', ['Convulsion', 'Shocking Touch', 'Stormbringer', 'Split Chamber', 'Stretch', 'Continuity', 'Banshee Chassis Blueprint', 'Tower 3 Exterminate', 'Master Thief', 'Tower 2 Exterminate', 'Tower 2 Raid', 'Uncommon Fusion Core', 'Rare Fusion Core'])
  23.             if waveFiveBox.ShowModal() == wx.ID_OK:
  24.                 firstWaveDrop = waveFiveBox.GetStringSelection()
  25.             else:
  26.                 return(None)
  27.  
  28.             waveTenBox = wx.SingleChoiceDialog(None, 'What mod dropped in wave 10?', 'Select Mod', ['Convulsion', 'Shocking Touch', 'Stormbringer', 'Split Chamber', 'Stretch', 'Continuity', 'Banshee Chassis Blueprint', 'Tower 3 Exterminate', 'Master Thief', 'Tower 2 Exterminate', 'Tower 2 Raid', 'Uncommon Fusion Core', 'Rare Fusion Core'])
  29.             if waveTenBox.ShowModal() == wx.ID_OK:
  30.                 secondWaveDrop = waveTenBox.GetStringSelection()
  31.             else:
  32.                 return(None)
  33.                
  34.             drops = ['Convulsion', 0.0, .1518,
  35.                 'Shocking Touch', .1518, .3035,
  36.                 'Stormbringer', .3035, .3351,
  37.                 'Split Chamber', .3351, .3667,
  38.                 'Stretch', .3667, .3983,
  39.                 'Continuity', .3983, .4299,
  40.                 'Banshee Chassis Blueprint', .4299, .4615,
  41.                 'Tower 3 Exterminate', .4615, .4930,
  42.                 'Master Thief', .4930, .5131,
  43.                 'Tower 2 Exterminate', .5131, .6649,
  44.                 'Tower 2 Raid', .6649, .8167,
  45.                 'Uncommon Fusion Core', .8167, .9684,
  46.                 'Rare Fusion Core', .9684, 1]
  47.  
  48.         elif race == 'Grineer':
  49.             waveFiveBox = wx.SingleChoiceDialog(None, 'What mod dropped in wave 5?', 'Select Mod', ['Deep Freeze', 'North Wind', 'Cryo Rounds', 'Hells Chamber', 'Stretch', 'Streamline', 'Banshee Systems Blueprint', 'Tower 3 Exterminate', 'Handspring', 'Tower 2 Exterminate', 'Tower 2 Raid', 'Uncommon Fusion Core', 'Rare Fusion Core'])
  50.             if waveFiveBox.ShowModal() == wx.ID_OK:
  51.                 firstWaveDrop = waveFiveBox.GetStringSelection()
  52.             else:
  53.                 return(None)
  54.                
  55.             waveTenBox = wx.SingleChoiceDialog(None, 'What mod dropped in wave 10?', 'Select Mod', ['Deep Freeze', 'North Wind', 'Cryo Rounds', 'Hells Chamber', 'Stretch', 'Streamline', 'Banshee Systems Blueprint', 'Tower 3 Exterminate', 'Handspring', 'Tower 2 Exterminate', 'Tower 2 Raid', 'Uncommon Fusion Core', 'Rare Fusion Core'])
  56.             if waveTenBox.ShowModal() == wx.ID_OK:
  57.                 secondWaveDrop = waveTenBox.GetStringSelection()
  58.             else:
  59.                 return(None)
  60.                                
  61.             drops = ['Deep Freeze', 0.0, .1518,
  62.                 'North Wind', .1518, .3035,
  63.                 'Cryo Rounds', .3035, .3351,
  64.                 'Hells Chamber', .3351, .3667,
  65.                 'Stretch', .3667, .3983,
  66.                 'Streamline', .3983, .4299,
  67.                 'Banshee Systems Blueprint', .4299, .4615,
  68.                 'Tower 3 Exterminate', .4615, .4930,
  69.                 'Handspring', .4930, .5131,
  70.                 'Tower 2 Exterminate', .5131, .6649,
  71.                 'Tower 2 Raid', .6649, .8167,
  72.                 'Uncommon Fusion Core', .8167, .9684,
  73.                 'Rare Fusion Core', .9684, 1]
  74.  
  75.         else:
  76.             waveFiveBox = wx.SingleChoiceDialog(None, 'What mod dropped in wave 5?', 'Select Mod', ['Hellfire', 'Heated Charge', 'Molten Impact', 'Barrel Diffusion', 'Streamline', 'Focus', 'Banshee Helmet Blueprint', 'Tower 3 Exterminate', 'Thunderbolt', 'Uncommon Fusion Core', 'Rare Fusion Core', 'Tower 2 Exterminate', 'Tower 2 Raid'])
  77.             if waveFiveBox.ShowModal() == wx.ID_OK:
  78.                 firstWaveDrop = waveFiveBox.GetStringSelection()
  79.             else:
  80.                 return(None)
  81.                
  82.             waveTenBox = wx.SingleChoiceDialog(None, 'What mod dropped in wave 10?', 'Select Mod', ['Hellfire', 'Heated Charge', 'Molten Impact', 'Barrel Diffusion', 'Streamline', 'Focus', 'Banshee Helmet Blueprint', 'Tower 3 Exterminate', 'Thunderbolt', 'Uncommon Fusion Core', 'Rare Fusion Core', 'Tower 2 Exterminate', 'Tower 2 Raid'])
  83.             if waveTenBox.ShowModal() == wx.ID_OK:
  84.                 secondWaveDrop = waveTenBox.GetStringSelection()
  85.             else:
  86.                 return(None)
  87.                            
  88.             drops = ['Hellfire', 0.0, .1518,
  89.                 'Heated Charge', .1518, .3035,
  90.                 'Molten Impact', .3035, .3351,
  91.                 'Barrel Diffusion', .3351, .3667,
  92.                 'Streamline', .3667, .3983,
  93.                 'Focus', .3983, .4299,
  94.                 'Banshee Helmet Blueprint', .4299, .4615,
  95.                 'Tower 3 Exterminate', .4615, .4930,
  96.                 'Thunderbolt', .4930, .5131,
  97.                 'Uncommon Fusion Core', .5131, .6649,
  98.                 'Rare Fusion Core', .6649, .6965,
  99.                 'Tower 2 Exterminate', .6965, .8482,
  100.                 'Tower 2 Raid', .8482, 1.0]
  101.  
  102.         predictedDrops = DropPredictor(firstWaveDrop, secondWaveDrop, drops)
  103.        
  104.         fiveWaveOutBox = wx.SingleChoiceDialog(None, 'The following mods can drop in five waves', 'Drops For Five Waves Out', predictedDrops.getWaveFiveDrops(), style = wx.OK)
  105.         fiveWaveOutBox.ShowModal()
  106.        
  107.         tenWaveOutBox = wx.SingleChoiceDialog(None, 'The following mods can drop in ten waves', 'Drops For Ten Waves Out', predictedDrops.getWaveTenDrops(), style = wx.OK)
  108.         tenWaveOutBox.ShowModal()
  109.  
  110.         proceedBox = wx.MessageDialog(None, 'Do you want to continue?', 'Continue?', wx.YES_NO)
  111.         proceed = proceedBox.ShowModal()
  112.  
  113.         while proceed == wx.ID_YES:
  114.             firstWaveDrop = secondWaveDrop
  115.            
  116.             waveBox = wx.SingleChoiceDialog(None, 'What mod dropped?', 'Select Mod', predictedDrops.getWaveFiveDrops())
  117.             if waveBox.ShowModal() == wx.ID_OK:
  118.                 secondWaveDrop = waveBox.GetStringSelection()
  119.             else:
  120.                 return(None)
  121.  
  122.             predictedDrops = DropPredictor(firstWaveDrop, secondWaveDrop, drops, lowerIncrement = predictedDrops.getLowerIncrement(), upperIncrement = predictedDrops.getUpperIncrement())
  123.                        
  124.             fiveWaveOutBox = wx.SingleChoiceDialog(None, 'The following mods can drop in five waves', 'Drops For Five Waves Out', predictedDrops.getWaveFiveDrops(), style = wx.OK)
  125.             fiveWaveOutBox.ShowModal()
  126.  
  127.             tenWaveOutBox = wx.SingleChoiceDialog(None, 'The following mods can drop in ten waves', 'Drops For Ten Waves Out', predictedDrops.getWaveTenDrops(), style = wx.OK)
  128.             tenWaveOutBox.ShowModal()
  129.  
  130.             proceedBox = wx.MessageDialog(None, 'Do you want to continue?', 'Continue?', wx.YES_NO)
  131.             proceed = proceedBox.ShowModal()
  132.  
  133.  
  134. class DropPredictor:
  135.    
  136.     def __init__(self, firstDrop, secondDrop, dropList, lowerIncrement=0, upperIncrement=1):
  137.         self.lowerIncrement = lowerIncrement
  138.         self.upperIncrement = upperIncrement
  139.         self.potentialDrops = []
  140.         self.nextPotentialDrops = []
  141.        
  142.         i = dropList.index(firstDrop)
  143.         j = dropList.index(secondDrop)
  144.    
  145.         firstLowerSeed = dropList[i+1]
  146.         firstUpperSeed = dropList[i+2]
  147.        
  148.         secondLowerSeed = dropList[j+1]
  149.         secondUpperSeed = dropList[j+2]
  150.        
  151.         if secondUpperSeed > firstLowerSeed:  #finds the lower and upper bounds for the first increment
  152.             if secondLowerSeed - firstUpperSeed > 0:
  153.                 newLowerIncrement = secondLowerSeed - firstUpperSeed
  154.             else:
  155.                 newLowerIncrement = secondLowerSeed - firstUpperSeed
  156.             newUpperIncrement = secondUpperSeed - firstLowerSeed
  157.         else:
  158.             newLowerIncrement = 1 - firstUpperSeed + secondLowerSeed
  159.             newUpperIncrement = 1 - firstLowerSeed + secondUpperSeed
  160.        
  161.         if self.lowerIncrement < newLowerIncrement and newLowerIncrement >= 0:
  162.             self.lowerIncrement = newLowerIncrement
  163.         elif newLowerIncrement < 0 and self.upperIncrement == 1:
  164.             self.lowerIncrement = newLowerIncrement
  165.         if self.upperIncrement > newUpperIncrement:
  166.             self.upperIncrement = newUpperIncrement
  167.         if self.upperIncrement < self.lowerIncrement:
  168.             self.upperIncrement = 1
  169.        
  170.         minNextSeed = (secondLowerSeed + self.lowerIncrement) % 1
  171.         maxNextSeed = (secondUpperSeed + self.upperIncrement) % 1
  172.        
  173.         if minNextSeed < maxNextSeed:
  174.             for x in range(2,39,3): #increments over the indexs for the lower seed of drops
  175.                 if dropList[x] > minNextSeed:
  176.                     self.potentialDrops.append(dropList[x-2])
  177.                     if dropList[x] > maxNextSeed:
  178.                         break
  179.         else:
  180.             for x in range(2,39,3):
  181.                 if dropList[x] > minNextSeed:
  182.                     self.potentialDrops.append(dropList[x-2])
  183.                 elif dropList[x-1] < maxNextSeed:
  184.                     self.potentialDrops.append(dropList[x-2])
  185.  
  186.         minNextNextSeed = (minNextSeed + self.lowerIncrement) % 1
  187.         maxNextNextSeed = (maxNextSeed + self.upperIncrement) % 1
  188.        
  189.         if minNextNextSeed < maxNextNextSeed:
  190.             for x in range(2,39,3): #increments over the indexs for the lower seed of drops
  191.                 if dropList[x] > minNextNextSeed:
  192.                     self.nextPotentialDrops.append(dropList[x-2])
  193.                     if dropList[x] > maxNextNextSeed:
  194.                         break
  195.         else:
  196.             for x in range(2,39,3):
  197.                 if dropList[x] > minNextNextSeed:
  198.                     self.nextPotentialDrops.append(dropList[x-2])
  199.                 elif dropList[x-1] < maxNextNextSeed:
  200.                     self.nextPotentialDrops.append(dropList[x-2])
  201.  
  202.     def getLowerIncrement(self):    #returns the lower bound for the low end of the mission's increment
  203.         return(self.lowerIncrement)
  204.  
  205.     def getUpperIncrement(self):    #returns the upper bound for the high end of the mission' increment
  206.         return(self.upperIncrement)
  207.            
  208.     def getWaveFiveDrops(self): #returns the drop list for five waves out
  209.         return(self.potentialDrops)
  210.        
  211.     def getWaveTenDrops(self):  #returns the drop list for ten waves out
  212.         return(self.nextPotentialDrops)
  213.  
  214.        
  215. if __name__ == '__main__':
  216.     app = wx.PySimpleApp()
  217.     frame = WarframeDefenseDrops(parent=None,id=-1)
clone this paste RAW Paste Data