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/)
-   -   !duyuruekle & !duyurucikar (https://www.ircforumlari.net/tcl-scriptler/519078-duyuruekle-amp-duyurucikar.html)

saywhat 29 Mart 2013 03:38

Cevap: !duyuruekle & !duyurucikar
 
kodu baştan sıfırdan yazdım... eski haline göre yazmak kafamı karıştırmaktan başka işe yaramıyordu..bi sürü salakça hatalar vardı.

<bu kodda hiç denenmedi> çalışıp çalışmayacağını bilmiyorum.sadece syntax check yaptım...ters bir döneme denk geldi benim için şu aralar PC başında geçirecek vaktim olmuyor.
kod hiç denenmedi.denemek yine size kalıyor. kodu şurdan da alabilirsiniz -> [Üye Olmadan Linkleri Göremezsiniz. Üye Olmak için TIKLAYIN...] foruma yapıştırırken iç içe geçiyor.

Kod:

setudef flag duyuru
bind pub -|- "*" duyuru:pub
bind msgm -|- "*" duyuru:duyur
proc duyuru:pub {nick uhost hand chan text} {
 if {![channel get $chan duyuru] || ![isop $nick $chan]} { :return }
 set dyrkmt [lindex [split $text] 0]
 set dyrno [lindex [split $text] 1]
 set dyrmsg [join [lrange [split $text] 2 end]]
    set dzn "duyurular.txt"
 switch -- $dyrkmt {
  "!dyrekle" {
    if {[llength "$text"] == "0"} {
    putserv "notice $nick :eksik giriş"
    return
  }
  if {![file exists "$dzn"]} {
    set abc [open "$dzn" w]
    } else {
    set abc [open "$dzn" a]
    }
    puts $abc "$text"
    close $abc
    putserv "notice $nick :eklendi \002$text\002"
  }
  "!dyrsil" {
      if {![file exists "$dzn"]} {
    putserv "notice $nick :\002$dzn\002 boş"
    return
    }
    if {[llength "$dyrno"] == "0"} {
    putserv "notice $nick :eksik komut"
    return
    }
    set abc [open "$dzn"]
    set lines [split [read -nonewline $abc] "\n"]
    close $abc
    if {[llength $lines] == "0"} {
    putserv "notice $nick :\002$dzn\002 boş"
    return
  }
    set say 0
    set satir [lsearch $lines $dyrno]
    while {"$satir" != "-1"} {
    set lines [lreplace $lines $satir $satir]
    set satir [lsearch $lines $dyrno]
    incr say
  }
    set abc [open "$dzn" w]
    puts $abc [join $lines "\n"]
    close $abc
    if {"$say" > "1"} {
      set s ""
    } else {
      set s "s"
    }
    putserv "notice $nick :istenen \002$dyrno\002 silindi $say süre$s"
  }
 
  "!dyrliste" {
  if {![file exists "$dzn"]} {
      putserv "notice $nick :\002$dzn\002 yok"
    return
    }
    set dyrno 0
    set abc [open "$dzn"]
    set lines [split [read -nonewline $abc] "\n"]
    close $abc
      if {[llength $lines] == "0"} {
    putserv "notice $nick :\002$dzn\002 boş"
    return
    }
    foreach line $lines {
    if {[llength $line] == "0"} {
      set line "-Yok-"
    }
    putserv "notice $nick :\002$dyrno \002 $line"
      incr dyrno
    }
    putserv "notice $nick :son"
  }
 
  "default" {
    if {![file exists "$dzn"]} {
    putserv "privmsg $nick :\002$dzn\002 boş"
    return
  }
  set dyrno 0
  set abc [open "$dzn"]
    while {![eof $abc]} {
    set line [gets $abc]
    if {[llength $line] == "0"} {
      set line "-Yok-"
    }
    putserv "privmsg $nick :$dyrno $line"
    incr dyrno
  }
  close $abc
  putserv "privmsg $nick :son"
  }
  return 1
  }
}
 proc duyuru:duyur {nick dyrkmt dyrno} {
  set dyrkmt [lindex [split $text] 0]
  set dyrno [lindex [split $text] 1]
  if {[string match "dyr" $dyrkmt] || [string match "duyur*" $dyrkmt]} {
  return $duyuru:pub
  }
}
putlog "tamam..."
# EOF


saywhat 30 Mart 2013 14:27

Cevap: !duyuruekle & !duyurucikar
 
[Üye Olmadan Linkleri Göremezsiniz. Üye Olmak için TIKLAYIN...]

[Üye Olmadan Linkleri Göremezsiniz. Üye Olmak için TIKLAYIN...]

-> [Üye Olmadan Linkleri Göremezsiniz. Üye Olmak için TIKLAYIN...]

Kod:

# kullanımı:
# .chanset #kanalınız +duyuru .. ile ayarladığınız kanal üstünde.en az Op'lar için:
# !dyrekle <duyuru-no/duyuru-ismi> duyurunuz...
# !dyrsil <duyuru-no/duyuru-ismi>
# !dyrliste
# özelde herhangi bir botun olduğu kanalda,herhangi bir kullanıcı tarafından kullanılabilecek duyuru komutu:
# <duyuru-no/duyuru-ismi>
# kodun aktif olduğu kanaldaki kanal opları ve üstünün eklemiş olduğu duyuru/ları
# botun özelinde duyuru-ismi yada rakkam ile eklenmişse numarasıyla okuyabilmesini sağlıyor...
# (herhangi bir komutu yada işareti yok.sadece eklediğinizde
# duyurunuza koyduğunuz isim yada numara ile o eklenmiş duyuruyu postalıyor.)
setudef flag duyuru
bind pubm -|- "*" duyuru:pub
bind msgm -|- "*" duyuru:duyur
proc duyuru:pub {nick uhost hand chan text} {
if {![channel get $chan duyuru] || ![isop $nick $chan]} {
    return 0
}
set dyrkmt [lindex [split $text] 0]
set dyrno [lindex [split $text] 1]
set dyrmsg [join [lrange [split $text] 2 end]]
set dzn "duyuru.txt"
    switch -- $dyrkmt {
 
        "!dyrekle" {
            if {[llength $dyrmsg] == "0"} {
                putserv "notice $nick :kullanımı !dyrekle <duyuru-no/duyuru-ismi> duyurunuz."
                return 0
            }
            set abc [open "$dzn" a+]
            puts $abc "$dyrno $dyrmsg"
            close $abc
            putserv "notice $nick :eklendi \002$dyrno:\002 $dyrmsg"
            return 0
        }
 
        "!dyrsil" {
            if {![file exists "$dzn"]} {
                putserv "notice $nick :\002$dzn\002 boş."
                return 0
            }
            if {[llength "$dyrno"] == "0"} {
                putserv "notice $nick :kullanımı !dyrsil <duyuru-no/duyuru-ismi>."
                return 0
            }
            set abc [open "$dzn"]
            set lines [split [read -nonewline $abc] "\n"]
            close $abc
            if {[llength $lines] == "0"} {
                putserv "notice $nick :\002$dzn\002 boş."
                return 0
            }
            set lines2 ""
            set say 0
            set satirno 0
            foreach line $lines {
                if {[lindex $line 0] == $dyrno} {
                  set lines2 [lreplace $lines $satirno $satirno]
                  incr say
                }
                incr satirno
            }
            if {$say == 0} {
                putserv "notice $nick :böyle bir duyuru yok: \002$dyrno\002."
                return 0
            }
            set abc [open "$dzn" w]
            puts $abc [join $lines2 "\n"]
            close $abc
            if {$say == 1} {
                set s ""
            } else {
                set s "s"
            }
            putserv "notice $nick :\002$dyrno\002 $say adet$s, duyuru silindi."
        }
 
        "!dyrliste" {
      if {![file exists "$dzn"]} {
                putserv "notice $nick :\002$dzn\002 boş"
                return 0
            }
            set dyrno 0
            set abc [open "$dzn"]
            set lines [split [read -nonewline $abc] "\n"]
            close $abc
            if {[llength $lines] == "0"} {
                putserv "notice $nick :\002$dzn\002 boş"
                return 0
            }
            foreach line $lines {
                putserv "notice $nick :\002[lindex $line 0]\002 [lrange $line 1 end]"
            }
            putserv "notice $nick :Son"
        }
        return 0
    }
}
proc duyuru:duyur {nick uhost hand text} {
    set dzn "duyuru.txt"
    if {![file exists "$dzn"]} {
        return 0
    }
    set dyrno 0
    set abc [open "$dzn"]
    set lines [split [read -nonewline $abc] "\n"]
    close $abc
    if {[llength $lines] == "0"} {
        return 0
    }
    foreach line $lines {
        if {[lindex $line 0] == $text} {
            putserv "privmsg $nick :[lrange $line 1 end]"
        }
    }
    }
putlog "burası,  kodun dibidir...."


kheldor 24 Haziran 2013 05:33

Cevap: !duyuruekle & !duyurucikar
 
Sadece !dyrliste kodunu tüm kullanıcılara nasıl açarız ? Kod sorunsuz calısıyor. Ancak tek istediğim bu . Yardımcı olabilir misiniz ?



PHP- Kodu:


# kullanımı:
# .chanset #kanalınız +duyuru .. ile ayarladığınız kanal üstünde.en az Op'lar için:
# !dyrekle <duyuru-no/duyuru-ismi> duyurunuz...
# !dyrsil <duyuru-no/duyuru-ismi>
# !dyrliste
# özelde herhangi bir botun olduğu kanalda,herhangi bir kullanıcı tarafından kullanılabilecek duyuru komutu:
# <duyuru-no/duyuru-ismi>
# kodun aktif olduğu kanaldaki kanal opları ve üstünün eklemiş olduğu duyuru/ları 
# botun özelinde duyuru-ismi yada rakkam ile eklenmişse numarasıyla okuyabilmesini sağlıyor... 
# (herhangi bir komutu yada işareti yok.sadece eklediğinizde 
# duyurunuza koyduğunuz isim yada numara ile o eklenmiş duyuruyu postalıyor.)
setudef flag duyuru
bind pubm 
-|- "*" duyuru:pub
bind msgm 
-|- "*" duyuru:duyur
proc duyuru
:pub {nick uhost hand chan text} {
if {![
channel get $chan duyuru] || ![isop $nick $chan]} {
    return 
0
}
set dyrkmt [lindex [split $text0]
set dyrno [lindex [split $text1]
set dyrmsg [join [lrange [split $text2 end]]
set dzn "duyuru.txt"
    
switch -- $dyrkmt {
 
        
"!dyrekle" {
            if {[
llength $dyrmsg] == "0"} {
                
putserv "notice $nick :kullanımı !dyrekle <duyuru-no/duyuru-ismi> duyurunuz."
                
return 0
            
}
            
set abc [open "$dzna+]
            
puts $abc "$dyrno $dyrmsg"
            
close $abc
            putserv 
"notice $nick :eklendi \002$dyrno:\002 $dyrmsg"
            
return 0
        
}
  
        
"!dyrsil" {
            if {![
file exists "$dzn"]} {
                
putserv "notice $nick :\002$dzn\002 boş."
                
return 0
            
}
            if {[
llength "$dyrno"] == "0"} {
                
putserv "notice $nick :kullanımı !dyrsil <duyuru-no/duyuru-ismi>."
                
return 0
            
}
            
set abc [open "$dzn"]
            
set lines [split [read -nonewline $abc"\n"]
            
close $abc
            
if {[llength $lines] == "0"} {
                
putserv "notice $nick :\002$dzn\002 boş."
                
return 0
            
}
            
set lines2 ""
            
set say 0
            set satirno 0
            
foreach line $lines {
                if {[
lindex $line 0] == $dyrno} {
                  
set lines2 [lreplace $lines $satirno $satirno]
                  
incr say
                
}
                
incr satirno
            
}
            if {
$say == 0} {
                
putserv "notice $nick :böyle bir duyuru yok: \002$dyrno\002."
                
return 0
            
}
            
set abc [open "$dznw]
            
puts $abc [join $lines2 "\n"]
            
close $abc
            
if {$say == 1} {
                
set s ""
            
} else {
                
set s "s"
            
}
            
putserv "notice $nick :\002$dyrno\002 $say adet$s, duyuru silindi."
        
}
  
        
"!dyrliste" {
       if {![
file exists "$dzn"]} {
                
putserv "notice $nick :\002$dzn\002 boş"
                
return 0
            
}
            
set dyrno 0
            set abc 
[open "$dzn"]
            
set lines [split [read -nonewline $abc"\n"]
            
close $abc
            
if {[llength $lines] == "0"} {
                
putserv "notice $nick :\002$dzn\002 boş"
                
return 0
            
}
            foreach 
line $lines {
                
putserv "notice $nick :\002[lindex $line 0]\002 [lrange $line 1 end]"
            
}
            
putserv "notice $nick :Son"
        
}
        return 
0
    
}
}
proc duyuru:duyur {nick uhost hand text} {
    
set dzn "duyuru.txt"
    
if {![file exists "$dzn"]} {
        return 
0
    
}
    
set dyrno 0
    set abc 
[open "$dzn"]
    
set lines [split [read -nonewline $abc"\n"]
    
close $abc
    
if {[llength $lines] == "0"} {
        return 
0
    
}
    foreach 
line $lines {
        if {[
lindex $line 0] == $text} {
            
putserv "privmsg $nick :[lrange $line 1 end]"
        
}
    }
    }
putlog "burası,   kodun dibidir...." 


saywhat 24 Haziran 2013 09:34

Cevap: !duyuruekle & !duyurucikar
 
-> [Üye Olmadan Linkleri Göremezsiniz. Üye Olmak için TIKLAYIN...]

Kod:

# kullanımı:
# .chanset #kanalınız +duyuru .. ile ayarladığınız kanal üstünde.en az Op'lar için:
# !dyrekle <duyuru-no/duyuru-ismi> duyurunuz...
# !dyrsil <duyuru-no/duyuru-ismi>
# !dyrliste
# özelde herhangi bir botun olduğu kanalda,herhangi bir kullanıcı tarafından kullanılabilecek duyuru komutu:
# <duyuru-no/duyuru-ismi>
# kodun aktif olduğu kanaldaki kanal opları ve üstünün eklemiş olduğu duyuru/ları
# botun özelinde duyuru-ismi yada rakkam ile eklenmişse numarasıyla okuyabilmesini sağlıyor...
# (herhangi bir komutu yada işareti yok.sadece eklediğinizde
# duyurunuza koyduğunuz isim yada numara ile o eklenmiş duyuruyu postalıyor.)
setudef flag duyuru
bind pubm -|- "*" duyuru:pub
bind msgm -|- "*" duyuru:duyur
proc duyuru:pub {nick uhost hand chan text} {
if {![channel get $chan duyuru]} {
    return 0
}
set dyrkmt [lindex [split $text] 0]
set dyrno [lindex [split $text] 1]
set dyrmsg [join [lrange [split $text] 2 end]]
set dzn "duyuru.txt"
    switch -- $dyrkmt {
 
        "!dyrekle" {
      if {![isop $nick $chan]} {
    putserv "privmsg $chan :\00314Bu komutu kullanma yetkiniz yok.\00314"
    return 0
    }
            if {[llength $dyrmsg] == "0"} {
                putserv "notice $nick :\00304kullanımı !dyrekle <duyuru-no/duyuru-ismi> duyurunuz.\00304"
                return 0
            }
            set abc [open "$dzn" a+]
            puts $abc "$dyrno $dyrmsg"
            close $abc
            putserv "notice $nick :eklendi \002$dyrno:\002 $dyrmsg"
            return 0
        }
 
        "!dyrsil" {
      if {![isop $nick $chan]} {
    putserv "privmsg $chan :\00314Bu komutu kullanma yetkiniz yok.\00314"
    return 0
    }
            if {![file exists "$dzn"]} {
                putserv "notice $nick :\002$dzn\002 boş."
                return 0
            }
            if {[llength "$dyrno"] == "0"} {
                putserv "notice $nick :\00304kullanımı !dyrsil <duyuru-no/duyuru-ismi>.\00304"
                return 0
            }
            set abc [open "$dzn"]
            set lines [split [read -nonewline $abc] "\n"]
            close $abc
            if {[llength $lines] == "0"} {
                putserv "notice $nick :\002$dzn\002 boş."
                return 0
            }
            set lines2 ""
            set say 0
            set satirno 0
            foreach line $lines {
                if {[lindex $line 0] == $dyrno} {
                  set lines2 [lreplace $lines $satirno $satirno]
                  incr say
                }
                incr satirno
            }
            if {$say == 0} {
                putserv "notice $nick :böyle bir duyuru yok: \002$dyrno\002."
                return 0
            }
            set abc [open "$dzn" w]
            puts $abc [join $lines2 "\n"]
            close $abc
            if {$say == 1} {
                set s ""
            } else {
                set s "s"
            }
            putserv "notice $nick :\002$dyrno\002 $say adet$s, duyuru silindi."
        }
 
        "!dyrliste" {
      if {![file exists "$dzn"]} {
                putserv "notice $nick :\002$dzn\002 boş"
                return 0
            }
            set dyrno 0
            set abc [open "$dzn"]
            set lines [split [read -nonewline $abc] "\n"]
            close $abc
            if {[llength $lines] == "0"} {
                putserv "notice $nick :\002$dzn\002 boş"
                return 0
            }
            foreach line $lines {
                putserv "notice $nick :\002[lindex $line 0]\002 [lrange $line 1 end]"
            }
            putserv "notice $nick :Son"
        }
        return 0
    }
}
proc duyuru:duyur {nick uhost hand text} {
    set dzn "duyuru.txt"
    if {![file exists "$dzn"]} {
        return 0
    }
    set dyrno 0
    set abc [open "$dzn"]
    set lines [split [read -nonewline $abc] "\n"]
    close $abc
    if {[llength $lines] == "0"} {
        return 0
    }
    foreach line $lines {
        if {[lindex $line 0] == $text} {
            putserv "privmsg $nick :[lrange $line 1 end]"
        }
    }
    }
putlog "burası,  kodun dibidir...."



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

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