Jump to content

My Script doesn't seem compatible with mtama :/


damnet007

Recommended Posts

Posted

on *:DNS:{
 if (%cc == 1) {
   !tokenize 32 %gh 
   if ($1) {
     if ($dns(0).addr) mta.msg $1 %pff $mta.name($1,$2) $+ 's host: $dns(0).addr
     mta.msg $1 %pff Main: $gettok($dns(0).addr,2-6,46))
     else mta.msg $1 %pff Unable to resolve $mta.name($1,$2) $+ 's host.
   }
   unset %gh
 }
 elseif (%cc == 2) {
   !tokenize 32 %gh 
   if ($1) {
     if $readini(badnicks.ini,hosts,$gettok($dns(0).addr,2-6,46)) == 1 {
       mta.kick $1 $2
     }
     unset %gh
   }
 }
}
on *:SIGNAL:mta.command:{
 var %a = $iif($4,$iif($mta.name($1,$4) != Unknown,$4,$mta.getid($1,$4)),$2)
 if ($3 == !host) {
   set %gh $1 %a
   set %pff $2
   set %cc 1
   !.dns $mta.ip($1,%a) 
 }
}
on *:SIGNAL:mta.join:{
 set %gh $1 $2
 !.dns $mta.ip($1,$2)
 set %cc 2
}

I can check my host fine but if i were to check another user's host I get an mtama crc check error, any ideas?

Posted

you call the dns alias then set %cc so it will never do anything in the dns alias, other than that, someone else will come along and point out any problems

Posted
you call the dns alias then set %cc so it will never do anything in the dns alias, other than that, someone else will come along and point out any problems

ah ye woops, i'll change that and retry, thanx.

EDIT: %cc is already set before dns is called on the command signal though, isn't it?

   set %cc 1
   !.dns $mta.ip($1,%a)

Posted
yeah, that one will work, dont think it will on join though

ye i've corrected the on join one now but still having the crc error mentioned in my first post.

thanx

Posted

nvm, re-scripted it and it works perfectly now. i had already reinstalled mtama but that didn't work, and it was within its own script file.

thanx

EDIT: Just noticed that I still get the crc error when certain users join, or if I check the host of certain users. It works fine for the rest :S

on *:DNS:{
 if (%cc == 1) {
   !tokenize 32 %gh
   if ($1) {
     if ($dns(0).addr) mta.msg $1 %pff $mta.name($1,$2) $+ 's host: $dns(0).addr
     mta.msg $1 %pff Main: $gettok($dns(0).addr,3-6,46))
     else mta.msg $1 %pff Unable to resolve $mta.name($1,$2) $+ 's host.
     unset %cc
     unset %pff
   }
   unset %gh
 }
 elseif (%cc == 3) {
   !tokenize 32 %gh
   if ($1) {
     if ($dns(0).addr) {
       !writeini -n " $+ $scriptdir $+ badnicks.ini" hosts $gettok($dns(0).addr,3-6,46)) 1
       mta.msg $1 %pff $mta.name($1,$2) $+ 's main host: $gettok($dns(0).addr,3-6,46)) has now been banned.
       mta.kick $1 $2
       unset %cc
       unset %pff
     }
     else mta.msg $1 %pff Unable to resolve $mta.name($1,$2) $+ 's host- Host Ban Failed!
   }
   unset %gh
 }
 elseif (%cc == 2) {
   !tokenize 32 %gh
   if ($1) {
     if ($dns(0).addr) {
       if $readini(badnicks.ini,hosts,$gettok($dns(0).addr,3-6,46)) == 1 {
         mta.kick $1 $2
         unset %cc
       }
     }
   }
   unset %gh
 }
}
on *:SIGNAL:mta.command:{
 var %a = $iif($4,$iif($mta.name($1,$4) != Unknown,$4,$mta.getid($1,$4)),$2)
 if ($3 == !host) {
   set %gh $1 %a
   set %pff $2
   set %cc 1
   !.dns $mta.ip($1,%a)
 }
 elseif ($3 == !hostban) {
   if ($mta.name($1,%a) != unknown) && ($mta.name($1,$2) != $mta.name($1,%a)) {
     set %gh $1 %a
     set %pff $2
     set %cc 3
     !.dns $mta.ip($1,%a)
   }
   else mta.msg $1 $2 Error - Can not ban Absent Nick/ID/Yourself
 }
}
on *:SIGNAL:mta.join:{
 set %cc 2
 set %gh $1 $2
 !.dns $mta.ip($1,$2)
}

  • Recently Browsing   0 members

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