Kod
####################################################################################
# shrbulucu.tcl By LeaT[Emre]
# iletişim : destek@cagmanbilisim.com
#
# Kullanım:
# !nerden <nick>/<ip>
# !nerden2 <nick>/<ip>
#
# ..
#-----------------------------------------------------------------------------------
#
## Admin kanalını bilirtiniz..
#
set ip(statchan) "#opers"
#
## Buraya ircd.log dosyanızın yerini yazınız
#
set ip(ircd) "/home/askcenne/Unreal3.2/ircd.log"
#####################################################################################
# !!!!!!BURADAN SONRASINA DOKUNMAYINIZ!!!!!! #
#####################################################################################
set ip(timeout) "10000"
package require http
bind pub - !nerden2 ipgeo
bind pub - !nerden ipwhat
proc ipbul {nick nip type} {
global ip
if {![onchan $nick $ip(statchan)]} {return}
if {$type == "1"} {
set ip(sonuc) 0
bind raw - 352 ipbula
bind raw - 315 ipwhoson
putquick "who +I $nip"
}
if {$type == "2"} {
set ip(sonuc) 0
bind raw - 352 ipbulb
bind raw - 315 ipwhoson
putquick "who +I $nip"
}
if {$type == "3"} {
set ip(sonuc) 0
utimer 2[list bind raw - 352 ipnicka]
utimer 2[list bind raw - 315 ipwhoson]
utimer 2[list putquick "who +i $nip"]
}
}
proc ipnicka {from keyword arg} {
global ip
if {![info exists ip(nickler)]} {
set ip(nickler) ""
}
lappend ip(nickler) [lindex $arg 5]
set ip(sonuc) 1
}
proc ipwhoson {from keyword arg} {
global ip
if {![string match "*ipbula*" [binds]] && ![string match "*ipbulb*" [binds]] && ![string match "*ipnicka*" [binds]]} { return }
if {[info exists ip(nickler)] && [llength $ip(nickler)] > 0 && $ip(sonuc) == 1 } {
putquick "privmsg $ip(statchan) :\00302Bu ip üzerinden şuan bağlı olan nickler:"
if {[llength $ip(nickler)] > 1} { set clone clone } else { set clone kişi }
putquick "privmsg $ip(statchan) :\00312[join $ip(nickler)] \00302Toplam \00303- [llength $ip(nickler)] -\00302 $clone.."
set ip(sonuc) 0
} elseif {$ip(sonuc) != 1 } {
putquick "privmsg $ip(statchan) :\00307Sorguladığınız nick şuan sunucuda bulunmuyor."
}
set ip(nickler) ""
if {[string match -nocase *ipbulb* [binds]]} { unbind raw - 352 ipbulb ; putlog "ipbulb son" }
if {[string match -nocase *ipbula* [binds]]} { unbind raw - 352 ipbula ; putlog "ipbula son" }
if {[string match -nocase *ipnicka* [binds]]} { unbind raw - 352 ipnicka ; putlog "ipnicka son" }
if {[string match -nocase *ipwhoson* [binds]]} { unbind raw - 315 ipwhoson ; putlog "ipwhoson son" }
set ip(sonuc) 0
}
proc ipbula {from keyword arg} {
global ip
set ip(sonuc) 1
ipgeo [lindex $arg 5] uhost hand $ip(statchan) [lindex $arg 3]
}
proc ipbulb {from keyword arg} {
global ip
set ip(sonuc) 1
ipwhat [lindex $arg 5] uhost hand $ip(statchan) [lindex $arg 3]
}
proc nickhist {nip} {
global ip
set data "" ; set nickler ""
set input [open "$ip(ircd)" r]
set input [split [read $input] \n]
foreach curline $input {
set curline [split $curline]
if {$curline != ""} {
if {[string match -nocase *$nip* $curline]} {
regexp {.+ (.+)!.+ .+} $curline match nick
if {[lsearch $nickler $nick] == "-1"} {
lappend nickler $nick
}
}
}
}
catch {close $input}
if {[llength $nickler] > 0} {
putquick "privmsg $ip(statchan) :\00302Bu ip üzerinden daha önce yapılan girişler:"
set i 1
set y [llength $nickler]
while {[expr $y / [expr $i * 25]] > 0} {
putquick "privmsg $ip(statchan) :\00312[join [lrange [lindex $nickler] [expr [expr $i * 25] - 25] [expr [expr $i * 25]-1]]]"
incr i
}
putquick "privmsg $ip(statchan) :\00312[join [lrange [lindex $nickler] [expr [expr $i * 25] - 25] [expr [expr $i * 25]-1]]] \00302Toplam \00303- [llength $nickler] -\00302 kişi.."
}
}
proc ipwhat {nick uhost hand chan text} {
global ip
if {![string match -nocase $chan $ip(statchan)]} {return}
set text [split [string trim $text]]
if {$text == ""} {putquick "PRIVMSG $chan :\SorguLama icin Lütfen Bir Nick veya Bir ip beLirtmeLisiniz/ örnek- !nerden PiSLiCk örnek- 123.456.78.9";return}
if {[regexp {.+\..+\..+\..+} $text] == "0"} {
set nip [lindex $text 0]
ipbul $nick $nip 2
return 0
}
ipbul $nick $text 3
utimer 1[list nickhist $text]
set ipstatsite "http://whatismyipaddress.com/staticpages/index.php/lookup-results?ip="
set sayfa ""
catch {set sayfa [::http::geturl $ipstatsite$text -timeout $ip(timeout)]} error
if {[string match -nocase "*couldn't open socket*" $error]} {
putquick "PRIVMSG $chan :Hata: WhatisMyipaddress.com'a şuan bağlanılamıyor.. Daha Sonra Tekrar Deneyiniz.."
::http::cleanup $sayfa
return
}
if { [::http::status $sayfa] == "timeout" } {
putquick "PRIVMSG $chan :Hata: WhatisMyipaddress.Com'a bağlantı zaman aşımına uğradı.."
::http::cleanup $sayfa
return
}
set html [::http::data $sayfa]
::http::cleanup $sayfa
regexp -- {><TD>Country:</TD><TD>(.*?)<.+} $html - ulke
regexp -- {><TD>City:</TD><TD>(.*?)<} $html - sehir
regexp -- {><TD>State/Region:</TD><TD>(.*?)<} $html - bolge
regexp -- {.+<TR><TD>Type:</TD><TD>(.*?)</TD></TR>.+} $html - type
if {[string match -nocase "*Proxy*" $ulke]} {
set ulke \0034PROXY!
putquick "PRIVMSG $chan :\00312\[$text\] \00302için sorgulama sonuçları: $ulke"
return
}
putquick "PRIVMSG $chan :\00312\[$text\] \00302için sorgulama sonuçları:"
putquick "PRIVMSG $chan :\00304Baglandigi Ülke: \00303$ulke \00304Baglandigi Bölge: \00303$bolge \00304Baglandigi Şehir: \00303$sehir \00304Baglanti Tipi: \00303$type" }
proc ipgeo {nick uhost hand chan text} {
global ip
if {![string match -nocase $chan $ip(statchan)]} {return}
set text [split [string trim $text]]
if {$text == ""} {putquick "PRIVMSG $chan :Bir ip belirtmelisiniz.";return}
if {[regexp {.+\..+\..+\..+} $text] == "0"} {
set nip [lindex $text 0]
ipbul $nick $nip 1
return 0
}
ipbul $nick $text 3
utimer 1[list nickhist $text]
set ipstatsite [::http::formatQuery cid "0" c "0" Template "iplocator.htm" ipaddress "$text"]
set geoipurl "http://www.geobytes.com/IpLocator.htm?GetLocation"
set sayfa ""
catch {set sayfa [::http::geturl $geoipurl -query $ipstatsite -timeout $ip(timeout)]} error
if {[string match -nocase "*couldn't open socket*" $error]} {
putquick "PRIVMSG $chan :Hata: Geobytes.com'a bağlanılamıyor.. Daha sonra tekrar deneyiniz.."
::http::cleanup $sayfa
return
}
if { [::http::status $sayfa] == "timeout" } {
putquick "PRIVMSG $chan :Hata: Geobytes.com'a bağlantı zaman aşımına uğradı.."
::http::cleanup $sayfa
return
}
set html [::http::data $sayfa]
::http::cleanup $sayfa
set country "";set region "";set city "";set certainty ""
if {[regexp {<html><head></head><body>The IP Address that you are currently using: .*? has exceeded} $html]} {
putquick "PRIVMSG $chan :Üzgünüm, geobytes sitesine şuan daha fazla sorgulama yapılamıyor kota doldu.. \002!nerden2\002 komutunu kullanınız.."
return
}
if {[regexp {<p>We are unable to locate the address (.*?) at this time.*?<p>} $html]} {
putquick "PRIVMSG $chan :\00304Üzgünüm \00312\[[join $text]\] \00304bulunamadı."
return
}
regexp {.*?>Country</td>.*? value="(.*?)" .*?>Region</td>.*? value="(.*?)" .*?>City</td>.*? value="(.*?)" .*?>Certainty</td>.*? value="(.*?)" .*?>Is proxy</td>.*? value="(.*?)" .*?} $html match ulke bolge sehir kesinlik proxy
if {$proxy == "true"} {
putquick "PRIVMSG $chan :\00312\[$text\]"
putquick "PRIVMSG $chan :\00302için sorgulama bilgileri: \00305Şehir: \00304$sehir, \00305Bölge: \00304$bolge, \00305Ülke: \00304$ulke. \00305Kesinlik: \00304\%$kesinlik \00302Proxy kullanıyor!"
}
if {$proxy == "false"} {
putquick "PRIVMSG $chan :\00312\[$text\] \00302için sorgulama bilgileri:"
putquick "PRIVMSG $chan :\00305Şehir: \00304$sehir, \00305Bölge: \00304$bolge, \00305Ülke: \00304$ulke. \00305Kesinlik: \00304\%$kesinlik"
}
return
}
putlog "shrbulucu.tcl By PiSLiCk Yüklendi.."
Arsivimde duruyodu keyifli forumlar.