Autolimit

By xelent on Jul 16, 2008

Autolimit from bots

Instructions: Make sure to change #YourChannel with your channel ( the main/bot channel), and make sure you got op ( :

on *:text:!autolimit *:#YourChannel:{ 
  if ($nick isop $chan) && ($2 isnum 1-100) { 
    if ($limit.mode($chan) == on) {
      .set %limit. $+ $chan $2
      .notice $nick limit on $chan is $2 
      .mode # +l $calc($nick(#,0) + $limit.max($chan))
    }
    else { notice $nick Set autolimit on first }
  }
  elseif ($nick isop $chan) && ($2 == on) {
    if ($limit.mode($chan) == off) || ($limit.mode($chan) == $null) {
      .set %limit.mode. $+ $chan on
      if ($limit($chan) == $null) { .set %limit. $+ $chan 5 }
      .notice $nick Limit is now ON +5
      .mode # +l $calc($nick(#,0) + $limit.max($chan))
    }
  } 
  elseif ($nick isop $chan) && ($2 == off) {
    if ($limit.mode($chan) == on) {
      .set %limit.mode. $+ $chan off 
      .notice $nick Limit is now OFF
      .mode # -l
    }
  } 
}
alias limit { 
  if (!$timer(limit. $+ $chan)) { 
    .timerlimit. $+ $chan 1 10 limit.fix $1 
  }
}
alias limit.fix { mode $1 +l $calc($nick($1,0) + $limit.max($1)) }
alias limit.max { return %limit. [ $+ [ $1 ] ] }
alias limit.mode { return %limit.mode. [ $+ [ $1 ] ] }
on *:join:#YourChannel:{ 
  if ($limit.mode($chan) == on) {
    limit $chan
  }
}
on *:part:#YourChannel:{ 
  if ($limit.mode($chan) == on) {
    limit $chan
  }
}
on *:kick:#YourChannel:{ 
  if ($limit.mode($chan) == on) {
    limit $chan
  }
}
on *:quit:{
  var %c = 1
  var %cc = $comchan($nick,0)
  while (%c <= %cc) {
    if ($limit.mode($comchan($nick,%c)) == on) { limit $comchan($nick,%c) }
    inc %c
  }
}

Comments

Sign in to comment.
izs   -  Jan 20, 2011

it's working. thx dude

 Respond  
Jamiie   -  Jul 17, 2008

First off, .set limit. $+ $chan $2 doesn\'t work that way for dynamic variables,

I suggest using

.set $+(%,limit,.,$chan) $2

Same with your other variables.

 Respond  
Are you sure you want to unfollow this person?
Are you sure you want to delete this?
Click "Unsubscribe" to stop receiving notices pertaining to this post.
Click "Subscribe" to resume notices pertaining to this post.