mIRC Home    About    Download    Register    News    Help

Print Thread
#183687 21/08/07 09:29 PM
Joined: Feb 2007
Posts: 28
F
Fill Offline OP
Ameglian cow
OP Offline
Ameglian cow
F
Joined: Feb 2007
Posts: 28
I just wanted to build some kind of script to list the bans and remove them.

For example:

When I typed !listbans, the bot listed all the channel bans.

When I typed !remoldbans, the bot removed the bans with more than 24 hours.

Is this easy?

Could you please provide me some help?

Fill #183695 21/08/07 10:49 PM
Joined: Mar 2005
Posts: 420
X
Fjord artisan
Offline
Fjord artisan
X
Joined: Mar 2005
Posts: 420
Code:
ON @*:TEXT:!*bans:#: {
  if ( $1 == !listbans ) {
    .mode # b
    var %a = 1, %b = $ibl(#,0), %c
    while %a <= %b {
      if ( $numtok(%c,32) < $modespl ) %c = $addtok(%c,$ibl(#,%a),32)
      else {
        msg $chan %c
        %c = ""
      }
      inc %a
    }
    if ( %c ) msg $chan %c
  }
  elseif ( $1 == !removeoldbans ) {
    .mode # b
    var %a = 1, %b = $ibl(#,0), %c
    while %a <= %b {
      if ( $numtok(%c,32) < $modespl ) && ( $calc($ctime - $ibl(#,1).ctime) > 2 ) %c = $addtok(%c,$ibl(#,%a),32)
      else {
        mode $chan $str(-b,$modespl) %c
        %c = ""
      }
      inc %a
    }
    if ( %c ) mode $chan $str(-b,$modespl) %c
  }
}


If you have a plastic floor runner over your tiles, then you're one Hella Pinoy!
xDaeMoN #183798 22/08/07 06:01 PM
Joined: Feb 2007
Posts: 28
F
Fill Offline OP
Ameglian cow
OP Offline
Ameglian cow
F
Joined: Feb 2007
Posts: 28
thanks a lot!


Link Copied to Clipboard