Jump to content

Plz, help me Lil Toady!


DiZuM

Recommended Posts

Ok... This is what i wrote. I know what is wrong, so can u tell me what is missed socket?

Ok this is it:

on *:SIGNAL:mta.command:{

var %a = $iif($4,$iif($mta.nick($1,$4) != $null,$4,$mta.getid($1,$4)),$2)

if ($3 == !lookup) {

if (%a == -1) mta.msg $1 $2 Error - Absent ID

else my.trace $1 %a

}

}

alias my.trace {

set %my.trace $1 $2

if (!$sock(my.trace $+ $mta.ip($1,$2))) sockopen my.trace $+ $mta.ip($1,$2) http://www.api.hostip.info 80

}

on *:SOCKOPEN:my.trace*:{

tokenize 32 %my.trace

if ($sockerr > 0) {

sockclose $sockname

mta.text $1 Trace: An error has occured. (socket error)

}

else {

sockwrite -n $sockname GET /get_html.php?ip= $+ $mta.ip($1,$2) $+ &display=whois HTTP/1.1

sockwrite -n $sockname Host: http://www.api.hostip.info

sockwrite -n $sockname Connection: keep-alive

sockwrite $sockname $crlf

}

}

on *:SOCKCLOSE:my.trace*:{

unset %my.trace

}

on *:SOCKREAD:my.trace*:{

var %t

sockread %t

if (Country: isin %trace) {

tokenize 32 %my.trace

mta.text $1 $mta.nick($1,$2) - Country: $gettok(%t,2-,58) - City: $gettok(%t,2-,58)

sockclose $sockname

}

}

I know this is wrong: Country: $gettok(%t,2-,58) - City: $gettok(%t,2-,58)

so can u tell me what is right word there?

Plz, help me =)

Link to comment
on *:SIGNAL:mta.command:{
 var %a = $iif($4,$iif($mta.nick($1,$4) != $null,$4,$mta.getid($1,$4)),$2)
 if ($3 == !lookup) {
   if (%a == -1) mta.msg $1 $2 Error - Absent ID
   else my.trace $1 %a
 }
}
alias my.trace {
 set %my.trace $1 $2
 if (!$sock(my.trace $+ $mta.ip($1,$2))) sockopen my.trace $+ $mta.ip($1,$2) api.hostip.info 80
}
on *:SOCKOPEN:my.trace*:{
 tokenize 32 %my.trace
 if ($sockerr > 0) {
   sockclose $sockname
   mta.text $1 Trace: An error has occured. (socket error)
 }
 else {
   sockwrite -n $sockname GET /get_html.php?ip= $+ $mta.ip($1,$2) $+ &display=whois HTTP/1.1
   sockwrite -n $sockname Host: api.hostip.info
   sockwrite -n $sockname Connection: keep-alive
   sockwrite $sockname $crlf
 }
}
on *:SOCKCLOSE:my.trace*:{
 unset %my.trace
 tokenize 32 %my.trace
 mta.text $1 $mta.nick($1,$2) - Country: $gettok(%my.trace.r,1,32) $+ , City: $gettok(%my.trace.r,2,32)
}
on *:SOCKREAD:my.trace*:{
 var %t
 sockread %t
 if (Country isin %t) {
   set %my.trace.r $iif(Unknown isin %t,Unknown,$gettok(%t,2-,32))
 }
 elseif (City isin %t) {
   set %my.trace.r %my.trace.r $iif(Unknown isin %t,Unknown,$gettok(%t,2-,32))
   sockclose $sockname
 }
} 

Link to comment
  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...