Guest User

FFXIV Tank Python damage test

a guest
Mar 29th, 2014
129
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Python 1.79 KB | None | 0 0
  1. def median(mylist):
  2.     sorts = sorted(mylist)
  3.     length = len(sorts)
  4.     if not length % 2:
  5.         return (sorts[length / 2] + sorts[length / 2 - 1]) / 2.0
  6.     return sorts[length / 2]
  7.    
  8. def war(cycles):
  9.     print "\n\nWAR OVERVIEW\n"
  10.  
  11.     f = open('LOGFILEPATH', 'r')
  12.     out = []
  13.     total = 0
  14.     a=0
  15.     for l in f:
  16.         if "You use Heavy Swing." in l or "STOP" in l:
  17.             if a is 0:
  18.                 continue
  19.  
  20.             print ">>> Rotation damage = " + str(a)
  21.             out.append(a)
  22.             total += 1
  23.             if total is cycles:
  24.                 break
  25.             a=0
  26.         elif "The striking dummy takes" in l:
  27.             if "Critical!" in l:
  28.                 a += int(l[39:42])
  29.             else:
  30.                 a += int(l[29:32])
  31.         elif "hit" in l:
  32.             if "Critical!" in l:
  33.                 a += int(l[41:44])
  34.             else:
  35.                 a += int(l[31:34])
  36.                
  37.  
  38.     b = 0
  39.     for i in out:
  40.         b += i;
  41.        
  42.     c = b/len(out)
  43.     print "Median = " + str(median(out))
  44.     print "Average is =" + str(c)
  45.     print "total = " + str(total)
  46.     return 0
  47.  
  48. def pld(cycles):
  49.     print "\n\nPLD OVERVIEW\n"
  50.    
  51.     Circle = 0
  52.     f = open('LOGFILEPATH', 'r')
  53.     out = []
  54.     total = 0
  55.     a=0
  56.     for l in f:
  57.         if "You use Circle of Scorn." in l:
  58.             Circle = 2
  59.         if "You use Fast Blade." in l or "STOP" in l:
  60.             if a is 0:
  61.                 continue
  62.                
  63.             if Circle > 0:
  64.                 a += 68.75
  65.                 Circle -= 1
  66.                
  67.             print ">>> Rotation damage = " + str(a)
  68.             out.append(a)
  69.             total += 1
  70.             if total is cycles:
  71.                 break
  72.             a=0
  73.         elif "The striking dummy takes" in l:
  74.             if "Critical!" in l:
  75.                 a += int(l[39:42])
  76.             else:
  77.                 a += int(l[29:32])
  78.         elif "hit" in l:
  79.             if "Critical!" in l:
  80.                 a += int(l[41:43])
  81.             else:
  82.                 a += int(l[31:33])
  83.  
  84.     b = 0
  85.     for i in out:
  86.         b += i;
  87.        
  88.     c = b/len(out)
  89.     print "Median = " + str(median(out))
  90.     print "Average is = " + str(c)
  91.     print "total rotations = " + str(total)
  92.     return 0
  93.  
  94. for i in range(0,25,1):
  95.     war(i)
  96.     pld(i)
Advertisement
Add Comment
Please, Sign In to add comment