示例#1
0
	def get_bank(self):
		x0, y0 = self.marker
		x1, y1, x2, y2 = self.s.bank_offset
		area = imf.get_screenshot().crop((x0 + x1, y0 + y1, x0 + x2, y0 + y2))
		str = imf.ocr(area)
		if str:
			str = str.replace('$', '')
			if str.isdigit():
				return int(str)
示例#2
0
	def get_money(self, rectangle):
		rect = ()
		for i in xrange(0, len(rectangle)):
			rect += (rectangle[i] + self.marker[i % 2], )
		area = imf.get_screenshot().crop(rect)
		str = imf.ocr(area)
		#print('Recognized area: {}'.format(str))
		if str:
			if str[0] == '$':
				str = str[1:]
			if  str.isdigit():
				return int(str)