Konu: tcl yardım
Tekil Mesaj gösterimi
Alt 25 Aralık 2016, 17:57   #1
amonhutep
Guest
Kullanıcıların profil bilgileri misafirlere kapatılmıştır.
IF Ticaret Yüzdesi:(%)
tcl yardım




arkadaşlar bi tcl dosyası oluşturup 40 adet txt dosyasını komut ile bu tcl ye okutmak istiyorum yardımcı olur musunuz?aşağıdaki buluduğum kodlar doğru mu veya eklenecek değişecek kodlar var mı?


set oku "x.txt"
set kanal "#kanal"

bind pub - !kural pub:kuralmsg
proc pub:kuralmsg { nick host hand chan text} {
global oku kanal
if {[file exists $oku]} {
set kuralfile [open $oku r]
while {![eof $kuralfile]} {
catch {set kuraltext [gets $kuralfile]}
putserv "PRIVMSG $kanal :$kuraltext"
}
catch {close $kuralfile}
}
}
-
proc fread {dosya kime} {
if {![file exists $dosya]} {
putlog "$dosya adinda bir belge bulunamadi"
return
}
set cikti [open $dosya r]
set satir [split [read $cikti] \n]
catch {close $cikti}
set say 0
foreach satir $satir {
if {$satir != ""} {
puthelp "PRIVMSG $kime :$satir"
incr say
}
}
if {$say == 0} {
puthelp "PRIVMSG $kime :Mevcut dosya icinde bilgi bulunamadi"
return
} else {
puthelp "PRIVMSG $kime :Liste sonu!"
}
}
-
bind pub - !kural kural

proc kural {nick uhost hand chan text} {
fread scripts/kural.txt $chan
}

 
Alıntı ile Cevapla

IRCForumlari.NET Reklamlar
sohbet odaları reklam ver Benimmekan Mobil Sohbet