IRCForumları - IRC ve mIRC Kullanıcılarının Buluşma Noktası

IRCForumları - IRC ve mIRC Kullanıcılarının Buluşma Noktası (https://www.ircforumlari.net/)
-   TCL Scriptler (https://www.ircforumlari.net/tcl-scriptler/)
-   -   .Greet ekle Tcl Sorunu (https://www.ircforumlari.net/tcl-scriptler/751628-greet-ekle-tcl-sorunu.html)

Beatle 24 Haziran 2016 18:13

.Greet ekle Tcl Sorunu
 
Kod:

#Greet Başlangıç

bind pub - $sv2(greet) sv2_greet
proc sv2_greet {nick uhost hand chan text} {
global botnick sv2
    set r [lindex $sv2(renk) [rand [llength $sv2(renk)]]]
    set first "[lindex $text 0]"
    if {[string match -nocase $sv2(adminc) $chan] || [string match -nocase $sv2(operc) $chan]} {
    if {$first == ""} { putquick "PRIVMSG $chan \026 Kullanım \026 \003$r\002$sv2(greet) <ekle|sil|listele> <#kanal> <mesaj>\002 şeklindedir.\003"; return 0 }
    if {[string match -nocase "ekle" $first]} {
    set knl "[lindex $text 1]"
    set msg "[lrange $text 2 end]"
    if {$knl == ""} {
        putquick "PRIVMSG $chan \003$r\002Kanal\002 belirtmediniz.\003"
        putquick "PRIVMSG $chan \026 Kullanım \026 \003$r\002$sv2(greet) $first <#kanal> <mesaj>\002 şeklindedir.\003"
        return 0
    }
    if {$msg == ""} {
        putquick "PRIVMSG $chan \003$r\002Mesaj\002 belirtmediniz.\003"
        putquick "PRIVMSG $chan \026 Kullanım \026 \003$r\002$sv2(greet) $first $knl <mesaj>\002 şeklindedir.\003"
        return 0
    }
    if {![file exists "$sv2(greetdizin)"]} { file mkdir $sv2(greetdizin) }
    if {![file exists "$sv2(greetdizin)/$nick"]} { file mkdir $sv2(greetdizin)/$nick }
        file delete $sv2(greetdizin)/$nick/$knl.db
        set greet [open "$sv2(greetdizin)/$nick/$knl.db" w]
        regsub -all "{" $msg "" msg
        regsub -all "}" $msg "" msg
        puts $greet "$msg"
        flush $greet
        catch {closer $greet}
        putquick "PRIVMSG $chan \003$r\002$knl\002 kanalı için \002greet mesajı\002 oluşturuldu.\003"
    }
    if {[string match -nocase "sil" $first]} {
    set knl "[lindex $text 1]"
    if {$knl == ""} {
        putquick "PRIVMSG $chan \003$r\002Kanal\002 belirtmediniz.\003"
        putquick "PRIVMSG $chan \026 Kullanım \026 \003$r\002$sv2(greet) $first <#kanal>\002 şeklindedir.\003"
        return 0
    }
    if {![file exists "$sv2(greetdizin)/$nick/$knl.db"]} {
        putquick "PRIVMSG $chan \003$r\002$knl\002 kanalı için \002greet mesajı\002 bulunmamaktadır.\003"
        putquick "PRIVMSG $chan \026 Önemli Uyari \026 \003$r\Büyük/küçük harf duyarlıdır.\003"
        putquick "PRIVMSG $chan \003$r\002$sv2(greet) listele\002 komutu ile listeleyip yazılış haline bakarak tekrar deneyiniz.\003"
        return 0
        }
        file delete $sv2(greetdizin)/$nick/$knl.db
        putquick "PRIVMSG $chan \003$r\002$knl\002 kanalı için \002greet mesajı\002 başarıyla silinmiştir.\003"
        return
    }
    if {[string match -nocase "listele" $first]} {
    set includes [open "|find $sv2(greetdizin)/$nick -name \*.db -print" r]
        set sayac 0
        putquick "PRIVMSG $chan \002"
        putquick "PRIVMSG $chan \026 Greet listesi \026"
        putquick "PRIVMSG $chan :\002"
        while {[gets $includes include] >= 0} {
            incr sayac
            regsub -all "$sv2(greetdizin)/$nick/" $include "" include
            regsub -all ".db" $include "" include
            set input [open "$sv2(greetdizin)/$nick/$include.db" r]
            set lines [split [read $input] \n]
            catch {close $input}
            foreach line $lines {
                if {$line != ""} {
                    putquick "PRIVMSG $chan :\002$sayac.\002 $include: $line"
                }
            }
        }
        if {$sayac == 0} { putquick "PRIVMSG $chan \026 HATA \026 \003$r\002Greet\002 listesinde hiç kayıt bulunamadı.\003" }
        if {$includes == 0} { putquick "PRIVMSG $chan \026 HATA \026 \003$r\002Greet\002 listesinde hiç kayıt bulunamadı.\003" }
        putquick "PRIVMSG $chan \002"
        putquick "PRIVMSG $chan \003$r\Silmek için \002$sv2(greet) sil <#kanal>\002 komutunu kullanabilirsiniz.\003"
        putquick "PRIVMSG $chan \002"
        putquick "PRIVMSG $chan :\026 Greet listesinin sonu \026"
        putquick "PRIVMSG $chan \002"
        close $includes
        }
    }
}

bind join - * sv2_greetmsg
proc sv2_greetmsg {nick uhost hand chan} {
global botnick sv2
    if {![file exists "$sv2(greetdizin)/$nick"]} { return 0 }
    set includes [open "|find $sv2(greetdizin)/$nick -name \*.db -print" r]
    while {[gets $includes include] >= 0} {
        regsub -all "$sv2(greetdizin)/$nick/" $include "" include
        regsub -all ".db" $include "" include
        set input [open "$sv2(greetdizin)/$nick/$include.db" r]
        set lines [split [read $input] \n]
        catch {close $input}
        foreach line $lines {
            if {$line != ""} {
                if {[string match -nocase $include $chan]} {
                    putquick "PRIVMSG $chan :$line"
                }
            }
        }
    }
    close $includes
}

#Greet Sonu

Yukardaki kodda;

.greet sil #Sohbet çalışıyor.
.greet listele çalışıyor.
.greet ekle #Sohbet mesajyaz sorun bu komutta hiç tepki vermior.

.greet ekle #Sohbet yazdıgımda mesaj yazmadınız diye tepki veriyor mesajı yazdıgımda bu sefer tepki vermiyor acaba sorun nerde yardımcı olacak var mı

rascoLn 07 Temmuz 2016 11:59

Cevap: .Greet ekle Tcl Sorunu
 
Sorun botun ekleme yaptıktan sonra yanıt vermemesi sanırım.

Çözüm sadece iki nokta üstüsteden ( : ) ibaret

Şu satırı:
Kod:

putquick "PRIVMSG $chan \003$r\002$knl\002 kanalı için \002greet mesajı\002 oluşturuldu.\003"
Şu şekilde değiş:
Kod:

putquick "PRIVMSG $chan :\003$r\002$knl\002 kanalı için \002greet mesajı\002 oluşturuldu.\003"


Tüm Zamanlar GMT +3 Olarak Ayarlanmış. Şuanki Zaman: 23:01.

Powered by vBulletin® Version 3.8.8 Beta 3
Copyright ©2000 - 2024, vBulletin Solutions, Inc.
Search Engine Friendly URLs by vBSEO
Copyright ©2004 - 2024 IRCForumlari.Net