if app.AHMET_BOT_KONTROL_SYSTEM: class CaptchaEkran(QuestionDialog2): def __init__(self): ui.ScriptWindow.__init__(self) self.__CreateDialog() self.endTime = 0 self.timeOverMsg = 0 self.timeOverEvent = None self.timeOverEventArgs = None def __del__(self): QuestionDialog2.__del__(self) def __CreateDialog(self): pyScrLoader = ui.PythonScriptLoader() pyScrLoader.LoadScriptFile(self, "uiscript/ahmetbotkontrol.py") self.board = self.GetChild("board") self.textLine1 = self.GetChild("message1") self.textLine2 = self.GetChild("message2") self.textLine3 = self.GetChild("message3") self.InputValue = self.GetChild("InputValue") self.cp1 = self.GetChild("cp1") self.cp2 = self.GetChild("cp2") self.cp3 = self.GetChild("cp3") self.cp4 = self.GetChild("cp4") self.cp5 = self.GetChild("cp5") self.acceptButton = self.GetChild("accept") self.cancelButton = self.GetChild("cancel") self.textLine3.Hide() def Open(self, timeout, cpp1, cpp2, cpp3, cpp4, cpp5): self.SetCenterPosition() self.SetTop() self.cp1.LoadImage("captcha/"+str(cpp1)+".tga") self.cp1.Show() self.cp2.LoadImage("captcha/"+str(cpp2)+".tga") self.cp2.Show() self.cp3.LoadImage("captcha/"+str(cpp3)+".tga") self.cp3.Show() self.cp4.LoadImage("captcha/"+str(cpp4)+".tga") self.cp4.Show() self.cp5.LoadImage("captcha/"+str(cpp5)+".tga") self.cp5.Show() self.Show() self.endTime = app.GetTime() + timeout def SetTimeOverEvent(self, event, *args): self.timeOverEvent = event self.timeOverEventArgs = args def SetTimeOverMsg(self, msg): self.timeOverMsg = msg def SetText1(self, text): self.textLine1.SetText(text) self.textLine1.Show() def SetText2(self, text): self.textLine2.SetText(text) self.textLine2.Show() def SetText3(self, text): self.textLine3.SetText(text) self.textLine3.Show() def GetInput(self): return self.InputValue.GetText() def Temizle(self): self.InputValue.SetText("") def OnTimeOver(self): if self.timeOverEvent: apply(self.timeOverEvent, self.timeOverEventArgs) if self.timeOverMsg: chat.AppendChat(chat.CHAT_TYPE_INFO, self.timeOverMsg) def OnUpdate(self): leftTime = max(0, self.endTime - app.GetTime()) self.SetText2(localeInfo.UI_LEFT_TIME % (leftTime)) if leftTime <= 0: self.OnTimeOver()