import pyautogui,time,os, xlrd from playsound import playsound pyautogui.PAUSE = 1 pyautogui.FAILSAFE = True workbook = xlrd.open_workbook('D:\Driver\sikuli\Data\disconcall.xlsx') sheet = workbook.sheet_by_name('data') row_count = sheet.nrows def intro(): file=str('D:\\Driver\\sikuli\\voice\\intro.wav') playsound(file) def mid(): file=str('D:\\Driver\\sikuli\\voice\\mid.wav') playsound(file) def last(): file=str('D:\\Driver\\sikuli\\voice\\last.wav') playsound(file) def play(x): file=str('D:\\Driver\\sikuli\\voice\\') file=str(str(file)+str(x)+".WAV") playsound(file) def con_no(c): x=str(c) for i in range (0,9): con=x[i:i+1] time.sleep(0.1) play(str(con)) time.sleep(0.1) def osd(x): if (x>99999): l=int(x/100000) print(l) play(l) play("lakh") h=int((x%100000)/1000) if (h>0): print(h) play(h) play("hazar") t=int((x%1000)/100) if (t>0): print(t) play(t) play("shw") s=int(x%100) if(s>0): print(s) play(s) print('Press Ctrl-C to quit.') time.sleep(2) for i in range(1,row_count): pyautogui.doubleClick(50,175) time.sleep(0.5) phone_num="+91"+str(int(sheet.cell(i, 0).value)) pyautogui.typewrite(phone_num) print(phone_num) time.sleep(0.5) pyautogui.click(334,390) while pyautogui.locateOnScreen('dialing.png')!=None: time.sleep(0.2) print("System Dialing") if pyautogui.locateOnScreen('idle.png')!=None: pyautogui.moveTo(438,390, 0.25) pyautogui.click(438,390) else: if pyautogui.locateOnScreen('calling.png')!=None: print("Call connected") intro() con_id=int(sheet.cell(i, 1).value) print(con_id) con_no(con_id) mid() amt=int(sheet.cell(i, 2).value) print(amt) osd(amt) last() pyautogui.click(438,390) while pyautogui.locateOnScreen('idle.png')==None: time.sleep(0.2) print("System waiting")