PM'de Engelleme [PYTHON]

Whistle

Ruhsuz Filozof
Kurucu
Kurumsal Üye
Geliştirici
Yardımsever Üye
Mesaj
11.494
Çözümler
546
Beğeni
12.054
Puan
5.864
root/game.py açılır ve aratılır;
Python:
def OnRecvWhisper(self, mode, name, line):
        if mode == chat.WHISPER_TYPE_GM:
            self.interface.RegisterGameMasterName(name)
        else:
            pass
Altına şu kod eklenir:
Python:
if os.path.exists(str(constInfo.CLIENT_YOL)+"block_"+str(player.GetName())+".kf") and open(str(constInfo.CLIENT_YOL)+"block_"+str(player.GetName())+".kf", "r").read().find("#"+str(name)+"#") != -1:
            net.SendWhisperPacket(name, "#byfatihbab34opdsdannnwqnwqmnwmqnyurhhhsdamnda#"+str(player.GetStatus(player.LEVEL))+"#1#")
            return
        else:
            pass


        if line.find("byfatihbab34opdsdannnwqnwqmnwmqnyurhhhsdamnda") != -1:
            bol = line.split("#")
            chat.AppendWhisper(chat.WHISPER_TYPE_SYSTEM, name, "Sizi engellemis, Bu kisiye mesaj atamassiniz.")

            return

root/CostInfo.py açılır ve şu kod eklenir;
Python:
CLIENT_YOL = "lib/"

root/uichat.py açılır ve aratılır;
Python:
def __SendChatPacket(self, text, type):
Altına sonuna biyerine şu kod eklenir:
Python:
if text == "?block":
                chat.AppendChat(chat.CHAT_TYPE_INFO, "|cFF32CD32|H|hEngelli Oyuncular:")
                if not os.path.exists(str(constInfo.CLIENT_YOL)+"block_"+str(player.GetName())+".kf"):
                    chat.AppendChat(chat.CHAT_TYPE_INFO, "Engelli oyuncu yok.")
                else:
                    acla = open(str(constInfo.CLIENT_YOL)+"block_"+str(player.GetName())+".kf", "r").read()
                    if not acla.find("#") != -1:
                        chat.AppendChat(chat.CHAT_TYPE_INFO, "Engelli oyuncu yok.")
                        return
                    ac = open(str(constInfo.CLIENT_YOL)+"block_"+str(player.GetName())+".kf", "r").readlines()
                    for i in ac:
                        if str(i).find("#") != -1:
                            chat.AppendChat(chat.CHAT_TYPE_INFO, str(i.split("#")[1].split("#")[0]))
                return

root/uiwhisper.py açılır ve aratılır;
Python:
def OpenWithTarget(self, targetName):
Kodların sonuna şu kod eklenir:
Python:
if os.path.exists(str(constInfo.CLIENT_YOL)+"block_"+str(player.GetName())+".kf") and open(str(constInfo.CLIENT_YOL)+"block_"+str(player.GetName())+".kf", "r").read().find("#"+str(targetName)+"#") != -1:
            self.ignoreButton.Show()
            self.ignoreButton.SetText("Engeli ac")
        else:
            self.ignoreButton.Show()
            self.ignoreButton.SetText("Engelle")

Tekrar aratılır;
Python:
def IgnoreTarget(self):
Tamamı şu kodlarla değiştirilir:
Python:
def IgnoreTarget(self):
        if str(self.targetName).find("[") != -1:
            chat.AppendChat(chat.CHAT_TYPE_INFO, "<Fısıltı>: Game Master'leri sohbetten engelleyemessin.")
            return
        if os.path.exists(str(constInfo.CLIENT_YOL)+"block_"+str(player.GetName())+".kf") and open(str(constInfo.CLIENT_YOL)+"block_"+str(player.GetName())+".kf", "r").read().find("#"+str(self.targetName)+"#") != -1:
            ac = open(str(constInfo.CLIENT_YOL)+"block_"+str(player.GetName())+".kf", "r")
            oku = ac.read()
            ac.close()
            open(str(constInfo.CLIENT_YOL)+"block_"+str(player.GetName())+".kf", "w").write(str(oku).replace(str("#"+self.targetName+"#"), ""))
            self.ignoreButton.SetText("Engelle")
        else:
            if os.path.exists(str(constInfo.CLIENT_YOL)+"block_"+str(player.GetName())+".kf"):
                open(str(constInfo.CLIENT_YOL)+"block_"+str(player.GetName())+".kf", "a+").write("\n"+str("#"+self.targetName+"#"))
            else:
                open(str(constInfo.CLIENT_YOL)+"block_"+str(player.GetName())+".kf", "a+").write(str("#"+self.targetName+"#"))
            self.ignoreButton.SetText("Engeli ac")

Tekrar aratılır;
Python:
def SendWhisper(self):
Bunun altına;
Python:
if textLength > 0:

            if net.IsInsultIn(text):
                chat.AppendChat(chat.CHAT_TYPE_INFO, localeInfo.CHAT_INSULT_STRING)
                return
Şu kod eklenir:
Python:
if os.path.exists(str(constInfo.CLIENT_YOL)+"block_"+str(player.GetName())+".kf") and open(str(constInfo.CLIENT_YOL)+"block_"+str(player.GetName())+".kf", "r").read().find("#"+str(self.targetName)+"#") != -1:
                chat.AppendWhisper(chat.WHISPER_TYPE_SYSTEM, self.targetName, 'Engelledigin kisiye mesaj gonderemezsin.')
                return
Not: Game.py ve uiwhisper.py de import os yoksa importlara ekleyin.
Linkleri görebilmek için giriş yap veya kayıt ol.


Sistemin çalıştığına dair kanıt:
PM'de Engelleme [PYTHON].png
 
@Whistle Hocam herşeyi yaptım bu syserr hatasını alıyorum. Pmye tıklayınca açmıyor ve bu hata geliyor

Kod:
0223 21:38:52411 ::   File "ui.py", line 1023, in CallEvent

0223 21:38:52412 ::   File "ui.py", line 87, in __call__

0223 21:38:52413 ::   File "ui.py", line 69, in __call__

0223 21:38:52414 ::   File "uiTarget.py", line 334, in OnWhisper

0223 21:38:52415 ::   File "ui.py", line 87, in __call__

0223 21:38:52415 ::   File "ui.py", line 78, in __call__

0223 21:38:52416 ::   File "interfaceModule.py", line 1538, in OpenWhisperDialog

0223 21:38:52416 ::   File "uiWhisper.py", line 229, in OpenWithTarget

0223 21:38:52417 :: NameError
0223 21:38:52417 :: :
0223 21:38:52417 :: global name 'constInfo' is not defined
0223 21:38:52417 ::

Python:
    def OpenWithTarget(self, targetName):
        chat.CreateWhisper(targetName)
        chat.SetWhisperBoxSize(targetName, self.GetWidth() - 60, self.GetHeight() - 90)
        self.chatLine.SetFocus()
        self.titleName.SetText(targetName)
        self.targetName = targetName
        self.textRenderer.SetTargetName(targetName)
        self.titleNameEdit.Hide()
        self.ignoreButton.Hide()
        if app.IsDevStage():
            self.reportViolentWhisperButton.Show()
        else:
            self.reportViolentWhisperButton.Hide()
        self.acceptButton.Hide()
        self.gamemasterMark.Hide()
        self.minimizeButton.Show()
        if os.path.exists(str(constInfo.CLIENT_YOL)+"block_"+str(player.GetName())+".kf") and open(str(constInfo.CLIENT_YOL)+"block_"+str(player.GetName())+".kf", "r").read().find("#"+str(targetName)+"#") != -1:
            self.ignoreButton.Show()
            self.ignoreButton.SetText("Engeli ac")
        else:
            self.ignoreButton.Show()
            self.ignoreButton.SetText("Engelle")
 
uiwhisper en tepeye şu kodu yazın;
Python:
import constInfo

Bu konuda ki anlatım 34k filesler içindi. Artık 40k filesler için bu işlevi gerçekleştiren daha iyi sistemler mevcut.
 
@Whistle oldu hocam teşekkür ederim. Baktımda bulamadım galiba çoğu 34k filesler için gelişmiş sistemler mevcut demişsiniz yönlendirebilirmisiniz
 
Üstad Vegasın Contact sistemiyle çakışıyor ondada ignorebuttonlar var sebebini bulamadım acaba bir fikrin var mıdır?
 
Bu sistem 34k filesler için fatihbab34 tarafından yazılmıştı. 40k -güncel filesler- filesler için güncel paylaşılan sistemler var. Bu konunun önceki mesajlarına bakabilirsiniz.
 
Üstad Sistemi normal Whisper de kullanırken bir problem olmuyor sadaece contacta sıkıntı yaratıyor
 
Geri
Üst