Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- def median(mylist):
- sorts = sorted(mylist)
- length = len(sorts)
- if not length % 2:
- return (sorts[length / 2] + sorts[length / 2 - 1]) / 2.0
- return sorts[length / 2]
- def war(cycles):
- print "\n\nWAR OVERVIEW\n"
- f = open('LOGFILEPATH', 'r')
- out = []
- total = 0
- a=0
- for l in f:
- if "You use Heavy Swing." in l or "STOP" in l:
- if a is 0:
- continue
- print ">>> Rotation damage = " + str(a)
- out.append(a)
- total += 1
- if total is cycles:
- break
- a=0
- elif "The striking dummy takes" in l:
- if "Critical!" in l:
- a += int(l[39:42])
- else:
- a += int(l[29:32])
- elif "hit" in l:
- if "Critical!" in l:
- a += int(l[41:44])
- else:
- a += int(l[31:34])
- b = 0
- for i in out:
- b += i;
- c = b/len(out)
- print "Median = " + str(median(out))
- print "Average is =" + str(c)
- print "total = " + str(total)
- return 0
- def pld(cycles):
- print "\n\nPLD OVERVIEW\n"
- Circle = 0
- f = open('LOGFILEPATH', 'r')
- out = []
- total = 0
- a=0
- for l in f:
- if "You use Circle of Scorn." in l:
- Circle = 2
- if "You use Fast Blade." in l or "STOP" in l:
- if a is 0:
- continue
- if Circle > 0:
- a += 68.75
- Circle -= 1
- print ">>> Rotation damage = " + str(a)
- out.append(a)
- total += 1
- if total is cycles:
- break
- a=0
- elif "The striking dummy takes" in l:
- if "Critical!" in l:
- a += int(l[39:42])
- else:
- a += int(l[29:32])
- elif "hit" in l:
- if "Critical!" in l:
- a += int(l[41:43])
- else:
- a += int(l[31:33])
- b = 0
- for i in out:
- b += i;
- c = b/len(out)
- print "Median = " + str(median(out))
- print "Average is = " + str(c)
- print "total rotations = " + str(total)
- return 0
- for i in range(0,25,1):
- war(i)
- pld(i)
Advertisement
Add Comment
Please, Sign In to add comment