[about]
Dieses Script wurde erstellt von MUTU.
Für mehr Hilfe, Fragen oder Ideen besuche
meine Website http://mutu.cjb.net/.
Bitte spreche mich an bevor Du es in
Dein Script einfügen
und es nutzen tust, ausserdem ändere den
Code nicht......und Bitte verändere dieses
und VERSTELLE nix daran!

[help]
1=MUTU Ban Protection 7.3 Hilfe
2=
3=Installation:
4=If you are seeing this from an mIRC dialog,
5=it means that this script is well installed.
6=
7=To install this script type:
8=/load -rs MUTUBanProt73.ini
9=or if the file is in a folder other than the
10=one of the mIRC executable (mirc32.exe),
11=type in the root of the file too.
12=Eg: /load -rs C:\Addons\MUTUBanProt73.ini
13=There are some initialisation commands,
14=so click Yes when asked to run them.
15=
16=
17=Use:
18=To understand certain elemnts of the
19=interface, especially the 'Capture IP Ban',
20=you need to read further down.
21=The channel exlusion list is to exempt
22=channels of your choice from the protection.
23=To add a channel, type it in the editbox and
24=then press ENTER. To remove a channel,
25=you need to double click on it from the list.
26=
27=
28=Versions:
29=7.3
30=- Removed success channel msg bug that
31=  didn't switch off
32=- Included option to set punishing on or off
33=
34=7.2
35=- Added validation checks for channel names
36=- Removed multiple channel names bug
37=
38=7.11
39=- Removed some bugs from interface
40=
41=7.1
42=- Added mIRC 5.7 compatibilty
43=
44=7.0
45=- Added channel exclusion
46=- Added more options
47=- Removed variables
48=- Keeping options in the addon itself
49=- Removed .wav file because it was too big
50=- Improved interface
51=
52=6.0
53=- removed excess variables
54=- made the script more efficient and fast
55=- added protection for numeric ip address
56=- made a detailed documentation
57=
58=
59=Explanation:
60=The number of combinations in which a user
61=can be banned from a channel is enormous.
62=This is because bans may contain wildcards
63=(* and ?). When we ban we either use the
64=full address (nick!user@host.domain) or a
65=masked address using wildcards.
66=
67=What are wildcards?
68=
69=2 types of wildcards may be used in bans:
70=? stands for any character (? represents
71=just one character)
72=* stands for any characters (* may
73=represent phrases)
74=
75=However the * wildcard may represent
76=nothing at all.
77=
78=You can now imagine how many combinations
79=are available to ban someone.........but
80=that's not all!
81=
82=Banning by numeric IP
83=Your ip address can be in 2 different
84=formats when you do a /whois:
85=alpha (example 24p9.maltanet.net) and
86=numeric (example 194.158.204.50).
87=
88=Now, on some networks, for example
89=UnderNet, if a user's IP address is in
90=alpha you may do a /dns to check the
91=numeric format of the IP address. Then
92=the user may be banned by his numeric
93=IP address even using the wildcards
94=mentioned before.
95=
96=If a user's IP is in numeric and you
97=try to ban his alpha format, the ban
98=won't work, ie the user won't be banned
99=in that channel.
100=
101=Having said that very few people ban
102=using the alternate ip address format,
103=so feel secure enough. These bans are
104=very powerful indeed because most ban
105=protection addons does not protect you
106=against them and if you ban using the
107=mask *!*@numericip, and the user's IP
108=address (when you do a /whois) is in
109=alpha, then feel assured that no one
110=will notice who you'd just banned.
111=
112=But don't expect that you'll never be
113=banned from a channel again. To defend
114=yourself you must have operator status
115=in that channel and you must unban
116=yourself and punish the agressor before
117=you're kicked or deoped.
118=
119=Therefore a fast kick followed by a
120=ban is impossible to protect against
121=unless you re-enter and get ops before
122=you're banned and kicked again. Note
123=also that if you're banned before you
124=get ops, you won't automatically unban
125=yourself when you get ops so you'll
126=have to do it manually. Maybe I'll
127=include this in a future release.....
128=
129=When you're banned from a channel
130=it's not the end of the world. Check
131=the mask you're banned with. Sometimes
132=you'll just need to check your nick or,
133=more commonly, just your user id
134=(file > options > connect > identd
135=In this case you'll have to reconnect
136=to your server for the change to work)
137=and if your domain is banned while
138=you're on a dial-up service, you'll
139=just need to reconnect to your ISP.
140=However if you're using a cable modem
141=or sattelite or anything they'll
142=invent in the future which doesn't
143=provide you with a dynamic IP address
144=you'll have to connect to a wingate
145=and spoof......but I won't go into
146=detail with that.
147=
148=
149=THE AUTHOR OF THIS ADDON IS NOT
150=RESPONSIBLE IN ANY WAY FOR ANY
151=DAMAGE TO COMPUTERS OR FOR ANY
152=MORAL OR PSYCHOLOGICAL DAMAGE TO
153=ANYONE. THIS SCRIPT IS NOT INTENDED
154=TO MAKE IT EASIER FOR TAKEOVERS
155=BUT TO LET YOU FEEL MORE SECURE IN
155=YOUR OWN CHANNEL.
156=
157=MUTU (19/7/2000)

[version]
Version=7.3

[settings]
Status=ON
UnBan=ON
Capture=ON
Punishment=DEOP
BanInform=ON
FailInform=ON
SuccessMsg=ON
Punish=ON

[excluded]
num=0

[script]
n0=;IP Locator
n1=dialog locate {
n2=  title "IP Locator (keine 100% Garantie)"
n3=  size -1 -1 134 93
n4=  option dbu notheme
n5=  text "IP Adresse", 1, 4 4 26 8, right
n6=  edit "", 2, 32 2 62 11
n7=  button "Suche", 3, 96 2 34 11
n8=  text "Status", 4, 4 16 25 8, right
n9=  edit "", 5, 32 14 62 11, read
n10=  text "Stadt", 6, 4 34 25 8, right
n11=  text "State", 7, 4 43 25 8, right
n12=  text "Land", 8, 4 52 25 8, right
n13=  text "ISP", 9, 4 61 25 8, right
n14=  text "", 10, 32 34 98 8
n15=  text "", 11, 32 43 98 8
n16=  text "", 12, 32 52 98 8
n17=  text "", 13, 32 61 98 8
n18=  button "Clipboard", 14, 62 78 34 11
n19=  button "OK", 15, 96 78 34 11, ok
n20=  box "", 16, -4 25 142 4
n21=  box "", 17, -3 70 142 4
n22=}
n23=
n24=;============================== ALIASES
n25=
n26=alias -l locate {
n27=  if ($1) {
n28=    did -ra locate 5 Opening socket...
n29=    did -r locate 10,11,12,13
n30=    sockclose locate
n31=    sockopen locate www.melissadata.com 80
n32=    sockmark locate $1-
n33=  }
n34=  else {
n35=    dialog $iif($dialog(locate),-x,-m) locate locate
n36=  }
n37=}
n38=alias -l striphtml {
n39=  var %txt = $mid($1-,1,800)
n40=  var %p = 1, %b = $replace(%txt,$chr(38),$+($chr(32),$chr(38)),;,$+(;,$chr(32)),>,$+(>,$chr(32)),<,$+($chr(32),<,)), %c
n41=  while ($gettok(%b,%p,32)) {
n42=    %c = $ifmatch
n43=    if (*<* iswm %c || *&*; iswm %c || *</* iswm %c || *solid* iswm %c || *px* iswm %c || *:* iswm %c && $remove(%c,:) !isnum || */* iswm %c || *'* iswm %c || *;* iswm %c || *&* iswm %c || *<*>* iswm %c || *=* iswm %c || *"* iswm %c || *>* iswm %c || $+(*,$chr(40),*) iswm %c || $+(*,$chr(41),*) iswm %c || $+(*,$chr(123),*) iswm %c || $+(*,$chr(125),*) iswm %c) { %b = $remove(%b,%c) | %p = 0 }
n44=    inc %p
n45=  }
n46=  return %b
n47=}
n48=alias -l endlocate {
n49=  did -ra locate 5 Transaction complete.
n50=  if (%ip) { did -ra locate 10 %city | did -ra locate 11 %state | did -ra locate 12 %country | did -ra locate 13 %isp }
n51=  else { did -r locate 10,11,12,13 | did -ra locate 5 Nothing found. }
n52=  unset %isp
n53=  unset %ip
n54=  unset %city
n55=  unset %state
n56=  unset %country
n57=  unset %isp
n58=}
n59=
n60=;============================== EVENTS
n61=
n62=on *:dialog:locate:sclick:14:{
n63=  var %a = IP: $did(2).text City: $did(10).text State: $did(11).text Country: $did(12).text ISP: $did(13).text
n64=  clipboard %a
n65=}
n66=on *:dialog:locate:sclick:3:{
n67=  if (!$did(2).text) { beep | return }
n68=  locate $did(2).text
n69=}
n70=on *:sockopen:locate:{
n71=  if ($sockerr > 0 && $dialog(locate)) { did -ra locate 5 Socket Open Error(s). | did -r locate 10,11,12,13 | return }
n72=  sockwrite -n $sockname GET $+(/lookups/iplocation.asp?ipaddress=,$sock($sockname).mark) HTTP/1.1
n73=  sockwrite -n $sockname Host: $+(www.melissadata.com,$str($crlf, 2))
n74=  sockwrite -n $sockname Connection: keep-alive
n75=}
n76=on *:sockread:locate:{
n77=  if ($sockerr > 0 && $dialog(locate)) { did -ra locate 5 Socket Read Error(s). | did -r locate 10,11,12,13 | return }
n78=  var %q
n79=  sockread %q
n80=  tokenize 32 $striphtml(%q)
n81=  did -ra locate 5 Reading data...
n82=  if (* IP Address *.*.*.* iswm $1-) { %ip = $4 }
n83=  if (* City * iswm $1-) { %city = $3- }
n84=  if (* State or Region * iswm $1-) { %state = $5- }
n85=  if (* Country * iswm $1-) { %country = $3- }
n86=  if (* ISP * iswm $1-) { %ISP = $3- }
n87=  .timertrace -o 1 1 endlocate $sock($sockname).mark
n88=}
n89=;IP Check
n90=alias ipcheck {
n91=  set %~~IP2.DNS $true
n92=  echo 2 -a -
n93=  if ($regex($$1, \.)) set -U0 %~~IP2.address $$1
n94=  else {
n95=    whois $$1 $$1
n96=    set -U0 %~~IP2.address $remove($address($$1,2), $chr(33), $chr(42), $chr(64))
n97=    if (%~~IP2.address == $null) {
n98=
n99=      echo 2 -a - Please try again.
n100=      return
n101=    }
n102=    echo 2 -a * Nickname: $$1 
n103=  }
n104=  if ($regex(%~~IP2.address, [a-z]|[A-Z])) {
n105=    .dns -c %~~IP2.address
n106=  }
n107=  else {
n108=    $IP2(%~~IP2.address)
n109=  }
n110=}
n111=
n112=alias -l IP2 {
n113=  set %~~IP2.ip $$1
n114=  sockclose IP2
n115=  sockopen IP2 api.hostip.info 80 
n116=}
n117=
n118=
n119=on 1:DNS:{
n120=  if (%~~IP2.DNS) { 
n121=    if ($raddress == $null) {
n122=      echo 2 -a Unable to resolve hostname
n123=      halt
n124=    }
n125=    var %n = $dns(0)
n126=    echo 2 -a * Host: %~~IP2.address
n127=    while (%n > 0) {
n128=      $IP2($dns(%n).ip) 
n129=      dec %n
n130=    }
n131=  }
n132=}
n133=
n134=On *:sockopen:IP2: {
n135=  Sockwrite -tn $Sockname GET $+(http://api.hostip.info/get_html.php?ip=,%~~IP2.ip,) HTTP/1.1
n136=  Sockwrite -tn $Sockname Host: api.hostip.info $+ $Str($Crlf,2)
n137=  Sockwrite -tn $Sockname User-Agent: mIRC $version [chenghwa]
n138=  Sockwrite -tn $Sockname $Crlf
n139=  echo 2 -a * IP: %~~IP2.ip
n140=}
n141=
n142=On *:Sockread:IP2: {
n143=  If ($Sockerr) { Sockclose $Sockname | Echo -a An error has occured: $Sockerr | Halt }
n144=  Sockread -f %~~IP2.sockread 
n145=  while ($sockbr != 0) {
n146=    if ((Country* iswm %~~IP2.sockread) || (City* iswm %~~IP2.sockread)) {
n147=      echo 2 -a * %~~IP2.sockread
n148=    }
n149=    Sockread -f %~~IP2.sockread 
n150=  }
n151=  echo 2 -a -
n152=}
n153=; Ende IP Check
n154=alias ripe {
n155=  set %ripe_sockname ripe_socket
n156=  set %ripe_window @ripe
n157=  window %ripe_window
n158=  if ($sock(%ripe_sockname).status == active) {
n159=    ripe_sock_msg close $sock(%ripe_sockname).ip $+ : $+ $sock(%ripe_sockname).port Connection reset. was still active
n160=    sockclose %ripe_sockname
n161=  }
n162=  if ($1) {
n163=    set %domain $1
n164=    sockopen %ripe_sockname whois.ripe.net 43
n165=  }
n166=  else {
n167=    ripe_sock_msg syntax
n168=  }
n169=}
n170=
n171=ON *:SOCKOPEN:%ripe_sockname: { 
n172=  ripe_sock_msg open $sock($sockname).ip
n173=  sockwrite -n $sockname %domain
n174=  unset %domain
n175=}
n176=
n177=ON *:SOCKCLOSE:%ripe_sockname: {
n178=  ripe_sock_msg close $sock($sockname).ip $+ : $+ $sock($sockname).port Connection closed by peer
n179=}
n180=
n181=ON *:SOCKREAD:%ripe_sockname: {
n182=  while ($sockerr == 0) {
n183=    sockread -f %ripe
n184=    if ($sockbr == 0) { return }
n185=    if (%ripe) { ripe_sock_msg read %ripe }
n186=  }
n187=  ripe_sock_msg close $sock($sockname).ip $+ : $+ $sock($sockname).port Connection closed. Data recieved
n188=  sockclose $sockname
n189=}
n190=
n191=alias ripe_sock_msg {
n192=  tokenize 32 $1-
n193=  if ($1 == syntax) { echo $color(notice) %ripe_window *** Keine Domain angegeben. Syntax: /ripe <doamin> }
n194=  elseif ($1 == open) { echo $color(notice) %ripe_window *** Verbindung zu $2 hergestellt. }
n195=  elseif ($1 == close) { echo $color(notice) %ripe_window *** Verbindung von $2 getrennt ( $+ $3- $+ ) }
n196=  elseif ($1 == read) { echo %ripe_window %ripe }
n197=}
n198=;*IRCecho
n199=on ^1:TEXT:!!*:#s2r: {
n200=  if ( $nick == OperServ ) {
n201=    echo -a 4,1 #s2r  $+ $timestamp  $+ $chr(12) $2-
n202=  }
n203=  haltdef
n204=  halt
n205=}
n206=on ^1:TEXT:CS*:#s2r: {
n207=  if ( $nick == OperServ ) {
n208=    if ( $2 == X ) { echo -a 4,1 #s2r  $+ $timestamp  $+ $chr(25) $+ $chr(6) Channel $3 Expired | haltdef | halt }
n209=    if ( $2 == BOT ) $$ ( $4 != unset ) { echo -a 4,1 #s2r  $+ $timestamp  $+ $chr(25) $+ $chr(6) Bot named $5 assigned to $3 | haltdef | halt }
n210=    if ( $2 == BOT ) $$ ( $4 == unset ) { echo -a 4,1 #s2r  $+ $timestamp  $+ $chr(25) $+ $chr(6) All Bots removed from $3 | haltdef | halt }
n211=  }
n212=}
n213=on ^1:TEXT:NS*:#s2r: {
n214=  if ( $nick == OperServ ) {
n215=    if ( $2 == X ) { echo -a 4,1 #s2r  $+ $timestamp  $+ $chr(25) $+ $chr(6) Nick $3 Deleted/Expired | haltdef | halt }
n216=    if ( $2 == XE ) { echo -a 4,1 #s2r  $+ $timestamp  $+ $chr(25) $+ $chr(6) Nick $3 Expired | haltdef | halt }
n217=    if ( $2 == R ) { echo -a 4,1 #s2r  $+ $timestamp  $+ Nick $3 has been Registered by $4 | haltdef | halt }
n218=    if ( $2 == I ) { echo -a 4,1 #s2r  $+ $timestamp  $+ User $3 has identified to nickserv | haltdef | halt }
n219=    if ( $2 == *I ) { echo -a 4,1 #s2r  $+ $timestamp  $+ User $3 has failed identifying to nickserv $5- | haltdef | halt }
n220=    if ( $2 == D ) { echo -a 4,1 #s2r  $+ $timestamp  $+ User $3 has been dropped by $4- | haltdef | halt }
n221=    if ( $2 == *D ) { echo -a 4,1 #s2r  $+ $timestamp  $+ User $3 has NOT been dropped by $4 $+ . Reason: $5- | haltdef | halt }
n222=    if ( $2 == G ) { echo -a 4,1 #s2r  $+ $timestamp  $+ User $3 used GETPASS on $4- | haltdef | halt }
n223=    if ( $2 == +M ) { echo -a 9,1 #s2r  $+ $timestamp  $+ User $3 was marked by $4- | haltdef | halt }
n224=    if ( $2 == -M ) { echo -a 9,1 #s2r  $+ $timestamp  $+ User $3 was unmarked by $4- | haltdef | halt }
n225=    if ( $2 == +H ) { echo -a 9,1 #s2r  $+ $timestamp  $+ User $3 have HOLD Flag by $4- | haltdef | halt }
n226=    if ( $2 == -H ) { echo -a 9,1 #s2r  $+ $timestamp  $+ User $3 was unhold by $4- | haltdef | halt }
n227=  }
n228=}
n229=on ^1:TEXT:HO*:#s2r: {
n230=  if ( $nick == OperServ ) {
n231=    if ( $2 == D ) { echo -a 4,1 #s2r  $+ $timestamp  $+ User $3 removed from Host list by $4- | haltdef | halt }
n232=    if ( $2 == A ) { echo -a 4,1 #s2r  $+ $timestamp  $+ User $3 added into auto change host list with $4- | haltdef | halt }
n233=    if ( $2 == L ) { echo -a 4,1 #s2r  $+ $timestamp  $+ Current Host List by $4- | haltdef | halt }
n234=  }
n235=}
n236=on ^1:TEXT:ADS*:#s2r: {
n237=  if ( $nick == OperServ ) {
n238=    if ( $3 == [help] ) { echo -a 4,1 #s2r  $+ $timestamp  $+ AdminServ-Help requested by $ial($remove($2,$chr(40),$chr(41))).nick  $2 | haltdef | halt }
n239=    if ( $3 == [whois] ) { echo -a 4,1 #s2r  $+ $timestamp  $+ AdminServ-Whois made by $ial($remove($2,$chr(40),$chr(41))).nick | haltdef | halt }
n240=  }
n241=}
n242=on ^1:TEXT:HS*:#s2r: {
n243=  if ( $nick == OperServ ) {
n244=    if ( $2 == *H ) { echo -a 4,1 #s2r  $+ $timestamp  $+ Helpserv use Failed. User: $3 Service: $remove($4,[) Topic: $remove( $5- ,]) | haltdef | halt }
n245=  }
n246=}
n247=on ^1:TEXT:OS*:#s2r: {
n248=  if ( $nick == OperServ ) {
n249=    if ( $3 == [help] ) { echo -a 4,1 #s2r  $+ $timestamp  $+ OperServ-Help requested by $ial($remove($2,$chr(40),$chr(41))).nick  $2 | haltdef | halt }
n250=    if ( $3 == [help ) { echo -a 4,1 #s2r  $+ $timestamp  $+ Operserv-Help requested by $ial($2) $2 Topic: $remove($4-,]) | haltdef | halt }
n251=  }
n252=}
n253=on ^1:TEXT:MS*:#s2r: {
n254=  if ( $nick == OperServ ) {
n255=    if ( $2 == X ) { echo -a 4,1 #s2r  $+ $timestamp  $+ $chr(25) $+ $chr(6) Memo $4 for $3 expired/deleted | haltdef | halt }
n256=  }
n257=}
n258=on ^1:TEXT:*Adword*:#s2r: {
n259=  echo -a 15,1 #s2r  $+ $timestamp  $+ $chr(25) $+ $chr(6) Adword: $2-
n260=}
n261=
n262=on ^1:TEXT:!newpass:#klärung: {
n263=  mode #klärung +k $rand(a,z) $+ $rand(a,z) $+ $rand(a,z) $+ $rand(a,z) $+ $rand(0,999)
n264=}
n265=;*IRCecho ende
n266=
n267=;*Backlink checker
n268=#
n269=# Backlink Checker
n270=# Script by Cole
n271=#
n272=
n273=alias blcheck {
n274=  sockclose blcheck
n275=  sockopen blcheck de.search.yahoo.com 80 
n276=}
n277=
n278=on *:sockopen:blcheck:{
n279=  if ( $sockerr ) { echo -a Falsche IP oder falscher Port angegeben! | halt }
n280=  sockwrite -n $sockname GET /search?p=linkdomain%3A $+ %bl_url $+ &prssweb=Suche&ei=UTF-8&fr=sfp&fl=0&vc=&x=wrt&meta=vl%3D HTTP/1.1
n281=  sockwrite -n $sockname Host: de.search.yahoo.com
n282=  sockwrite -n $sockname $crlf
n283=
n284=}
n285=
n286=on *:SOCKREAD:blcheck: {
n287=  :read
n288=  sockread &temp
n289=  bwrite blcheck.txt -1 -1 &temp
n290=  if ( $sockbr) goto read
n291=}
n292=
n293=on *:SOCKCLOSE:blcheck: {
n294=  set %parseline $read(blcheck.txt, w, *von ungefähr*)
n295=  set %backlinks $gettok($gettok(%parseline, 8,62),1,60)
n296=  %blout Backlinks für %bl_url $+ :  %backlinks 
n297=  remove blcheck.txt
n298=}
n299=
n300=on *:text:!bl*:#: {
n301=  set %bl_url $$2
n302=  set %blout msg $chan
n303=  blcheck
n304=}
n305=
n306=alias bl {
n307=  set %bl_url $$1
n308=  set %blout echo -a 
n309=  blcheck
n310=}
n311=;*Ende Backlink Check
n312=
n313=;*AlexaRank
n314=#
n315=# Alexa Traffic Rank
n316=# Script by Cole
n317=#
n318=
n319=alias alexa {
n320=  sockclose alexa
n321=  sockopen alexa www.alexa.com 80 
n322=}
n323=
n324=on *:sockopen:alexa:{
n325=  if ( $sockerr ) { echo -a Falsche IP oder falscher Port angegeben! | halt }
n326=  sockwrite -n $sockname GET /data/details/main?q=&url= $+ %alexa HTTP/1.1
n327=  sockwrite -n $sockname Host: www.alexa.com
n328=  sockwrite -n $sockname $crlf
n329=
n330=}
n331=
n332=on *:SOCKREAD:alexa: {
n333=  :read
n334=  sockread &temp
n335=  bwrite alexa.txt -1 -1 &temp
n336=  if ( $sockbr) goto read
n337=}
n338=
n339=on *:SOCKCLOSE:alexa: {
n340=  set %alexa_result $read(alexa.txt, w, *Did you know*)
n341=  set %alexa_rank $gettok($gettok(%alexa_result, 2, 62),1,60)
n342=  msg %alexachan Alexa Traffic Rank für %alexa $+ :  %alexa_rank 
n343=  remove alexa.txt
n344=}
n345=
n346=on *:text:!alexa*:#: {
n347=  set %alexa $2
n348=  set %alexachan $chan
n349=  alexa
n350=}
n351=;*Ende AlexaRank
n352=alias ClassC {
n353=  ;This alias will return Class C of the given ip
n354=  ;Example: $ClassC(127.0.0.9) will return 127.0.0.*
n355=  if ($isid) {
n356=    if ($1) {
n357=      ;checking if ip's structure is valid.
n358=      if (*.*.*.* iswm $1) {
n359=        if ($isip($1)) {
n360=          return $+($GetNum($1,1),.,$GetNum($1,2),.,$GetNum($1,3),.,*)
n361=        }
n362=        else {
n363=          return invalid
n364=          halt
n365=        }
n366=      }
n367=      else {
n368=        return $1
n369=      }
n370=    }
n371=    else {
n372=      echo $color(info) -at * /ClassC: insufficient parameters
n373=      halt
n374=    }
n375=  }
n376=}
n377=
n378=alias -l isIP {
n379=  ;Matches 0.0.0.0 through 255.255.255.255
n380=  ;Use this regex to match IP numbers with accurracy, without access to the individual IP numbers.
n381=  var %sub = \b(?:(?:25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)\.){3}(?:25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)\b
n382=  if ($regex($1,%sub)) {
n383=    return $true
n384=  }
n385=  else {
n386=    return $false
n387=  }
n388=}
n389=
n390=alias -l GetNum {
n391=  return $gettok($1,$2,46)
n392=}
n393=
n394=on *:DNS:{
n395=  if ($raddress) {
n396=    if ($raddress isnum) {
n397=      write " $+ $scriptdirdns.tmp $+ " $raddress
n398=      traceip
n399=    }
n400=    else { 
n401=      var %tot = $dns(0)
n402=      var %i = 1
n403=      if (%tot > 1) {
n404=        while (%i <= %tot) {
n405=          write " $+ $scriptdirdns.tmp $+ " $dns(%i).ip
n406=          inc %i
n407=        }
n408=        traceip
n409=      }
n410=      else {
n411=        write " $+ $scriptdirdns.tmp $+ " $raddress
n412=        traceip
n413=      }
n414=    }
n415=  }
n416=  else {
n417=    if ($dns(0) isnum) {
n418=      write " $+ $scriptdirdns.tmp $+ " $dns(0).ip
n419=      traceip
n420=    }
n421=    else {
n422=      write " $+ $scriptdirdns.tmp $+ " $dns(0).addr
n423=      traceip 
n424=    }
n425=  }
n426=}
n427=
n428=alias traceip {
n429=  if ($1) {
n430=    if ($1 == -r && $2) {
n431=      if ($ini(" $+ $scriptdirdns.cache.ini $+ ",$ClassC($2)) != 0) {
n432=        remini -n " $+ $scriptdirdns.cache.ini $+ " $ClassC($2)
n433=        if ($show) {
n434=          echo $color(info) -at * /traceip: removed $ClassC($2) from the cache.
n435=        }
n436=      }
n437=      else {
n438=        if ($show) {
n439=          echo $color(info) -at * /traceip: couldn't find $ClassC($2) $+ .
n440=          halt
n441=        }
n442=      }
n443=    }
n444=    elseif ($1 == -u) {
n445=      if (!$sock(update.traceip)) {
n446=        sockopen update.traceip iptracer.sialkoti.com 80
n447=        if ($show) {
n448=          echo $color(info) -at * /traceip: Update is in progress...
n449=        }
n450=      }
n451=      else { 
n452=        if ($show) {
n453=          echo $color(info) -at * /traceip: Update is alredy in progress.
n454=          halt
n455=        }
n456=      }
n457=    }
n458=    else {
n459=      set %ip $1
n460=      :check1
n461=      if ($exists(" $+ $scriptdirdns.cache.ini $+ ")) {
n462=        if ($isip($1)) {
n463=          if ($ini(" $+ $scriptdirdns.cache.ini $+ ",$ClassC($1)) != 0) {
n464=            if ($readini(" $+ $scriptdirdns.cache.ini $+ ",$ClassC($1),location) != unresolved) {
n465=              if ($show) {
n466=                echo $color(other) -at [CACHED] $1 is $readini(" $+ $scriptdirdns.cache.ini $+ ",$ClassC($1),location)
n467=                halt
n468=              }
n469=            }
n470=            else {
n471=              goto w00t
n472=            }
n473=          }
n474=          else {
n475=            writeini -n " $+ $scriptdirdns.cache.ini $+ " $ClassC($1) location unresolved
n476=            :w00t
n477=            if (!$sock(traceip $+ %ip)) { 
n478=              sockopen traceip $+ %ip www.dnsstuff.com 80 
n479=            }
n480=          }
n481=        }
n482=        else {
n483=          if (!$sock(traceip $+ %ip)) { 
n484=            sockopen traceip $+ %ip www.dnsstuff.com 80 
n485=          }
n486=        }
n487=      }
n488=      else {
n489=        write -c " $+ $scriptdirdns.cache.ini $+ "
n490=        goto check1
n491=      }
n492=    }
n493=  }
n494=  else {
n495=    if ($exists(" $+ $scriptdirdns.tmp $+ ")) {
n496=      var %i = 1
n497=      if ($lines(" $+ $scriptdirdns.tmp $+ ") > 0) {
n498=        if ($show) {
n499=          .timerechoips -m 1 1 echo $color(other) -at * /traceip: Going to trace $lines(" $+ $scriptdirdns.tmp $+ ") $iif($lines(" $+ $scriptdirdns.tmp $+ ") > 1,IP's or Hosts,IP or Host) $+ ...
n500=        }        
n501=        while (%i <= $lines(" $+ $scriptdirdns.tmp $+ ")) {
n502=          .timertraceip $+ $read(" $+ $scriptdirdns.tmp $+ ",%i) 1 %i traceip $read(" $+ $scriptdirdns.tmp $+ ",%i)
n503=          inc %i
n504=        }
n505=      }
n506=      .remove " $+ $scriptdirdns.tmp $+ "
n507=    }
n508=    else {
n509=      echo $color(info) -at * /traceip: insufficient parameters
n510=    }
n511=  }
n512=}
n513=
n514=on *:SOCKOPEN:update.traceip:{
n515=  if ($sockerr > 0) {
n516=    sockclose $sockname
n517=    echo $color(info) -at * /traceip (update): An error has occured.
n518=    if ($sockerr == 3) {                                                     
n519=      if (!$sock($sockname)) {
n520=        sockopen update.traceip iptracer.sialkoti.com 80 
n521=      }
n522=    }
n523=  }
n524=  else {
n525=    sockwrite -n $sockname GET /scripts/IPTracer/dns.cache.ini HTTP/1.0
n526=    sockwrite -n $sockname Host: iptracer.sialkoti.com
n527=    sockwrite -n $sockname ACCEPT: *.*
n528=    sockwrite $sockname $crlf 
n529=    %ip.line = 0
n530=    .remove " $+ $scriptdirtempdns.cache.ini $+ "
n531=  }
n532=}
n533=
n534=on *:SOCKREAD:update.traceip:{
n535=  if (%ip.line <= 9) { 
n536=    sockread %update
n537=    tokenize 32 %update
n538=    if ($1 == Content-Length:) {
n539=      if ($calc($2 - $file(" $+ $scriptdirdns.cache.ini $+ ").size) > 0) {
n540=        set %allow.update $true
n541=      }
n542=    }
n543=    inc %ip.line 
n544=  }
n545=  else { 
n546=    if (%allow.update) {
n547=      sockread &update
n548=      bwrite " $+ $scriptdirtempdns.cache.ini $+ " -1 &update
n549=      unset %ip.line 
n550=    }
n551=    else {
n552=      sockclose $sockname
n553=      echo $color(info) -at /traceip (update): Your cache is bigger than the internet cache. There are $ini(" $+ $scriptdirdns.cache.ini $+ ",0) zones in your cache. Aborted
n554=    }
n555=  }
n556=  unset %update 
n557=  bunset &update
n558=}
n559=
n560=alias -l ask.for {
n561=  if ($?!="There are less/same IP's in the updated file. Do you wish to replace your cache anyway?" == $true) {
n562=    return $true
n563=  }
n564=  else {
n565=    return $false
n566=  }
n567=}
n568=
n569=on *:SOCKCLOSE:update.traceip:{
n570=  .timerdo.update -m 1 1 do.update
n571=  unset %allow.update
n572=}
n573=
n574=alias -l do.update {
n575=  var %total = $calc($ini($scriptdirtempdns.cache.ini,0) - $ini($scriptdirdns.cache.ini,0))
n576=  .remove " $+ $scriptdirdns.cache.ini $+ "
n577=  .rename " $+ $scriptdirtempdns.cache.ini $+ " " $+ $scriptdirdns.cache.ini $+ "
n578=  echo $color(info) -at /traceip (update): Update succeeded! There are $ini(" $+ $scriptdirdns.cache.ini $+ ",0) zones in the cache now. Total %total zones added.
n579=}
n580=
n581=on *:SOCKOPEN:traceip*:{
n582=  if ($sockerr > 0) {
n583=    sockclose $sockname
n584=    echo $color(info) -at * /traceip: An error has occured.
n585=    if ($sockerr == 3) {                                                     
n586=      if (!$sock($sockname)) { sockopen traceip $+ %ip www.dnsstuff.com 80 }
n587=    }
n588=  }
n589=  else {
n590=    sockwrite -n $sockname GET /tools/city.ch?ip= $+ %ip HTTP/1.1
n591=    sockwrite -n $sockname Host: www.dnsstuff.com
n592=    sockwrite -n $sockname User-Agent: IPTracer/1.0 (Windows; U; Windows NT 5.1; en-US; rv:0.0.0.0) Newton/16430104 IPTracer/1.0 
n593=    sockwrite -n $sockname Connection: keep-alive 
n594=    sockwrite $sockname $crlf 
n595=    set %iptracer.flag 0
n596=  }
n597=}
n598=
n599=on *:SOCKCLOSE:traceip*:{
n600=  if (!%ip) { echo $color(info) -at * /traceip: An error has occured. }
n601=  unset %iptracer.c, %iptracer.ip
n602=}
n603=
n604=on *:SOCKREAD:traceip*:{
n605=  sockread %trace
n606=  if ($len(%trace) < 75) { 
n607=    tokenize 32 %trace 
n608=    ;
n609=    ;echo -a %trace
n610=    ;
n611=    ;Remove ';' from the echo command above for debug purposes.
n612=    if (IP: isin %trace) {
n613=      set %iptracer.flag 1
n614=      set %iptracer.ip $2-
n615=    }
n616=    elseif (Country: isin %trace && %iptracer.flag == 1) {
n617=      set %iptracer.c $remove($2-,[,],(High))
n618=    }
n619=    elseif (City: isin %trace && %iptracer.flag == 1) {
n620=      echo $color(other) -at %iptracer.ip is %iptracer.c (City: $2- $+ )
n621=      if ($isip(%iptracer.ip) && *do not abuse DNSstuff.com* !iswm %trace && %trace != (City: Unknown)) {
n622=        writeini -n " $+ $scriptdirdns.cache.ini $+ " $ClassC(%iptracer.ip) location %iptracer.c (City: $2- $+ )
n623=      }
n624=      sockclose $sockname
n625=    }
n626=    unset %trace
n627=    .timerruns 1 1 unset %ip
n628=  }
n629=}
