def makeBuy(self, tarhwnd, myhwnd): tarprocGuard = helper.ProcGuard(tarhwnd) myprocGuard = helper.ProcGuard(myhwnd) proc = myprocGuard.proc tarproc = tarprocGuard.proc myid = dolScript.getPCID(proc) myname = dolScript.getRoleName(proc) tarname = dolScript.getRoleName(tarproc) print tarname lock = MutexGuard(mutex) dolCall.openDialog(tarproc, myid, 0x32) dountil(dolScript.isDialogOpen, [tarproc]) l = MutexGuard(msgBoxMutex) win32gui.ShowWindow(tarhwnd, win32con.SW_RESTORE) win32gui.SetActiveWindow(tarhwnd) win32gui.SetForegroundWindow(tarhwnd) msgBox(tarname, '請購買 [' + myname + '] 的露天……') win32gui.ShowWindow(tarhwnd, win32con.SW_MINIMIZE) dowhile(dolScript.isDialogOpen, [proc]) print 'makeBuy end'
def __whenRead(): log('讀到圖') bossid = dolScript.getPCID(proc) dolCall.openDialog(proc, bossid, 0x20) myname = dolScript.getRoleName(proc) dountil(dolScript.isDialogOpen, [proc]) l = MutexGuard(msgBoxMutex) msgBox(myname, '读到图。准备弹出窗口……') win32gui.ShowWindow(hwnd, win32con.SW_RESTORE) win32gui.SetActiveWindow(hwnd) win32gui.SetForegroundWindow(hwnd) msgBox(myname, '请在摆好露天后点击确定。(将会有购买窗口弹出……)') dowhile(dolScript.isDialogOpen, [proc]) win32gui.ShowWindow(hwnd, win32con.SW_MINIMIZE) tarhwnd = self.serHwnd self.makeBuy(tarhwnd, hwnd) print 'one read loop end'