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

 Kayıt ol  Topluluk
1Beğeni(ler)
  • 1 Post By saywhat

Yeni Konu aç Cevapla
 
LinkBack Seçenekler Stil
Alt 23 Eylül 2014, 20:26   #1
Çevrimdışı
Kullanıcıların profil bilgileri misafirlere kapatılmıştır.
IF Ticaret Sayısı: (0)
IF Ticaret Yüzdesi:(%)
wiki.tcl.tk .Tcl




bugün paylaşacağım scriptler ingilizcedir.
her ikiside benzer yapıda oluşturulmuştur. her ikisi de ,ilgi alanı yazılım, programlama ,scripting olanların ilgisini çekebilecek, faydalanabilecekleri türden scriptlerdir.

Her iki script de "yeni" yazılmış değildir. aylar öncesinden "kendime özel" diye yazdığım ve kendi botumda kullanıp faydalandığım scriptlerdendir.


Bu forumdaki linkleri ve resimleri görebilmek için en az 25 mesajınız olması gerekir.

yaptığı iş : wiki.tcl.tk sitesinde sorgulama yapar.
Tcl, Tcl.tk ile ilgilenenlerin işine yarayabileceğini düşündüğümden,şimdi paylaşıyorum....

Kod:   Kodu kopyalamak için üzerine çift tıklayın!
# tcllib http paketi gerektirir. package require http # tcllib htmlparse paketi gerektirir. package require htmlparse # .chanset #kanal +tk ile kanalda aktif edilmelidir. setudef flag tk # erişimi olacak kullanıcı flagları: set tkflag "-|-" # komut başına gelecek işaret: set tksemb "." # arama sonuç çıktısı kaç tane olmalı: set tksay "3" # komut/ları set tkkmt "tw tk tclw tclwiki" # özelde de çalışsın mı ? 1 = evet 0= hayır. set tkmsg 1 # komutlar arası beklenmesi gereken süre (saniye) set tkkontr "10" #ayarların sonu.... foreach bind [split $tkkmt " "] { bind pub $tkflag $tksemb$bind tk_pub if {$tkmsg >= 1} { bind msg $tkflag $tksemb$bind tk_msg } } proc tk_pub {nick uhost hand chan text} { if {![channel get $chan tk]} { return 0 } tk_main $nick $uhost $hand $chan $text } proc tk_msg {nick uhost hand text} { tk_main $nick $uhost $hand $nick $text } proc tk_main {nick uhost hand chan text} { set q [join [lrange [split [string tolower $text]] 0 end]] set host [lindex [split $uhost @] 1] if {[throttled $host,$chan $::tkkontr]} { puthelp "notice $nick :\002Flood detected !!!\002 - \ \00314you have to wait, [expr {[clock seconds] - $::throttled($host,$chan)}] seconds ...\003" return 0 } if {[llength $q] eq "0"} { puthelp "notice $nick :\00304Usage:\003 \002$::lastbind <your search>\002" return 0 } set tkurl "http://wiki.tcl.tk/_/search?" set query [http::formatQuery S $q] append wurl $tkurl $query &_charset_=utf-8 putlog "$wurl" ::http::config -useragent "Mozilla/4.0 (compatible; MSIE 4.01; Windows CE; PPC; 240x320)" set url [::http::geturl $wurl -timeout [expr {6*1000}]] set data [split [::http::data $url] "\n"] ::http::cleanup $url # putserv "privmsg $chan :\026\"$q\"\026 searching...please wait..." regsub -all -- "\n" $data "" data regsub -all -- "\r" $data "" data regsub -all -- "\b" $data "" data regsub -all -- "\t" $data "" data regsub -all -- "\v" $data "" data regsub -all -- "\f" $data "" data regexp {</form><br><b>(.*?)</b>} $data "" bulunmadi if {[info exists bulunmadi] eq "1"} { regsub -all -- "<.*?>" $bulunmadi "" bulunmadi # No matches found, try putting an asterisk (*) at the end to search on prefixes. puthelp "privmsg $chan :\026$q\026 \00303[string trim $bulunmadi]\003" return } set i 0 set sayfa "";set basl ""; set tarh ""; set tire "" ; set konu "" while {[regexp -line {srtitle'><a href='(.*?)'>(.*?)</a>.+srdate'>(.*?)<.+srdate'>(.*?)<.+srsnippet'>(.*?)</span>} $data g sayfa basl tarh tire konu]} { regsub -line {srtitle'><a href='(.*?)'>(.*?)</a>.+srdate'>(.*?)<.+srdate'>(.*?)<.+srsnippet'>(.*?)</span>} $data "" data set cikti "\00304$basl\003 \00312$tarh\003 $tire \037http://wiki.tcl.tk$sayfa\037" regsub -all -- "<.*?>" $cikti "" cikti regsub -all -- "<.*?>" $konu "" konu regsub -all -- \} $konu "" konu regsub -all -- \{ $konu "" konu set konu [string map {\\ ""} $konu] set cikti [string map {\\ ""} $cikti] if {$i == $::tksay} break puthelp "privmsg $chan :[string trim [::htmlparse::mapEscapes $cikti]]" largetext privmsg $chan "\00314[string trim [::htmlparse::mapEscapes $konu]]\003" incr i } return 0 } set authr "\00300,04 \u262A \003 \002\026\u006E\u0072\u0074 \u0028\u0053\u0061\u0079\u0057\u0068\u0061\u0074\u0029\002" # thanks to speechles (EFnet - #roms-isos), master && teacher ... proc largetext {type target text {delims {" "•,.!?}}} { set lineLen [expr {426 - [string length ":$::botname $type [join $target] :\r\n"]}] if {[string length $text] <= $lineLen} { putserv "$type $target :\00314$text\003" return 0 } set _text [split $text $delims] set x 0 set i 0 while {$x < $lineLen} { if {$i >= [llength $_text]} { return 0 } set wordlen [string length [lindex $_text $i]] if {$x + $wordlen > $lineLen} { break } incr x $wordlen incr x incr i } set text [string map {\\\\ \\} $text] putserv "$type $target :\00314[string range $text 0 [expr {$x - 1}]]\003" largetext $type $target [string trimleft [string range $text $x end]] $delims } # http://is.gd/SVU9r1 proc throttled {id time} { global throttled if {[info exists throttled($id)]} { return 1 } { set throttled($id) [clock seconds] utimer $time [list unset throttled($id)] return 0 } } putlog "\00304Tcl Surumu\003 :\00311 $tcl_patchLevel \003- \00304Tcl Dizin\003 :\00311 $tcl_library \003- \00304Eggdrop Surumu\003 :\00311 [lindex $version 0] \003 $authr" putlog "\00304Http Paket Surumu\003 :\00311 [package present http] \003- \00304Sistem Encoding\003 :\00311 [encoding system] \003" putlog "\00304Host\003 :\00311 [info hostname] \003- \00304OS\003 :\00311 $::tcl_platform(os) $::tcl_platform(osVersion)/$::tcl_platform(machine) \003" putlog "\00304PID Numarasi\003 :\00311 [pid] \003- \00304Sunucuya Bagli Oldugu Sure\003 :\00311 [duration [expr {[clock seconds] - ${server-online}}]] \003" putlog "\00304Bot Uptime\003 :\00311 [duration [expr {[clock seconds] - $::uptime}]] \003- \00304Tarih\003 :\00311 [ctime [unixtime]] $::timezone \003" putlog "\00304Irc Gorunumu\003 :\00311 $::botname $::realname \003- \00304Bagli Oldugu Sunucu\003 :\00311 $::serveraddress \003- \00304.Conf Dosyasi\003 :\00311 $::config \003"


 
Alıntı ile Cevapla

IRCForumlari.NET Reklamlar
sohbet odaları sohbet odaları Benimmekan Mobil Sohbet
Cevapla

Etiketler
tcl, wikitcltk


Konuyu Toplam 1 Üye okuyor. (0 Kayıtlı üye ve 1 Misafir)
 

Yetkileriniz
Konu Acma Yetkiniz Yok
Cevap Yazma Yetkiniz Yok
Eklenti Yükleme Yetkiniz Yok
Mesajınızı Değiştirme Yetkiniz Yok

BB code is Açık
Smileler Açık
[IMG] Kodları Açık
HTML-Kodu Kapalı
Trackbacks are Kapalı
Pingbacks are Açık
Refbacks are Açık