mIRC Home    About    Download    Register    News    Help

Print Thread
#183687 21/08/07 09:29 PM
F
Fill
Fill
F
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?

#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
  }
}

xDaeMoN #183798 22/08/07 06:01 PM
F
Fill
Fill
F
thanks a lot!


Link Copied to Clipboard