All pastes #100980 Raw Edit

Untitled

public text v1 · immutable
#100980 ·published 2006-07-26 16:33 UTC
rendered paste body
on *:TEXT:@apply*:#ShockServ:{
  if ($2 == $null) {
    .notice $nick You must enter a channel name after @apply
    halt
  }
  if (%disabled == 1) {
    .msg $chan 0,1 $+ $nick $+ , Sorry but the applications are currently DISABLED!
    halt
  }
  if (%apply) {
    .msg $chan 0,1 $+ $nick $+ , I am currently busy with another user with their channel. Please wait while I finish this up.
    halt
  }
  if (*,* iswm $2) {
    if ($nick isop $chan) { halt }
    mode $chan +b $nick
    kick $chan $nick Nice try
    halt
  }
  if ($left($2,1) != $chr(35)) {
    .msg $chan 0,1 $+ $Nick $+ , You must enter a valid channel name!
    halt 
  }
  if ($readini(botdnr.ini,dnr,$2)) {
    .msg $chan 0,1 $+ $nick $+ , This channel is currently suspended.
    .msg $chan 0,1User: $readini(botdnr.ini,$2,user) $+ , Host: $readini(botdnr.ini,$2,host) $+ , Reason: $readini(botdnr.ini,$2,reason) $+ .
    halt  
  }
  if ($readini(botreg.ini,reg,$2)) {
    .msg $chan 0,1Error! This channel is already registered by  $+ $readini(botreg.ini,$2,user) $+  4(14 $+ $readini(botreg.ini,$2,host) $+ 4)
    halt
  }
  if ($2 == $chan) { .msg $chan Error, You cannot register the hub channel! | halt }
  if ($2 == #shockserv-staff) { .msg $chan Error, You cannot register the staff hub channel! | halt }
  if (*shockserv* iswm $2) { .msg $chan Error, You cannot register a channel with the name ShockServ in it! | halt }
  else {
    .msg $chan 0,1 $+ $nick $+ , I am now checking the requirements for your channel 4(14 $+ $2 $+ 4)0,1. This can take up to 30 seconds for me to finish.
    join $2
    set %channel $2
    set %nick.ask $nick  
    set %apply yes
    .msg chanserv a %channel %nick.ask  
  }
}
on Admin:TEXT:@regchan*:#: {
  if ($1 != @regchan) { halt }
  if (!$2) {
    .notice $nick Syntax: $1 (#channel) (nick)
    halt
  }
  if ($readini(botreg.ini,reg,$2)) {
    .msg $chan 0,1Error! This channel is already registered by  $+ $readini(botreg.ini,$2,user) $+  4(14 $+ $readini(botreg.ini,$2,host) $+ 4)
    halt
  }
  if (!$3) {
    set %nick.ask $nick
    set %channel $2
    $eval($botapply)
  }
  else {
    set %nick.ask $3
    set %channel $2
    $eval($botapply)
  }
}
on Admin:TEXT:@unregchan*:#: {
  if ($1 != @unregchan) { halt }
  if (!$2) {
    .notice $nick Syntax: $1 (#channel) (Reason)
    halt
  }
  if (!$3) {
    .notice $nick Syntax: $1 (channel) (Reason)
    halt
  }
  if (!$readini(botreg.ini,reg,$2)) {
    .notice $nick Error! Channel $2 is not in my database!
    halt
  }

  write -a $2 $+ .txt Channel unregistered by $nick with the reason: $3-
  .msg $readini(botreg.ini,$2,bot) delchan $2 Channel Unregistered: $3-
  if ($readini(botreg.ini,$2,bot) == ShockServ`001) {
    set %apps1 $calc(%apps1 - 1)
  }
  elseif ($readini(botreg.ini,$2,bot) == ShockServ`002) {
    set %apps2 $calc(%apps2 - 1)
  }
  elseif ($readini(botreg.ini,$2,bot) == ShockServ`003) {
    set %apps3 $calc(%apps3 - 1)
  }
  elseif ($readini(botreg.ini,$2,bot) == ShockServ`004) {
    set %apps4 $calc(%apps4 - 1)
  }
  elseif ($readini(botreg.ini,$2,bot) == ShockServ`005) {
    set %apps5 $calc(%apps5 - 1)
  }
  elseif ($readini(botreg.ini,$2,bot) == ShockServ`006) {
    set %apps6 $calc(%apps6 - 1)
  }
  elseif ($readini(botreg.ini,$2,bot) == ShockServ`007) {
    set %apps7 $calc(%apps7 - 1)
  }
  elseif ($readini(botreg.ini,$2,bot) == ShockServ`008) {
    set %apps8 $calc(%apps8 - 1)
  }
  elseif ($readini(botreg.ini,$2,bot) == ShockServ`009) {
    set %apps9 $calc(%apps9 - 1)
  }
  elseif ($readini(botreg.ini,$2,bot) == ShockServ`010) {
    set %apps10 $calc(%apps10 - 1)
  }
  .msg $chan 0,1 $+ $readini(botreg.ini,$2,bot) $+  is now being removed from channel 4(14 $+ $2 $+ 4)0,1.
  remini botreg.ini reg $2
  remini botreg.ini $2
  /topic $chan 15,1[4 ShockServ0 - Bot Service for Custom Commands and Security Bots - 4S0lots: $calc(200 - %apps1 - %apps2 - %apps3 - %apps4 - %apps5 - %apps6 - %apps7 - %apps8 - %apps9 - %apps10) - 4N0ews: %news 15]
}
on Admin:TEXT:@history*:#: {
  if ($1 != @history) { halt }
  if (!$2) {
    .notice $nick Syntax: $1 (#channel)
    halt
  }
  if ($readini(botreg.ini,reg,$2)) {
    .notice $nick Registered To: $readini(botreg.ini,$2,user)
    .notice $nick Registered Host: $readini(botreg.ini,$2,host)
    .notice $nick Registered Bot: $readini(botreg.ini,$2,bot)
  }
  if ($exists($2 $+ .txt)) {  
    .notice $nick Channel $2 History:
    /play -n $nick $2 $+ .txt
  }
}
on *:TEXT:*:?: {
  .msg #ShockServ-staff 0,1Bot Message: 14 $+ $nick $+ 14 4(14 $+ $address($nick,2) $+ 4)0,1 private messaged me with: $1-
  close -m $nick
}
on *:TEXT:@removeabot*:#: {
  if ($1 != @removeabot) { halt }
  if (!$2) {
    .notice $nick You must enter a channel name after .removeabot
    halt
  }
  if (!$readini(botreg.ini,reg,$2)) {
    .msg $chan 0,1 $+ $nick $+ , Sorry but the channel 4(14 $+ $2 $+ 4)0,1 is currently not registered with ShockServ.
    halt  
  }
  if ($address($nick,2) != $readini(botreg.ini,$2,host)) {
    .msg $chan 0,1 $+ $nick $+ , Sorry but you are not the registered channel owner of that channel 4(14 $+ $2 $+ 4)0,1, The registered owner of this channel is $readini(botreg.ini,$2,user) 4(14 $+ $readini(botreg.ini,$2,host) $+ 4)0,1.
    halt  
  }
  .msg $readini(botreg.ini,$2,bot) delchan $2 Channel Unregistered By $nick $+ .
  .msg $chan 0,1 $+ $nick $+ , $readini(botreg.ini,$2,bot) is being removed from your channel 4(14 $+ $2 $+ 4)0,1. 
  if ($readini(botreg.ini,$2,bot) == ShockServ`001) {
    set %apps1 $calc(%apps1 - 1)
  }
  elseif ($readini(botreg.ini,$2,bot) == ShockServ`002) {
    set %apps2 $calc(%apps2 - 1)
  }
  elseif ($readini(botreg.ini,$2,bot) == ShockServ`003) {
    set %apps3 $calc(%apps3 - 1)
  }
  elseif ($readini(botreg.ini,$2,bot) == ShockServ`004) {
    set %apps4 $calc(%apps4 - 1)
  }
  elseif ($readini(botreg.ini,$2,bot) == ShockServ`005) {
    set %apps5 $calc(%apps5 - 1)
  }
  elseif ($readini(botreg.ini,$2,bot) == ShockServ`006) {
    set %apps6 $calc(%apps6 - 1)
  }
  elseif ($readini(botreg.ini,$2,bot) == ShockServ`007) {
    set %apps7 $calc(%apps7 - 1)
  }
  elseif ($readini(botreg.ini,$2,bot) == ShockServ`008) {
    set %apps8 $calc(%apps8 - 1)
  }
  elseif ($readini(botreg.ini,$2,bot) == ShockServ`009) {
    set %apps9 $calc(%apps9 - 1)
  }
  elseif ($readini(botreg.ini,$2,bot == ShockServ`010) {
    set %apps10 $calc(%apps10 - 1)
  }
  remini botreg.ini reg $2
  remini botreg.ini $2
  write -a $2 $+ .txt Channel $2 unregistered by $nick $+ .
}

on Admin:TEXT:@dnr*:#: {
  if ($1 != @dnr) { halt }
  if (!$2) {
    .notice $nick Syntax: $1 (#channel) (Reason)
    halt
  }
  if ($2 == remove) {
    if (!$3) {
      .notice $Nick Syntax: $1 (remove) (#channel)
      halt
    }
    if (!$readini(botdnr.ini,dnr,$3)) {
      .notice $nick Error! Channel $3 is currently not in the 4DNR list!
      halt
    }
    remini botdnr.ini dnr $3
    remini botdnr.ini $3
    .notice $nick Removed  $+ $3 $+  from the 4DNR list.
    if ($readini(botreg.ini,reg,$3)) {
      .msg $readini(botreg.ini,$3,bot) unsuspend $2-
      .msg $chan 0,1 $+ $readini(botreg.ini,$3,bot) is now returning to channel $3 $+ .
    }
    halt
  }
  if (!$3) {
    .notice $nick Syntax: $1 (#channel) (Reason)
  }
  if ($left($2,1) != $chr(35)) {
    .notice $nick Error! You must enter in a valid channel name.
    halt
  }
  if ($readini(botdnr.ini,dnr,$2)) {
    .notice $nick Error! Channel is already in the 4DNR List!
    halt
  }
  if ($2 == #ShockServ) {
    .notice $nick You cannot register the hub channel!
    halt
  }
  writeini botdnr.ini dnr $2 1
  writeini botdnr.ini $2 user $nick
  writeini botdnr.ini $2 reason $3-
  writeini botdnr.ini $2 host $address($nick,2)
  .notice $nick Added  $+ $2 $+  to the 4DNR list!
  if ($readini(botreg.ini,reg,$2)) {
    .msg $readini(botreg.ini,$2,bot) delchan $2 Channel Suspended: $3-
    .msg $chan 0,1 $+ $readini(botreg.ini,$2,bot) is now parting the channel $2 $+ .
  }
}

alias Botapply {
  if (%apps1 != 20) {
    .msg ShockServ`001 register %channel
    writeini botreg.ini reg %channel 1
    writeini botreg.ini %channel host $address(%nick.ask,2)
    writeini botreg.ini %channel user %nick.ask
    writeini botreg.ini %channel bot ShockServ`001
    .msg #ShockServ 0,1ShockServ`001 will now enter your channel 4(14 $+ %channel $+ 4).
    .msg #ShockServ 0,1Please remember to give your bot 400 access. 4,1(14,1 $+ /cs %channel adduser ShockServ`001 400 $+ 4,1).
    inc %apps1
  }
  elseif (%apps2 != 20) {
    .msg ShockServ`002 register %channel
    writeini botreg.ini reg %channel 1
    writeini botreg.ini %channel host $address(%nick.ask,2)
    writeini botreg.ini %channel user %nick.ask
    writeini botreg.ini %channel bot ShockServ`002
    .msg #ShockServ 0,1ShockServ`002 will now enter your channel 4(14 $+ %channel $+ 4).
    .msg #ShockServ 0,1Please remember to give your bot 400 access. 4,1(14,1 $+ /cs %channel adduser ShockServ`002 400 $+ 4,1).
    inc %apps2
  }
  elseif (%apps3 != 20) {
    .msg ShockServ`003 register %channel
    writeini botreg.ini reg %channel 1
    writeini botreg.ini %channel host $address(%nick.ask,2)
    writeini botreg.ini %channel user %nick.ask
    writeini botreg.ini %channel bot ShockServ`003
    .msg #ShockServ 0,1ShockServ`003 will now enter your channel 4(14 $+ %channel $+ 4).
    .msg #ShockServ 0,1Please remember to give your bot 400 access. 4,1(14,1 $+ /cs %channel adduser ShockServ`003 400 $+ 4,1).
    inc %apps3
  }
  elseif (%apps4 != 20) {
    .msg ShockServ`004 register %channel
    writeini botreg.ini reg %channel 1
    writeini botreg.ini %channel host $address(%nick.ask,2)
    writeini botreg.ini %channel user %nick.ask
    writeini botreg.ini %channel bot ShockServ`004
    .msg #ShockServ 0,1ShockServ`004 will now enter your channel 4(14 $+ %channel $+ 4).
    .msg #ShockServ 0,1Please remember to give your bot 400 access. 4,1(14,1 $+ /cs %channel adduser ShockServ`004 400 $+ 4,1).
    inc %apps4
  }
  elseif (%apps5 != 20) {
    .msg ShockServ`005 register %channel
    writeini botreg.ini reg %channel 1
    writeini botreg.ini %channel host $address(%nick.ask,2)
    writeini botreg.ini %channel user %nick.ask
    writeini botreg.ini %channel bot ShockServ`005
    .msg #ShockServ 0,1ShockServ`005 will now enter your channel 4(14 $+ %channel $+ 4).
    .msg #ShockServ 0,1Please remember to give your bot 400 access. 4,1(14,1 $+ /cs %channel adduser ShockServ`005 400 $+ 4,1).
    inc %apps5
  }
  elseif (%apps6 != 20) {
    .msg ShockServ`006 register %channel
    writeini botreg.ini reg %channel 1
    writeini botreg.ini %channel host $address(%nick.ask,2)
    writeini botreg.ini %channel user %nick.ask
    writeini botreg.ini %channel bot ShockServ`006
    .msg #ShockServ 0,1ShockServ`006 will now enter your channel 4(14 $+ %channel $+ 4).
    .msg #ShockServ 0,1Please remember to give your bot 400 access. 4,1(14,1 $+ /cs %channel adduser ShockServ`006 400 $+ 4,1).
    inc %apps6
  }
  elseif (%apps7 != 20) {
    .msg ShockServ`007 register %channel
    writeini botreg.ini reg %channel 1
    writeini botreg.ini %channel host $address(%nick.ask,2)
    writeini botreg.ini %channel user %nick.ask
    writeini botreg.ini %channel bot ShockServ`007
    .msg #ShockServ 0,1ShockServ`007 will now enter your channel 4(14 $+ %channel $+ 4).
    .msg #ShockServ 0,1Please remember to give your bot 400 access. 4,1(14,1 $+ /cs %channel adduser ShockServ`007 400 $+ 4,1).
    inc %apps7
  }
  elseif (%apps8 != 20) {
    .msg ShockServ`008 register %channel
    writeini botreg.ini reg %channel 1
    writeini botreg.ini %channel host $address(%nick.ask,2)
    writeini botreg.ini %channel user %nick.ask
    writeini botreg.ini %channel bot ShockServ`008
    .msg #ShockServ 0,1ShockServ`008 will now enter your channel 4(14 $+ %channel $+ 4).
    .msg #ShockServ 0,1Please remember to give your bot 400 access. 4,1(14,1 $+ /cs %channel adduser ShockServ`008 400 $+ 4,1).
    inc %apps8
  }
  elseif (%apps9 != 20) {
    .msg ShockServ`009 register %channel
    writeini botreg.ini reg %channel 1
    writeini botreg.ini %channel host $address(%nick.ask,2)
    writeini botreg.ini %channel user %nick.ask
    writeini botreg.ini %channel bot ShockServ`009
    .msg #ShockServ 0,1ShockServ`009 will now enter your channel 4(14 $+ %channel $+ 4).
    .msg #ShockServ 0,1Please remember to give your bot 400 access. 4,1(14,1 $+ /cs %channel adduser ShockServ`009 400 $+ 4,1).
    inc %apps9
  }
  elseif (%apps10 != 20) {
    .msg ShockServ`010 register %channel
    writeini botreg.ini reg %channel 1
    writeini botreg.ini %channel host $address(%nick.ask,2)
    writeini botreg.ini %channel user %nick.ask
    writeini botreg.ini %channel bot ShockServ`010
    .msg #ShockServ 0,1ShockServ`010 will now enter your channel 4(14 $+ %channel $+ 4).
    .msg #ShockServ 0,1Please remember to give your bot 400 access. 4,1(14,1 $+ /cs %channel adduser ShockServ`010 400 $+ 4,1).
    inc %apps10
  }
  else {
    .msg #ShockServ All channel slots are currently full.
    halt  
  }
  .msg #ShockServ 0,15Use 4,1(14,1 .commands $+ 4,1)0,1 To see the list of commands.
  write -a %channel $+ .txt Channel registered by %nick.ask to bot: $readini(botreg.ini,%channel,bot) $+ .
}

on *:TEXT:@slots:#ShockServ: {
  .msg $chan There are $calc(200 - %apps1 - %apps2 - %apps3 - %apps4 - %apps5 - %apps6 - %apps7 - %apps8 - %apps9 - %apps10) channel slots available out of 200 total slots. Current Channel Load: $calc(%apps1 + %apps2 + %apps3 + %apps4 + %apps5 + %apps6 + %apps7 + %apps8 + %apps9 + %apps10) $+ .
}

raw 475:*: {
  if (%apply) {
    set %mode_k yes
  }
}
raw 473:*: {
  if (%apply) { 
    set %mode_i yes
  }
}
raw 474:*: {
  if (%apply) { 
    set %mode_ban yes
  }
}
raw 471:*: {
  if (%apply) {
    set %channel_full yes
  }
}
on Admin:TEXT:@reset:#: {
  unset %apply
  unset %nick.ask
  unset %channel
  .msg $chan Apply bot has been reset!
}
on Admin:TEXT:@enable:#: {
  if (%disabled == 0) {
    .notice $nick The apply bot is already enabled.
    halt
  }
  .msg $chan Applications are now enabled.
  set %disabled 0
}
on Admin:TEXT:@disable:#: {
  if (%disabled == 1) {
    .notice $nick The apply bot is already disabled.
    halt
  }
  .msg $chan Applications are now disabled.
  set %disabled 1
}
;on *:JOIN:#:{
;  if ($nick != $me) {
;    .notice $nick Are you maybe interested in a ShockServ.  Join #ShockServ to get a ShockServ by typing .apply #channel.
;  }
;}

on ^*:notice:*:*:{
  if ($nick != ChanServ) { halt }
  if (!%apply) { halt }
  if (%mode_ban) {
    .msg #ShockServ 0,1 $+ %nick.ask $+ , I am currently banned from the channel 4(14 $+ %channel $+ 4)0,1. Please use !delban $me in your channel, and then reapply.
    unset %mode_ban
    unset %apply
    halt  
  }
  if (%mode_i) {
    .msg #ShockServ 0,1 $+ %nick.ask $+ , The channel 4(14 $+ %channel $+ 4)0,1 is currently mode +i, to getabot you must do !mode -i in your channel, and then reapply.
    unset %mode_i
    unset %apply
    halt
  }
  if (%mode_k) {
    .msg #ShockServ 0,1 $+ %nick.ask $+ , The channel 4(14 $+ %channel $+ 4)0,1 is currently mode +k, to getabot you must do !mode -k in your channel, and then reapply.
    unset %mode_k
    unset %apply
    halt  
  }
  if (%channel_full) {
    .msg #ShockServ 0,1 $+ %nick.ask $+ , The channel 4(14 $+ %channel $+ 4)0,1 is currently full, to getabot you must do !mode -l in your channel, and then reapply.
    unset %channel_full
    unset %apply
    halt
  }
  if (*xeonnet* iswm $1-) {
    haltdef
    halt
  }
  if (*has not been registered* iswm $1-) {
    haltdef
    .msg #ShockServ 0,1 $+ %nick.ask $+ , The channel 4(14 $+ %channel $+ 4)0,1 is currently not registered with ChanServ.
    part %channel
    unset %apply    
    halt
  }
  if (*lacks access* iswm $1-) {
    haltdef
    .msg #ShockServ 0,1 $+ %nick.ask $+ , You currently not on the userlist in the channel 4(14 $+ %channel $+ 4)0,1.
    part %channel  
    unset %apply  
    halt
  }
  if (*must first authenticate* iswm $1-) {
    haltdef
    .msg #ShockServ 0,1 $+ %nick.ask $+ , You must first authenticate with AuthServ before you can getabot!
    part %channel
    unset %apply
    halt
  }
  if (xeonnet !isin $address(%nick.ask,2)) {
    .msg #ShockServ 0,1 $+ %nick.ask $+ , You must first do  $+ //mode $ $+ me +x $+  before you can getabot!
    unset %apply
    part %channel
    halt
  }
  var %i = 1
  while (%i <= $nick(%channel,0)) {
    if (*Boat* iswm $nick(%channel,%i)) {
      set %boat $nick(%channel,%i)
    }
    if (*Beta-* iswm $nick(%channel,%i)) {
      set %beta $nick(%channel,%i)
    }
    if (*ClanBot-* iswm $nick(%channel,%i)) {
      set %clanbot $nick(%channel,%i)
    }
    if (*Xbot|* iswm $nick(%channel,%i)) {
      set %xbot $nick(%channel,%i)
    }
    inc %i
  }
  if (%boat) {
    .msg #ShockServ 0,1 $+ %nick.ask $+ , Sorry but there is currently another type of bot in your channel 4(14 $+ %channel $+ 4)0,1  $+ %boat $+ . You cannot have a ShockServ until that bot is removed.
    unset %apply    
    unset %boat
    part %channel
    halt
  }
  if (%beta) {
    .msg #ShockServ 0,1 $+ %nick.ask $+ , Sorry but there is currently another type of bot in your channel 4(14 $+ %channel $+ 4)0,1  $+ %beta $+ . You cannot have a ShockServ until that bot is removed.
    unset %apply    
    unset %beta
    part %channel
    halt
  }
  if (%clanbot) {
    .msg #ShockServ 0,1 $+ %nick.ask $+ , Sorry but there is currently another type of bot in your channel 4(14 $+ %channel $+ 4)0,1  $+ %clanbot $+ . You cannot have a ShockServ until that bot is removed.
    unset %apply    
    part %channel
    unset %clanbot
    halt
  }
  if (%xbot) {
    .msg #ShockServ 0,1 $+ %nick.ask $+ , Sorry but there is currently another type of bot in your channel 4(14 $+ %channel $+ 4)0,1  $+ %xbot $+ . You cannot have a ShockServ until that bot is removed.    
    unset %apply    
    unset %xbot
    part %channel
    halt
  }
  if (*has access* iswm $1-) {
    if ($strip($5,b) <= 400) {
      .msg #ShockServ 0,1 $+ %nick.ask $+ , You currently have access  $+ $strip($5,b) $+ , we require at least 401 access in 4(14 $+ %channel $+ 4)0,1 to getabot.
      part %channel      
      unset %apply
      halt
    }
    else {
      idlecheck
    }
  }
}

alias idlecheck {
  if ($nick(%channel,0) >= 7) {
    cscan %channel
  }
  elseif ($nick(%channel,0) < 7) {
    .msg #shockserv 0,1 $+ %nick.ask $+ , Your channel 4(14 $+ %channel $+ 4)0,1 currently has $calc($nick(%channel,0) - 2) Idlers. We require you to have 5 or more idlers NOT Including ChanServ or Myself. Once you have enough idlers, you may reapply.
    part %channel      
    unset %apply
    halt
  }
}

alias cscan {
  var %d = linesep $iif($active == Status Window,-s,$active)
  if ((!$chan) && (!$1)) {
    %d | %d
    return
  }
  if (($1) && ($1 !ischan)) {
    %d | %d
    return
  }
  set %do_cscan $iif($1,$1,$chan)
  set %ds_cscan $iif($active == Status Window,status,$active)
  who %do_cscan
}

alias -l cscan2 {
  var %i = 1,%a
  var %tc = 0,%th = 0

  var %chan = $1

  linesep %chan
  while (%i <= $nick(%chan,0)) {
    if ($ialchan($address($nick(%chan,%i),2),%chan,0) > 1) {
      if ($istok(%a,$remove($address($nick(%chan,%i),2),*!*@),32)) {
        inc %i
        continue
      }
      inc %th
      %a = $addtok(%a,$remove($address($nick(%chan,%i),2),*!*@),32)
      var %b = 1
      inc %clonehost. [ $+ [ %channel ] ]
      set %clonehost [ $+ [ %clonehost [ $+ [ . [ $+ [ %channel ] ] ] ] ] ] [ $+ [ . ] ] [ $+ [ %channel ] ] $remove($address($nick(%chan,%i),2),*!*@)
      while (%b <= $ialchan($address($nick(%chan,%i),2),%chan,0)) {
        inc %b
        inc %tc
      }
    }
    inc %i
  }
  if (%tc > 0) dec %tc {
    .msg #ShockServ 0,1 $+ %nick.ask $+ , The channel 4(14 $+ %channel $+ 4)0,1 currently has  $+ %tc $+  clone $+ $iif(%tc != 1,s) from  $+ %th $+  host $+ $iif(%th != 1,s) $+ , to getabot you must get rid of ALL the clones in your channel, and then reapply.
    part %channel      
    unset %apply
    unset %ds_cscan
    var %utc = 1
    while (%utc <= %clonehost. [ $+ [ %channel ] ]) {
      unset %clonehost [ $+ [ %utc ] ] [ $+ [ . ] ] [ $+ [ %channel ] ]
      inc %utc
    }
    unset %clonehost. [ $+ [ %channel ] ]
    halt
    linesep %chan
    unset %ds_cscan
    part %channel
    unset %apply
  }
  if (%tc == 0) {
    part %channel
    unset %apply
    $eval($botapply)
  }
}

raw 315:*: {
  if (%do_cscan == $2) {
    unset %do_cscan
    cscan2 $2
    halt
  }
}

raw 352:*: if (%do_cscan) halt

on Admin:TEXT:@rehash:#: {
  ;NOTE: Inorder for this script to work this script must be the last script!
  .notice $nick Rehashing.....  
  .notice $nick Rehashed $script(0) scripts.  
  var %i = 1
  while (%i <= $script(0)) {
    reload -rs " $+ $script(%i) $+ "
    inc %i
  }
}
on *:TEXT:@lines:#: {
  .msg $chan 0,1There are  $+ $totallines $+  total lines in all of my scripts combined!
}