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/)
-   -   Belirli aralıklarla Global Atan Çalışır Tcl lazım. Yardım Lütfen (https://www.ircforumlari.net/tcl-scriptler/861181-belirli-araliklarla-global-atan-calisir-tcl-lazim-yardim-lutfen.html)

Kawissaa 11 Mart 2020 21:31

Belirli aralıklarla Global Atan Çalışır Tcl lazım. Yardım Lütfen
 
Arkadaşlar elinde çalışan 6 dk da bir global atan tcl var mı. Paylaşırsanız çok sevinirim.

YellowLine 12 Mart 2020 14:55

Cevap: Belirli aralıklarla Global Atan Çalışır Tcl lazım. Yardım Lütfen
 
Araştırma yaparsan bulursun,
aşağıdaki kodu kullanabilirsin.

Kod:

#########
# BASLA #
#########

# Global mesaj sistemini acip kapatma komutunun isleyecegi kanali belirtiniz.
set glbmsg(operchan) "#Admin"

# Global komut on ekini belirtiniz.
set glbmsg(komut) ".global"

# Global mesajlarin bulundugu dosya dizinini belirtiniz.
set glbmsg(text) "scripts/globalmsg.txt"

# Global mesajlar kac dakika arayla atilacaksa belirtiniz. (Dakika cinsinden)
set glbmsg(zaman) "5"

######################
# DOKUNMA BOZULUR :d #
######################

proc globalat {} {
global botnick globalat glbmsg
        set msgzaman "0"
        set dosya [open $glbmsg(text) r]
        set liste [split [subst -nocommands [read $dosya]] \n]
        foreach i $liste {
                if {[lrange $i 2 end] != ""} {
                        set msgzaman [expr $msgzaman + $glbmsg(zaman)]
                        timer $msgzaman[list putquick "os global [lrange $i 2 end]"]
                }
        }
        close $dosya
        timer $msgzaman[list globalat]
}

bind evnt - init-server baglan:dosyayarat
proc baglan:dosyayarat {type} {
global botnick glbmsg
        if {![file exists $glbmsg(text)]} {
                set dosya [open $glbmsg(text) w]
                close $dosya
        }
}

set durum "0"

bind pub - $glbmsg(komut) globalonoff
proc globalonoff {nick uhost hand chan text} {
global botnick glbmsg durum
        set komut "[lindex [split $text] 0]"
        set mesaj "[lrange [split $text] 1 end]"
        if {[string match -nocase $glbmsg(operchan) $chan]} {
                if {$komut == ""} {
                        putquick "PRIVMSG $chan :Kullanimi: $glbmsg(komut) \002<on/off/durum/ekle/sil/listele>\002"
                        return 0
                }
                if {[string match -nocase "on" $komut]} {
                        globalat
                        set durum "1"
                        putquick "PRIVMSG $chan :Global mesaj sistemi \002acildi\002."
                        return 0
                }
                if {[string match -nocase "off" $komut]} {
                        killtimer [lindex [timers] [lsearch [timers] "*globalat*"] end]
                        set durum "0"
                        putquick "PRIVMSG $chan :Global mesaj sistemi \002kapatildi\002."
                        return 0
                }
                if {[string match -nocase "durum" $komut]} {
                        if {$durum == "1"} {
                                putquick "PRIVMSG $chan :Global mesaj sistemi \002acik\002."
                        } else {
                                putquick "PRIVMSG $chan :Global mesaj sistemi \002kapali\002."
                                return 0
                        }
                }
                if {[string match -nocase "ekle" $komut]} {
                        if {$mesaj == ""} {
                                putquick "PRIVMSG $chan :Global mesaj belirtmediniz. Lutfen global mesajinizi belirtiniz."
                                return 0
                        }
                        putquick "PRIVMSG $chan :GLOBAL MESAJ: $mesaj » Basariyla global mesaj listesine eklendi."
                        set globs [open $glbmsg(text) a]
                        puts $globs "[join [rand 9999]] [join -] [join $mesaj]"
                        flush $globs
                        catch {closer $globs}
                }
                if {[string match -nocase "sil" $komut]} {
                        if {![file exists $glbmsg(text)]} {
                                putquick "PRIVMSG $chan :Global mesaj listesi zaten bos."
                                return
                        }
                        set data ""
                        set input [open $glbmsg(text) r]
                        while {![eof $input]} {
                                set curline [gets $input]
                                set curline [split $curline]
                                if {$curline != ""} {
                                        set data [linsert $data end $curline]
                                }
                        }
                        catch {close $input}
                        set deger -1
                        set esles ""
                        foreach line $data {
                                incr deger
                                if {[string match -nocase "$mesaj" [lindex $line 0]]} {
                                        set esles $deger
                                        break
                                }
                        }
                        if {$esles == ""} {
                                putquick "PRIVMSG $chan :Boyle bir global mesaj listede yok."
                                putquick "PRIVMSG $chan :Listeyi gormek icin: \002$glbmsg(komut) listele\002"
                                putquick "PRIVMSG $chan :Silmek icin global mesajin basinda ki numarayi kullaniniz. Ornek: \002$glbmsg(komut) sil 1234\002"
                                return
                        }
                        set newdata [lreplace $data $deger $deger]
                        set output [open $glbmsg(text) w]
                        foreach newline $newdata {
                                if {$newline != ""} {
                                        puts $output $newline
                                }
                        }
                        flush $output
                        catch {close $output}
                        putquick "PRIVMSG $chan :\002$mesaj\002 numarali global mesaj listeden silindi."
                        return
                }
                if {[string match -nocase "listele" $komut]} {
                        if {![file exists $glbmsg(text)]} {
                                putquick "PRIVMSG $chan :Global mesaj listesi bos."
                                return 0
                        }
                        set input [open $glbmsg(text) r]
                        set lines [split [subst -nocommands [read $input]] \n]
                        catch {close $input}
                        set sayc 0
                        foreach line $lines {
                                if {$line != ""} {
                                        putquick "PRIVMSG $chan :$line"
                                        incr sayc
                                }
                        }
                        if {$sayc == 0} {
                                putquick "PRIVMSG $chan :Global mesaj listesinde hic kayit bulunamadi."
                                return
                        } else {
                                putquick "PRIVMSG $chan :Global mesaj listesinin sonu..."
                        }
                }
        }
}

#########
# BITTI #
#########


StanteaR 13 Mart 2020 13:47

Cevap: Belirli aralıklarla Global Atan Çalışır Tcl lazım. Yardım Lütfen
 
Bu Global Mesajlar Androirc Kullananlar İçin Başa Bela İkidebir Özele Mesaj Geliyor :)

Ketum42850 16 Mayıs 2020 02:57

Cevap: Belirli aralıklarla Global Atan Çalışır Tcl lazım. Yardım Lütfen
 
Merhabalar
Öncelikle bu güzel çalışma için emeğine sağlık
.global on yada .global off yazdıgımda herhangi bir tepki vermiyor ve açılmıyor
nerede hata yapıyorum yardımcı olurmusunuz.


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

Powered by vBulletin® Version 3.8.11
Copyright ©2000 - 2025, vBulletin Solutions, Inc.
Search Engine Friendly URLs by vBSEO
Copyright ©2004 - 2025 IRCForumlari.Net Sparhawk