How about this? (currently bans *!*@host)
[EDIT: fixed it so someone won't be able to ban one more time if time exceeds his credit; also fixes a missing bracket]

Please note that this code uses the format: !ban nick [reason] (reason being optional)
It does NOT allow the person who bans to define the amount of "mps" that is subtracted from his total. I do not see what use that would serve, since a person can keep banning with a value of zero (!ban nick 0 reason) and never lose banning privileges.
As it is a person gets 900 points and loses 100 for every ban.

On a side note:
- this won't keep people from getting their &/@/% back
- people can still ban via the IRCd (/mode #channel +b nick) unless you have that blocked
- banning nick!*@* is very very easy to evade. A person just has to change his nick to get back into the channel. Instead of "mode nick!*@*" I'd recommend "*!*@host"


Code:
on *:TEXT:!refresh *:#channel:{
  if (~ isin $nick($chan,$nick).pnick) && ($$2 ison $chan) {
    write -ls $+ $v1 mplist.txt $2 900
    mode $chan +o $2
  }
}
on @*:TEXT:!mp:#channel:{
  if ($read(mplist.txt,s,$nick) >= 0) { .notice $nick You have $v1 mps left. }
} 
on @*:TEXT:!ban *:#channel:{
  if ($$2 ison $chan) && ($$3 isnum) {
    if ($read(mplist.txt,s,$nick) >= $3) {
      ban -ku $+ $calc($3 *60) $2 2 $iif($4,$4-,banned)
      write -ls $+ $nick $nick $calc($v1 - $3)
      if (!$read(mplist.txt,s,$nick)) {
        mode $chan -aoh $nick $nick $nick
        notice $nick You have 0 mps left. You cannot use the !ban and !kick commands anymore.
      }
    }
    else { notice $nick Sorry, you are out of points }
  }
  else { notice $nick Sorry, the format is: !ban nick time reason }
}

Last edited by 5618; 25/12/08 11:33 AM.