damnet007 Posted February 5, 2007 Share Posted February 5, 2007 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? Link to comment
kevuwk Posted February 6, 2007 Share Posted February 6, 2007 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 Link to comment
damnet007 Posted February 6, 2007 Author Share Posted February 6, 2007 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) Link to comment
kevuwk Posted February 6, 2007 Share Posted February 6, 2007 yeah, that one will work, dont think it will on join though Link to comment
damnet007 Posted February 6, 2007 Author Share Posted February 6, 2007 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 Link to comment
kevuwk Posted February 6, 2007 Share Posted February 6, 2007 make sure this is in its own script file and if it is, reinstall mtama Link to comment
damnet007 Posted February 6, 2007 Author Share Posted February 6, 2007 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 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) } Link to comment
Recommended Posts