Jump to content
×
×
  • Create New...
  • 0

uiwhiper error


EnKor

Question

  • Premium

I wanna put one timer in send whisper. But this dont work... Why?

 

 

def SendWhisper(self):

        Time = {"LAST":0}
        text = self.chatLine.GetText()
        textLength = len(text)
        stringy = ""
        x1 = 0
        if textLength > 0:
            if net.IsInsultIn(text):
                chat.AppendChat(chat.CHAT_TYPE_INFO, locale.CHAT_INSULT_STRING)
                return
            if self.targetName.find("Grupo:") != -1:
                for y in constInfo.groups[self.targetName]:
                    if x1 == 0:
                        stringy = stringy + y
                        x1 = 1
                    else:
                        stringy = stringy + "," + y
                        
                for x in constInfo.groups[self.targetName]:
                    net.SendWhisperPacket(x, "_pn_groupx1888329||" + str(stringy) + "||" + self.targetName + "||" + player.GetName() + " : " + text)
                constInfo.group_chat_enable = 1
                self.chatLine.SetText("")

                chat.AppendWhisper(chat.WHISPER_TYPE_CHAT, self.targetName, player.GetName() + " : " + text)
                constInfo.chat_string =  player.GetName() + " : " + text
                
            else:
                if app.GetGlobalTimeStamp()>=self.Time["LAST"]:
                    constInfo.group_chat_enable = 0
                    net.SendWhisperPacket(self.targetName, text)
                    self.chatLine.SetText("")
                    self.Time["LAST"] = app.GetGlobalTimeStamp()+1

                    chat.AppendWhisper(chat.WHISPER_TYPE_CHAT, self.targetName, player.GetName() + " : " + text)
                    constInfo.chat_string =  player.GetName() + " : " + text
                else:
                    chat.AppendChat(chat.CHAT_TYPE_INFO,"Antispam: You can only write 1 time per second.")

 

Edited by EnKor
Link to comment
Share on other sites

  • Answers 1
  • Created
  • Last Reply

Top Posters For This Question

Top Posters For This Question

1 answer to this question

Recommended Posts

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now


Important Information

Terms of Use / Privacy Policy / Guidelines / We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.