def startConversation(agent): print '--> start conversation' result = pic.findImgR(panel.StationServices, agent) while not result: time.sleep(0.5) result = pic.findImgR(panel.StationServices, agent) mouse.doubleClickAtP(result) print 'wait until conversation start' while not findAtMissionLeft('info'): time.sleep(0.2) print '<-- start conversation\n' return True
def find(rect, source, threshould): f = 'img/' + source + '.bmp' if not os.path.exists(f): f = '../' + f if not os.path.exists(f): print 'source "' + source + '" do not exists!' return None result = pic.findImgR(rect, f, threshould) if not result: print 'can not find "' + source + '"!' else: print '"' + source + '" finded!' return result