Bvural41 1
Bvural41
Mt2Hizmet 1
Mt2Hizmet
xranzei 1
xranzei
quickxd 1
quickxd
noisiv 1
noisiv
Manwe Work 1
Manwe Work
Hikaye Ekle

Altın Konu Chat Stack

  • Konuyu başlatan Konuyu başlatan Reached
  • Başlangıç tarihi Başlangıç tarihi
  • Cevaplar Cevaplar 21
  • Görüntüleme Görüntüleme 3K

HERAKLES Otomatik Avlı kalıcı sunucu. 19 Haziran'da açılıyor. Atius & Wizard güvencesiyle hemen kayıt ol, ön kayıt ödülleri aktif. HEMEN TIKLA!

Chat'e yazdıklarınızın ışınlandıktan sonra gitmemesini sağlar.
Python:
#ara
ENABLE_CHAT_COMMAND = True

#altına ekle
chatStack = []
LAST_SENTENCE_STACK_SIZE = 32

#ara
def __PrevLastSentenceStack(self):

# fonksiyonu komple değiştir

    def __PrevLastSentenceStack(self):
        if self.lastSentencePos < len(chatStack):
            self.lastSentencePos += 1
            lastSentence = chatStack[-self.lastSentencePos]
            self.SetText(lastSentence)
            self.SetEndPosition()


# ara
def __NextLastSentenceStack(self):

# fonksiyonu komple değiştir.
    def __NextLastSentenceStack(self):
        if self.lastSentencePos > 1:
            self.lastSentencePos -= 1
            lastSentence = chatStack[-self.lastSentencePos]
            self.SetText(lastSentence)
            self.SetEndPosition()

# ara
def __PushLastSentenceStack(self, text):

# fonksiyonu komple değiştir.
    def __PushLastSentenceStack(self, text):
        global ENABLE_LAST_SENTENCE_STACK
        if not ENABLE_LAST_SENTENCE_STACK:
            return
        if len(text) <= 0:
            return
        if len(chatStack) > LAST_SENTENCE_STACK_SIZE:
            chatStack.pop(0)
        chatStack.append(text)

++ @martysama0134 Thank you for your contribution

Aynı kelimeleri tekrar tekrar eklemez.
Python:
    def __PushLastSentenceStack(self, text):
        global ENABLE_LAST_SENTENCE_STACK
        if not ENABLE_LAST_SENTENCE_STACK:
            return
        if len(text) <= 0:
            return
        if text in chatStack: #remove duplicated elements and push the new one on top
            chatStack.remove(text)
        if len(chatStack) > LAST_SENTENCE_STACK_SIZE:
            chatStack.pop(0)
        chatStack.append(text)
 
Son düzenleme:

En Çok Reaksiyon Alan Mesajlar

Şu an konuyu görüntüleyenler (Toplam : 0, Üye: 0, Misafir: 0)

Geri
Üst