mIRC Homepage
Posted By: dylaninfd remove ban by mode, not chanserv - 20/08/07 12:28 AM
I know that you can remove bans against you automatically with the script
Code:
on *:ban:#:{ if ($banmask iswm $address($me,5)) { cs unban # }


Is there a way to modify it so instead of "cs unban #" it goes "mode # -b $me"

I have it set where that works, but on the network that i use, there are 5 ban types, so every time it unbans me, it tries to do all 5, and 4 of them don't work. Eventually, I get disconnected for flooding because i receive the message that 'On is an unknown command' I am fairly sure that it's because I have 5 bantypes it tries to remove. Is there a way I can configure the script so it recognize the different ban types and only try to remove that one? All help is appreciated and thanks in advance!
Posted By: Horstl Re: remove ban by mode, not chanserv - 20/08/07 12:35 AM
As far as I know no network is limited to a fixed set of ban types.
Of course, there are some types used more often than others smile
Is this not sufficient?
Code:
on *:ban:#:{ 
  if ($banmask iswm $ial($me)) { mode $chan -b $banmask }
}

Edit: I did not notice the missing closing bracket at first. This missing bracket is likely to be the reason for your "on: unknown command" error.
Posted By: dylaninfd Re: remove ban by mode, not chanserv - 20/08/07 01:02 AM
Thanks! That works a lot better than having 5 different on ban events!
Posted By: Dracoz Re: remove ban by mode, not chanserv - 21/08/07 02:17 AM
I use this

Code:
on *:ban:#:{
  if ($banmask == $address($me,0)) || ($banmask == $address($me,1)) || ($banmask == $address($me,2)) || ($banmask == $address($me,3)) || ($banmask == $address($me,4)) || ($banmask == $address($me,5)) || ($banmask == $address($me,6)) {
    mode $chan -b $banmask
    mode $chan -o $nick
    ban # $address($nick,2)
    kick # $nick Dont ban me
    /cs kick $chan $nick Dont ban me
  }
}


It wil automaticly kick the person who banned you xD
Posted By: Horstl Re: remove ban by mode, not chanserv - 21/08/07 06:47 AM
Originally Posted By: Dracoz
It wil automaticly kick the person who banned you xD
//me sets mode +b $gettok($address(Dracoz,3),1,64) $+ @* and starts to grin wink
Posted By: KingTomato Re: remove ban by mode, not chanserv - 21/08/07 07:12 PM
Originally Posted By: Dracoz
I use this

Code:
on *:ban:#:{
  if ($banmask == $address($me,0)) || ($banmask == $address($me,1)) || ($banmask == $address($me,2)) || ($banmask == $address($me,3)) || ($banmask == $address($me,4)) || ($banmask == $address($me,5)) || ($banmask == $address($me,6)) {
    mode $chan -b $banmask
    mode $chan -o $nick
    ban # $address($nick,2)
    kick # $nick Dont ban me
    /cs kick $chan $nick Dont ban me
  }
}


It wil automaticly kick the person who banned you xD


As a side note, you can replace that first if-statement with the following:

if ($banmask iswm $address($me,5)) { ... }

Cleaner and (presumably) faster.
Posted By: RoCk Re: remove ban by mode, not chanserv - 21/08/07 07:16 PM
You could also replace lines 3-5 with this.

mode # -bo+b $banmask $nick $address($nick,2)
Posted By: deegee Re: remove ban by mode, not chanserv - 24/08/07 12:05 AM
Or
  • mode # -bo+b $banmask $nick $wildsite
  • mode # -bo+b $banmask $nick $site

And
Quote:
if ($banmask iswm $address($me,5))

could be
Code:
if ($banmask iswm $ial($me))


Posted By: ashleyb Re: remove ban by mode, not chanserv - 13/09/07 12:09 PM
or you could just do this

on wateverlevel:ban:#channelname:/mode # -b $banmask

i have mine set like this on *:ban:#:/mode # -b $banmask
Posted By: zaqwsxcde Re: remove ban by mode, not chanserv - 13/09/07 08:17 PM
Wouldn't...
Code:
if ($banmask iswm $ial($me)) { .. }


Or any other variation be triggered on someone with a similar host as your own? For example.. If my host was @p2p-59D4DBC9.mc.at.cox.net and someone banned *!*@p2p-G9T48BH6.bl.at.cox.net wouldn't that trigger it since it has the at.cox.net bit in it?

I've actually been trying to figure out a way to determine if the person being banned is you or not for a long time now.
Posted By: deegee Re: remove ban by mode, not chanserv - 13/09/07 09:52 PM
Nope, it won't.
Try this...
//echo -ag $iif(*!*@p2p-G9T48BH6.bl.at.cox.net iswm nick!user@p2p-59D4DBC9.mc.at.cox.net,Match!,No match!)

and (if your host is cox.net - and not your example banmask)
//echo -ag $iif(*!*@p2p-G9T48BH6.bl.at.cox.net iswm $ial($me),Match!,No match!)

$ial($me) returns the same as $address($me,5) - your full address (nick!user@host)
© mIRC Discussion Forums