Jump to content

For All MTA Nerds: Finally working !trace script!


SanZoR

Recommended Posts

Hello,

i decided to make a woring trace script few days ago, and there it goes:

on *:SIGNAL:mta.connect: { 
!.timer 1 2 mta.text $1 SanZoR's Ultimate !trace Script V1.0 Connected! 
} 
alias gusms.getid { 
  var %id = 0 
  while (%id < 32) { 
    if ($+(*,$2,*) iswm $mta.nick($1,%id)) !return %id 
    !inc %id 
  } 
} 
on *:SIGNAL:mta.command: { 
if ($3 == !info) mta.text $1 SanZoR's !trace script V1.0 
  elseif ($3 == !trace) || ($3 == !lookup) || ($3 == !location) {  
    var %a = $iif((!$4),$2,$iif(($gusms.getid($1,$4) == $null),$2,$v1)) 
     mta.pm $1 $2 Tracing $mta.nick($1,%a) $+ , please wait... 
    gusms.trace $1 %a 
  } 
} 
alias gusms.trace { 
  set %gusms.trace $1 $2 
  if (!$sock(gusms.trace $+ $mta.ip($1,$2))) sockopen gusms.trace $+ $mta.ip($1,$2) 2ip.ru 80 
} 
on *:SOCKOPEN:gusms.trace*:{ 
  tokenize 32 %gusms.trace 
  if ($sockerr > 0) { 
    sockclose $sockname 
    mta.text $1 Trace: An error has occured. 
  } 
  else { 
    sockwrite -n $sockname GET /geoip/?ip= $+ $mta.ip($1,$2) HTTP/1.1 
    sockwrite -n $sockname User-Agent: MSIE 6.0 
    sockwrite -n $sockname Host: 2ip.ru 
    sockwrite $sockname $crlf  
  } 
} 
on *:SOCKCLOSE:gusms.trace*:{ 
  unset %tr.* 
} 
on *:SOCKREAD:gusms.trace*:{ 
  var %t 
  sockread %t 
  if (%go) { 
    unset %go 
    tokenize 32 %gusms.trace 
      mta.text $1 $mta.nick($1,$2) $+ 's Location: $gettok(%t,2-,32) 
    sockclose $sockname 
  } 
  if ([url=http://2ip.ru/flags/]http://2ip.ru/flags/[/url] isin %t) { 
    set %go 1 
  } 
} 

Enjoy! 8)

Link to comment

!.timer 1 2 mta.text $1 SanZoR's Ultimate !trace Script V1.0 Connected! 

Sanzor, nerd, you have forgotten the nick of the guy who's script you edited, haven't you? You even forgot to remove/change some things.

Might work though, with some delay cause of the page is pretty big but w/e. Maybe someday you'll learn to edit other's scripts at least without mistakes..

Link to comment

aaaaaaaaaaaaahahahahahaha,

i dont get it,,, completewhois still works...?

hmmm, guess it doesnt,,, i was sure it did,

my bad indeed.

but i seem to have a trace script from atleast

a month ago that is using 2ip.ru,, so then,,

whats the reason to edit it?

ROFL, actually, it looks very similar to the one you posted lol

anyways, ya, my bad,

Edited by Guest
Link to comment

hm.

some time ago i have edited lil_Toady's trace script to work thru 2ip.ru for DDC server just like this (since dnsstuff/completewhois blocked access).

im a designer, not a scripter, and just tried to make things work. :)

dunno where Sanzor got it, and why he removed the !pmt command tho. guess he took only the "sockread" part.

Link to comment
  • 11 months later...
  • 4 months later...

Hey guys... i know this is a old topic but i got a question.

I tried to edit the trace script from sanzor, so just level 3 (or higher) admins can use it.

Also all messages are shown in a pm now. But i got a problem (i use a PRS.EDIT so i tried it with $prs.level... but now if you type !trace you just can see this message: mta.pm $1 $2 Tracing $mta.nick($1,%a) $+ , please wait...

Here is my "edit"

on *:SIGNAL:mta.connect: { 
!.timer 1 2 mta.text $1 Sanzor´s (edited) !trace script connected 
} 
alias gusms.getid { 
  var %id = 0 
  while (%id < 32) { 
    if ($+(*,$2,*) iswm $mta.nick($1,%id)) !return %id 
    !inc %id 
  } 
} 
on *:SIGNAL:mta.command: { 
if ($3 == !info) mta.text $1 SanZoR's (edited) !trace script V1.0 
  elseif ($3 == !trace) || ($3 == !lookup) || ($3 == !location) { 
    if ($prs.level($1,$2) >= 3) { 
    var %a = $iif((!$4),$2,$iif(($gusms.getid($1,$4) == $null),$2,$v1)) 
     mta.pm $1 $2 Tracing $mta.nick($1,%a) $+ , please wait... 
    gusms.trace $1 %a 
  } 
 } 
} 
alias gusms.trace { 
  set %gusms.trace $1 $2 
  if (!$sock(gusms.trace $+ $mta.ip($1,$2))) sockopen gusms.trace $+ $mta.ip($1,$2) 2ip.ru 80 
} 
on *:SOCKOPEN:gusms.trace*:{ 
  tokenize 32 %gusms.trace 
  if ($sockerr > 0) { 
    sockclose $sockname 
    mta.pm $1 $2 Trace: An error has occured. 
  } 
  else { 
    sockwrite -n $sockname GET /geoip/?ip= $+ $mta.ip($1,$2) HTTP/1.1 
    sockwrite -n $sockname User-Agent: MSIE 6.0 
    sockwrite -n $sockname Host: 2ip.ru 
    sockwrite $sockname $crlf 
  } 
} 
on *:SOCKCLOSE:gusms.trace*:{ 
  unset %tr.* 
} 
on *:SOCKREAD:gusms.trace*:{ 
  var %t 
  sockread %t 
  if (%go) { 
    unset %go 
    tokenize 32 %gusms.trace 
      mta.pm $1 $2 $mta.nick($1,$2) $+ 's Location: $gettok(%t,2-,32) 
    sockclose $sockname 
  } 
  if ([url=http://2ip.ru/flags/]http://2ip.ru/flags/[/url] isin %t) { 
    set %go 1 
  } 
} 
  

I hope somebody can help me!

It also would be cool if there is a cmd like !gtrace so its a $mta.text and all players can see it

Gr. Flemm

Link to comment
  • 3 weeks later...
  • 2 months later...
  • Recently Browsing   0 members

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