All pastes #86133 Raw Edit

Unnamed

public text v1 · immutable
·published 2006-07-12 16:01 UTC
rendered paste body
on *:text:@getabot*:#:{
  if ($chan == #AvidBots) && (!$2) && ($me == avidServ) {     .notice $nick @Getabot For Avidbots? If you want to get a bot from avidbots please type @getabot #your-channel in #AvidBots thank you. }
  if (!$2) && ($chan != #AvidBots) && ($me != Avidserv) { .notice $nick @Getabot For Avidbots? If you want to get a bot from avidbots please type @getabot #your-channel in #AvidBots thank you. }
  if ($me == AvidServ) && ($chan == #Avidbots) && ($2) {
    if ($2 isin %badchans) {
      msg $chan Sorry but you have either enter one of the suspended/badchans or have put an invalid character in your channel please try again
      haltdef
    }
    else {
      if ($3 == FORCE) && ($readini(userlist.ini,staff,$nick) == staff) {
        var %b = AvidBot- $+ $iif($rand(1,15) < 10,0 $+ $v1,$v1)
        set %dcf 1     
        hadd -m regchans $2 %b $4
        writeini userlist.ini $2 $4 500
        scid $hget(bcid,%b) JOIN $2
        msg #AB-Staff (FORCED) By $nick to register $2 without checking
        msg $chan (FORCED) Sent %b without checking for anything
      }
      elseif ($3 == FORCE) && ($readini(userlist.ini,staff,$nick) != staff) && ($me == AvidServ) {
        msg $chan Sorry $nick You do not have enough access to use FORCE
        msg #AB-Staff $nick attempted to FORCE but did not have enough access    
      }
      else {
        if ($chr(44) !isin $2) && ($2 != #) {
          msg # Checking $2 Please wait!
          join $2
          set %chan $2
          set %nick $nick
        }
        elseif ($chr(44) isin $2) {
          msg # I do not recognize $chr(44) in a channel name please dont use it! thanks
        }
      }
    }
  }
}

on ^*:JOIN:#:{
  if (%dcf == 1) {
    haltdef
    unset %dcf | unset %chan | unset %nick
  }
  if ($nick == AvidServ) && ($chan == %chan) && ($rawmsg != %chan unable to join channel (address is banned)) {
    ;ca %chan %nick
    .timer1 1 1 check
  }
}

alias ca {
  cs a $1 $2
  set -u4 %checknick $2
}
on ^*:NOTICE:*:?:{
  if ($nick == ChanServ) && ($1 == %nick) && (%chan) {
    if (has access isin $1-) {
      var %a = $strip($5)
      if (%a >= 401) { getabot }
      else {
        msg #avidbots %nick you lack enough access to %chan ( $+ You have %a $+ . You need $calc(401 - %a) more access.)
        part %chan Bot request ( $+ %nick $+ ) failed.
        unset %chan | unset %nick
      }
    }
    if (lacks access isin $1-) {
      msg #avidbots %nick You lack enough access to %chan $+ , you need 401!
      part %chan Bot requested by %nick .. and failed!
      unset %chan  | unset %nick
    }
    if (must first authenticate isin $1-) {
      msg #avidbots %nick You need to first authenticate with AuthServ before using this command.
      part %chan Bot requested by %nick failed!
      unset %chan | unset %nick
    }
  }
}
alias check {
  if ($1 == banned) {
    msg #Avidbots I am banned from %chan Please unban me and try again
    scid 1 msg #aB-stafs Attempted to join %chan but is banned    
    haltdef
  }
  if ($1 == Noaccess) {
    msg #AvidBots you do not have enough access you must have 401+ to getabot
    haltdef
    part %chan
  }
  if (%chan isin %badchans) {
    msg #AB-STaff Attempted to join a badchan by %nick
    msg #AvidBots Bad chan can not join.
  }
  if (%chan) && (%nick) {
    if (ChanServ ison %chan) {
      var %i = 1
      while ($nick(%chan,%i) != $null) {
        if ($hget(bcid,$nick(%chan,%i)) != $null) && ($nick(%chan,%i) != AvidServ) {
          msg #AvidBots Sorry %chan already has a bot! ( $+ $nick(%chan,%i) $+ )
          part %chan %chan Already has a bot
          unset %chan | unset %nick
          halt | break
        }
        inc %i
      }
      cs %chan a %nick
    }
    else {
      msg #AvidBots Please Register %chan with ChanServ before trying to register
      part %chan Rquirements Failed!
      unset %chan | unset %nick
    }
  }
}

alias getabot {
  if (%chan != $null) {
    var %b = AvidBot- $+ $iif($rand(1,15) < 10,0 $+ $v1,$v1)
    msg #AvidBots Congratulations %nick $+ ! Your channel %chan has passed! We just sent the finest bot ( $+ %b $+ ) to your channel!
    msg #AvidBots Don't Forget to !adduser %b 400 in your channel!        
    part %chan I have finshed checking %chan $+ !
    scid $hget(bcid,%b) JOIN %chan
    hadd -m regchans %chan %b %nick
    msg #AB-staff (GetAbot) %b has joined %chan      
    writeini userlist.ini %chan %nick 500
    writeini userlist.ini %chan %b bot
    unset %chan | unset %nick
  }
}
on *:TEXT:@clvl *:#:{ 
  if ($me == AvidServ) && ($chan == #Avidbots) {
    if ($readini(userlist.ini,$chan,$nick) <= $3) && ($readini(userlist.ini,$chan,$nick) != $null) && ($readini(userlist.ini,$chan,$2) != $null) && ($readini(userlist.ini,$chan,$nick) >= $readini(userlist.ini,$chan,$2)) && ($3 isnum) {
      writeini userlist.ini $chan $2 $3
      notice $nick I have changed $2 $+ 's level to $3 $+ .
    }
    elseif ($readini(userlist.ini,$chan,$nick) => $3) {
      notice $nick Silly bear you can not add a user higher then your own access
    }
    elseif ($readini(userlist.ini,$chan,$nick) == $null) {
      notice $nick You do not have any access
    }
    elseif ($readini(userlist.ini,$chan,$2) == $null) {
      notice $nick I can not find $2 in my database
    }
    elseif ($readini(userlist.ini,$chan,$nick) => $readini(userlist.ini,$chan,$2)) {
      notice $nick You can not change someones level that has higher access then you!
    }
    elseif ($3 !isnum) {
      notice $nick Silly bear you cant change someones access if it isnt A number
    }
  }
}
on *:JOIN:#:{
  var %tmp 1
  if ($chan == #AvidBots) && ($me == AvidServ) {
    while (%tmp <= $readini(userlist.ini,staff,%tmp)) {

      if ($nick == $readini(userlist.ini,staff,%tmp)) {

        msg $chan X-Staff-X $nick is staff for Avidbots -[#Avidbots]-
        mode $chan +v $nick
      }
      inc %tmp 1
    }
  }
  elseif ($chan != #Avidbots) && ($me != AvidServ) {
    while (%tmp <= $readini(userlist.ini,staff,%tmp)) {

      if ($nick == $readini(userlist.ini,staff,%tmp)) {
        msg $chan X-Staff-X $nick is staff for Avidbots -[#Avidbots]-
        mode $chan +v $nick
      }
      inc %tmp 1
    }

  }
}