Jump to content
chain

mIRC Channel Protection Bot

Recommended Posts

  • Administrators

add into a new remote file in a clean mirc

About:
this is a multi server multi channel bot,
it will provide you with a user system for your channels and protect each user accordingly.
to begin youll have too add yourself as botowner and set your bots trigger

in the bot type
/addowner Your-Nick
** You must be on the same channel and network as the bot

then
/set %trigger !
** or any trigger you choose

then your ready to set it up for a chanel.
first add your server to autojoin with ?addserver add server
then a channel to autojoin with ?autojoin add network #channel

now your ready to set yourself as the channel owner by typing
!addowner nick channel
again the nick must be on the channel at the time of adding.
its best if the bot is the real channel owner, and you get your status from the bot.

now type
!commands
and take a look through the commands and have fun 🙂

** COMMANDS
?about bot/nick
?act channel message
?addowner nick channel
?addadmin nick
?addop nick
?addhelper nick
?addvoice nick
?autojoin add/del/list network channel
?badnick add/del nick
?ban add/del nick reason
?baninfo total/nick
?bigflood on/off/status # ( eg: ?bigflood on 200 ) ( 200 characters per message sent )
?botmaster nick
?checknick nick
?clonescanner on/off
?commands
?cycle channel
?dns nick/address
?flood on/off/status #:# ( eg: ?flood on 10:3 )( 10 lines in 3 seconds )
?flyby on/off/status
?global messsage
?greet on/off message
?ircop scan channel
?kick nick reason
?kill
?lastseen nick
?modelock list/modes
?protect on off
?reboot
?relay on channel_1 channel_2
?remember info_here ( the first word of your info, will be the trigger to retrieve the info )
?rules
?say channel message
?set nick/password nick/password
?server add/del server
?spam on/off/status
?stats nick ( or: ?stats reset nick )
?topiclock on/off topic
?trigger trigger
/addowner nick ( Must be on the same channel )

** NOTE
this bot recognises by nick and address, so if your hostmask changes alot
this would most likely not be a good bot for you

Made on IrCQNet
works with anope type services

this is still a work in progress so im open to suggestion
although im tryin to keep away from such commands as !op !deop etc etc

 

;?about bot/nick
;?act channel message
;?addowner nick channel
;?addadmin nick 
;?addop nick 
;?addhelper nick
;?addvoice nick 
;?autojoin add/del/list network channel
;?badnick add/del nick
;?ban add/del nick reason
;?baninfo total/nick
;?bigflood on/off/status # ( eg: ?bigflood on 200 ) ( 200 characters per message sent )
;?botmaster nick
;?checknick nick
;?clonescanner on/off
;?commands
;?cycle channel
;?dns nick/address
;?flood on/off/status #:# ( eg: ?flood on 10:3 )( 10 lines in 3 seconds )
;?flyby on/off/status
;?forget info_here
;?global messsage
;?greet on/off message
;?ircop scan channel
;?kick nick reason
;?kill
;?lastseen nick
;?modelock list/modes
;?protect on off
;?reboot
;?relay on channel_1 channel_2
;?remember info_here ( the first word of your info, will be the trigger to retrieve the info )
;?remuser nick channel
;?rules
;?say channel message
;?set nick/password nick/password
;?server add/del server
;?spam on/off/status
;?stats nick ( or: ?stats reset nick )
;?topiclock on/off topic
;?trigger trigger
;/addowner nick ( Must be on the same channel )
/* 
On Load/Unload Events 
*/
on 1:load: { set %botstartdate $fulldate | echo -s 04,01**** Loaded %logo.l SassIRC 12,01m04,01I04,01R08,01C Channel Protection Bot %logo.r Coded By %logo.l PuNkTuReD %logo.r }
on 1:unload: { echo -s 04,01**** Unloaded %logo.l SassIRC 12,01m04,01I04,01R08,01C Channel Protection Bot %logo.r Coded By %logo.l PuNkTuReD %logo.r }
/* 
On Start/Exit Events 
*/
on *:start: { 
  if (!$hget(Badwords)) { hmake Badwords 20 }
  if ($exists(Badwords.hsh)) { hload Badwords Badwords.hsh } 
  if (!$hget(AutoJoin)) { hmake AutoJoin 20 }
  if ($exists(AutoJoin.hsh)) { hload AutoJoin AutoJoin.hsh } 
  if (!$hget(Servers)) { hmake Servers 20 }
  if ($exists(Servers.hsh)) { hload Servers Servers.hsh } 
  set -u5 %a 1
  set -u5 %b $hget(Servers,0).item
  while %a <= %b {
    if (%a == 1) { server $hget(Servers,%a).item | inc %a }
    else { server -m $hget(Servers,%a).item | inc %a }
  }
  else { haltdef }
}
on *:exit: { 
  if ($hget(Servers)) { hsave -o Servers Servers.hsh }
  if ($hget(AutoJoin)) { hsave -o AutoJoin AutoJoin.hsh }
  if ($hget(Badwords)) { hsave -o Badwords Badwords.hsh }
} 
/* 
On Connect Event 
*/
on *:connect: { nick %botnick | identify %botpass | join $hget(Autojoin,$network) }
/* 
On Join/Part/Quit Events 
*/
on *:join:#: {
  set $+(%,$nick,totaljoin) $calc($($+(%,$nick,totaljoin),2) + 1)
  if ($($+(%,$chan,flyby),2) == on) { set -u60 $+(%,join,$chan,$nick) $nick }
  if (%serverrelay == on) && ($chan == %rchan) { relayevent $network $nick joined # }
  if (%clonescanner == on) && ($ialchan($strip($address($nick,2)),$chan,0) > 1) { .msg $chan %logo.l $nick %logo.r is a clone. %logo.l $ialchan($strip($address($nick,2)),$chan,0) %logo.r Active connections. From %logo.l $strip($address($nick,2)) %logo.r } 
  if (%relay == on) && ($chan == %chan1) { msg %chan2 Join %logo.l $nick %logo.r }
  if ($nick == $me) && ($chan == $gettok($readini(users.ini,modelock,$chan),1,32)) { .msg $chan %logo.l ModeLock Enforcer 04,01%logo.r | .msg $chan %logo.l Enforcing Modes %logo.r $gettok($readini(users.ini,modelock,$chan),2-,32) | mode $chan $gettok($readini(users.ini,modelock,$chan),2-,32) }
  if ($nick == $gettok($readini(badnicks.ini,$chan,$nick),1,32)) { ban -ku300 $chan $nick 2 Bad Nick. }
  if ($($+(%,greet,$chan),2) == on) { msg $chan $($+(%,joingreet,$chan),2) }
  if ($strip($address($nick,2)) == $gettok($readini($+($network,users.ini),botmaster,$nick),2,32)) { .msg $chan %logo.l Bot Master %logo.r04,01 $nick has joined. }
  if ($strip($address($nick,2)) == $gettok($readini($+($network,users.ini),$chan,$nick),1,32)) && ($gettok($readini($+($network,users.ini),$chan,$nick),2,32) == owner) { .msg $chan %logo.l $chan 04,01Owner %logo.r  $+ $nick has joined. | mode $chan +qov $nick $nick $nick | halt }
  if ($strip($address($nick,2)) == $gettok($readini($+($network,users.ini),$chan,$nick),1,32)) && ($gettok($readini($+($network,users.ini),$chan,$nick),2,32) == admin) { .msg $chan %logo.l $chan 04,01Admin %logo.r  $+ $nick has joined. | mode $chan +aov $nick $nick $nick | halt }
  if ($strip($address($nick,2)) == $gettok($readini($+($network,users.ini),$chan,$nick),1,32)) && ($gettok($readini($+($network,users.ini),$chan,$nick),2,32) == op) { .msg $chan %logo.l $chan 04,01Op %logo.r  $+ $nick has joined. | mode $chan +ov $nick $nick | halt }
  if ($strip($address($nick,2)) == $gettok($readini($+($network,users.ini),$chan,$nick),1,32)) && ($gettok($readini($+($network,users.ini),$chan,$nick),2,32) == helper) { .msg $chan %logo.l $chan 04,01Helper %logo.r  $+ $nick has joined. | mode $chan +hv $nick $nick | halt }
  if ($strip($address($nick,2)) == $gettok($readini($+($network,users.ini),$chan,$nick),1,32)) && ($gettok($readini($+($network,users.ini),$chan,$nick),2,32) == voice) { .msg $chan %logo.l $chan 04,01Voice %logo.r  $+ $nick has joined. | mode $chan +v $nick | halt }
}
on *:part:#: {
  set $+(%,$nick,totalparts) $calc($($+(%,$nick,totalparts),2) + 1)
  if (%serverrelay == on) && ($chan == %rchan) { relayevent $network $nick parted # }
  if ($($+(%,join,$chan,$nick),2) == $nick) && ($($+(%,$chan,flyby),2) == on) { $iif($+(%,flyby,$chan),inc $+(%,flyby,$chan),set $+(%,flyby,$chan) 1) | ban -u300 $chan $nick 2 Fly-By Protect | .msg $chan %logo.l $($+(%,join,$chan,$nick),2) %logo.r was Fly-By %logo.l $($+(%,flyby,$chan),2) %logo.r Since $($+(%,botstartdate),2) }
  if (%relay == on) && ($chan == %chan1) { msg %chan2 Part %logo.l $nick %logo.r } 
  if (!$read(lastseen.txt, w, * $+ $nick- $+ *)) { write lastseen.txt %logo.l $nick %logo.r was last seen leaving %logo.l $chan %logo.r On %logo.l $fulldate %logo.r }
  else { write -dw $+ * $+ $nick $+ * lastseen.txt | write lastseen.txt %logo.l $nick %logo.r was last seen leaving %logo.l $chan %logo.r On %logo.l $fulldate %logo.r }
}
on 1:quit: {
  chkflyby
  set $+(%,$nick,totalquits) $calc($($+(%,$nick,totalquits),2) + 1)
  if (*.split isin $strip($1-)) {
    if (!%ns) { ame 4,1%logo.l NetSplit Detected 4,1%logo.r | set -u180 %ns 1 }
  }
  if (%relay == on) { msg %chan2 Quit - %logo.l $nick %logo.r }  
  if (!$read(lastseen.txt, w, * $+ $nick $+ *)) { write lastseen.txt %logo.l $nick %logo.r was last seen leaving %logo.l $network %logo.r On %logo.l $fulldate %logo.r }
  else { write -dw $+ * $+ $nick $+ * lastseen.txt | write lastseen.txt %logo.l $nick %logo.r was last seen leaving %logo.l $network %logo.r On %logo.l $fulldate %logo.r }
  if (%serverrelay == on) {
    var %a = $comchan($nick,0)
    while (%a) {
      if ($comchan($nick,%a) == %rchan) { relayevent $network $nick quit: $iif(($1-),$1-,No Quit Message) | dec %a }
      else { dec %a }
    }
  }
}
/* 
On Nick Event 
*/
on *:nick: {
  if (%relay == on) && ($chan == %chan1) { msg %chan2 %logo.l $nick %logo.r is now %logo.l $newnick %logo.r } 
  if ($nick == $gettok($readini(users.ini,botmaster,$nick),1,32)) { writeini users.ini botmaster $newnick $newnick $gettok($readini(users.ini,botmaster,$nick),2,32) | remini users.ini botmaster $nick } 
  var %a = 1
  var %b = $comchan($newnick,0)
  while %a <= %b { 
    if ($read(abuse.txt, w, $newnick $+ *)) { .msg $comchan($newnick,%a) $gettok($read(abuse.txt, w, $newnick $+ *),2-,32) }
    if ($newnick == $gettok($readini(badnicks.ini,$comchan($newnick,%a),$newnick),1,32)) { ban -ku300 $comchan($newnick,%a) $newnick 2 Bad Nick }
    if ($gettok($readini($+($network,users.ini),$comchan($newnick,%a),$nick),2,32) == owner) { writeini $+($network,users.ini) $comchan($newnick,%a) $newnick $gettok($readini(users.ini,$comchan($newnick,%a),$nick),1,32) owner | remini $+($network,users.ini) $comchan($newnick,%a) $nick }
    if ($gettok($readini($+($network,users.ini),$comchan($newnick,%a),$nick),2,32) == admin) { writeini $+($network,users.ini) $comchan($newnick,%a) $newnick $gettok($readini(users.ini,$comchan($newnick,%a),$nick),1,32) admin | remini $+($network,users.ini) $comchan($newnick,%a) $nick }
    if ($gettok($readini($+($network,users.ini),$comchan($newnick,%a),$nick),2,32) == op) { writeini $+($network,users.ini) $comchan($newnick,%a) $newnick $gettok($readini(users.ini,$comchan($newnick,%a),$nick),1,32) op | remini $+($network,users.ini) $comchan($newnick,%a) $nick }
    if ($gettok($readini($+($network,users.ini),$comchan($newnick,%a),$nick),2,32) == helper) { writeini $+($network,users.ini) $comchan($newnick,%a) $newnick $gettok($readini(users.ini,$comchan($newnick,%a),$nick),1,32) helper | remini $+($network,users.ini) $comchan($newnick,%a) $nick }
    if ($gettok($readini($+($network,users.ini),$comchan($newnick,%a),$nick),2,32) == voice) { writeini $+($network,users.ini) $comchan($newnick,%a) $newnick $gettok($readini(users.ini,$comchan($newnick,%a),$nick),1,32) voice | remini $+($network,users.ini) $comchan($newnick,%a) $nick }
    else { inc %a } 
} }
/* 
On dns Event 
*/
on 1:dns: {
  var %n = $dns(0)
  .msg %targ %logo.l DNS %logo.r Found %logo.l %n %logo.r Addresse(s) for %logo.l $dns(%n).addr %logo.r
  while (%n > 0) { .msg %targ %logo.l DNS %logo.r Address: %logo.l $dns(%n).addr %logo.r Ip: %logo.l $dns(%n).ip %logo.r | dec %n
} }
/* 
On Topic Event 
*/
on 1:topic:#: {
  if ($nick == ChanServ) || ($nick == Pazuzu) { halt }
  if ($nick == $me) || ($gettok($readini($+($network,users.ini),$chan,$nick),2,32) == owner) { set $+(%,topic,$3) $1- | halt }
  if ($($+(%,topiclock,$chan),2) == on) { .msg $chan %logo.l Enforcing Topic %logo.r $($+(%,topic,$chan),2) | topic $chan $($+(%,topic,$chan),2) }
}
/* 
On Mode Event 
*/
on *:mode:#: {
  if ($($+(%,protect,$chan),2) == on) {
    if ($chan == $gettok($readini(users.ini,modelock,$chan),1,32)) { 
      if ($nick == ChanServ) || ($nick == Pazuzu) { halt }
      if ($nick == $me) || ($gettok($readini($+($network,users.ini),$chan,$nick),2,32) == owner) { halt }
      else { mode $chan $replace($1-,+,-) | .msg $chan %logo.l Enforcing Modes %logo.r $gettok($readini(users.ini,modelock,$chan),2-,32) | mode $chan $gettok($readini(users.ini,modelock,$chan),2-,32) }
} } }
/* 
On Ban/Unban Events 
*/
on *:ban:#: { set $+(%,$nick,totalbans) $calc($($+(%,$nick,totalbans),2) + 1) | write banned.txt %logo.l $chan %logo.r Ban %logo.l $banmask %logo.r was banned by %logo.l $nick %logo.r on %logo.l $fulldate %logo.r }
on *:unban:#: { write -dw $+ * $+ $2 $+ * banned.txt }
/* 
On Kick Event 
*/
on *:kick:#: { 
  set $+(%,$nick,totalkicks) $calc($($+(%,$nick,totalkicks),2) + 1) 
  if ($chan == %rchan) { relayevent $network $nick kicked $knick from # }
  if ($($+(%,protect,$chan),2) == on) {  
    if ($strip($address($nick,2)) == $gettok($readini($+($network,users.ini),$chan,$nick),1,32)) && ($gettok($readini($+($network,users.ini),$chan,$nick),2,32) == admin) { halt }
    if ($strip($address($nick,2)) == $gettok($readini($+($network,users.ini),$chan,$nick),1,32)) && ($gettok($readini($+($network,users.ini),$chan,$nick),2,32) == owner) { halt }
    if ($address($knick,2) == $gettok($readini($+($network,users.ini),$chan,$knick),1,32)) && ($gettok($readini($+($network,users.ini),$chan,$knick),2,32) == op) { remini $+($network,users.ini) $chan $nick | invite $nick $chan | io | .msg $chan %logo.l $nick %logo.r You may not kick a channel op. | .msg $chan %logo.l $nick %logo.r you are now being stripped of your %logo.l Op %logo.r status. | mode -o $nick }
    if ($address($knick,2) == $gettok($readini($+($network,users.ini),$chan,$knick),1,32)) && ($gettok($readini($+($network,users.ini),$chan,$knick),2,32) == admin) { remini $+($network,users.ini) $chan $nick | invite $nick $chan | io | .msg $chan %logo.l $nick %logo.r You may not kick a channel admin. | .msg $chan %logo.l $nick %logo.r you are now being stripped of your %logo.l Op %logo.r status. | mode -o $nick }
    if ($address($knick,2) == $gettok($readini($+($network,users.ini),$chan,$knick),1,32)) && ($gettok($readini($+($network,users.ini),$chan,$knick),2,32) == owner) { remini $+($network,users.ini) $chan $nick | invite $nick $chan | io | .msg $chan %logo.l $nick %logo.r You may not kick a channel owner. | .msg $chan %logo.l $nick %logo.r you are now being stripped of your %logo.l Op %logo.r status. | mode -o $nick }
} }
/* 
On Op/Deop Events 
*/
on *:op:#: { 
  if ($($+(%,protect,$chan),2) == on) {
    if (%relay == on) && ($chan == %chan1) { .msg %chan2 Op %logo.l $opnick %logo.r by %logo.l $nick %logo.r } 
    if ($nick == $me) || ($nick == chanserv) || ($nick == Pazuzu) { halt }
    if ($address($opnick,2) == $gettok($readini($+($network,users.ini),$chan,$opnick),1,32)) && ($gettok($readini($+($network,users.ini),$chan,$opnick),2,32) == op) { halt }
    if ($address($opnick,2) == $gettok($readini($+($network,users.ini),$chan,$opnick),1,32)) && ($gettok($readini($+($network,users.ini),$chan,$opnick),2,32) == admin) { halt }
    if ($address($opnick,2) == $gettok($readini($+($network,users.ini),$chan,$opnick),1,32)) && ($gettok($readini($+($network,users.ini),$chan,$opnick),2,32) == owner) { halt }
    if ($strip($address($nick,2)) == $gettok($readini($+($network,users.ini),$chan,$nick),1,32)) && ($gettok($readini($+($network,users.ini),$chan,$nick),2,32) == admin) { halt }
    if ($strip($address($nick,2)) == $gettok($readini($+($network,users.ini),$chan,$nick),1,32)) && ($gettok($readini($+($network,users.ini),$chan,$nick),2,32) == owner) { halt }
    else { io | .msg $chan %logo.l $opnick %logo.r is not a %logo.l Op %logo.r in this channel. | mode $chan -o $opnick | .msg $chan %logo.l $nick %logo.r you are now being stripped of your %logo.l Op %logo.r status. | remini $+($network,users.ini) $chan $nick | mode $chan -o $nick }
} }
on *:deop:#: {
  if ($+(%,protect,$chan)) {
    if (%relay == on) && ($chan == %chan1) { .msg %chan2 DeOp %logo.l $opnick %logo.r by %logo.l $nick %logo.r } 
    if ($nick == $me) { halt }
    if ($strip($address($nick,2)) == $gettok($readini($+($network,users.ini),$chan,$nick),1,32)) && ($gettok($readini($+($network,users.ini),$chan,$nick),2,32) == admin) { halt }
    if ($strip($address($nick,2)) == $gettok($readini($+($network,users.ini),$chan,$nick),1,32)) && ($gettok($readini($+($network,users.ini),$chan,$nick),2,32) == owner) { halt }
    if ($address($opnick,2) == $gettok($readini($+($network,users.ini),$chan,$opnick),1,32)) && ($gettok($readini($+($network,users.ini),$chan,$opnick),2,32) == owner) { remini $+($network,users.ini) $chan $nick | io | .msg $chan You may not deop a channel owner, You are now being stripped of your Op status. | mode $chan +o $opnick | mode $chan -o $nick }
    if ($address($opnick,2) == $gettok($readini($+($network,users.ini),$chan,$opnick),1,32)) && ($gettok($readini($+($network,users.ini),$chan,$opnick),2,32) == admin) { remini $+($network,users.ini) $chan $nick | io | .msg $chan You may not deop a channel admin, You are now being stripped of your Op status. | mode $chan +o $opnick | mode $chan -o $nick }
    if ($address($opnick,2) == $gettok($readini($+($network,users.ini),$chan,$opnick),1,32)) && ($gettok($readini($+($network,users.ini),$chan,$opnick),2,32) == op) { remini $+($network,users.ini) $chan $nick | io | .msg $chan You may not deop a channel op, You are now being stripped of your Op status. | mode $chan +o $opnick | mode $chan -o $nick }
} }
/* 
On Help/Dehelp Events 
*/
on *:help:#: { 
  if ($+(%,protect,$chan)) {
    if (%relay == on) && ($chan == %chan1) { .msg %chan2 Help %logo.l $hnick %logo.r by %logo.l $nick %logo.r } 
    if ($nick == $me) || ($nick == chanserv) || ($nick == Pazuzu) { halt }
    if ($gettok($readini($+($network,users.ini),$chan,$hnick),2,32) == helper) || ($gettok($readini($+($network,users.ini),$chan,$hnick),2,32) == op) { halt }
    if ($gettok($readini($+($network,users.ini),$chan,$hnick),2,32) == admin) || ($gettok($readini($+($network,users.ini),$chan,$hnick),2,32) == owner) { halt }
    if ($strip($address($nick,2)) == $gettok($readini($+($network,users.ini),$chan,$nick),1,32)) && ($gettok($readini($+($network,users.ini),$chan,$nick),2,32) == op) { halt }
    if ($strip($address($nick,2)) == $gettok($readini($+($network,users.ini),$chan,$nick),1,32)) && ($gettok($readini($+($network,users.ini),$chan,$nick),2,32) == admin) { halt }
    if ($strip($address($nick,2)) == $gettok($readini($+($network,users.ini),$chan,$nick),1,32)) && ($gettok($readini($+($network,users.ini),$chan,$nick),2,32) == owner) { halt }
    if ($gettok($readini($+($network,users.ini),$chan,$hnick),2,32) != helper) { io | .msg $chan %logo.l $hnick %logo.r is not a %logo.l Helper %logo.r in this channel. | mode $chan -h $hnick | .msg $chan %logo.l $nick %logo.r you are now being stripped of your %logo.l Op %logo.r status. | remini $+($network,users.ini) $chan $nick | mode $chan -o $nick }
} }
on *:dehelp:#: {
  if ($+(%,protect,$chan)) {
    if (%relay == on) && ($chan == %chan1) { msg %chan2 DeHelp %logo.l $hnick %logo.r by %logo.l $nick %logo.r } 
    if ($nick == $me) { halt }
    if ($strip($address($nick,2)) == $gettok($readini($+($network,users.ini),$chan,$nick),1,32)) && ($gettok($readini($+($network,users.ini),$chan,$nick),2,32) == op) { halt }
    if ($strip($address($nick,2)) == $gettok($readini($+($network,users.ini),$chan,$nick),1,32)) && ($gettok($readini($+($network,users.ini),$chan,$nick),2,32) == admin) { halt }
    if ($strip($address($nick,2)) == $gettok($readini($+($network,users.ini),$chan,$nick),1,32)) && ($gettok($readini($+($network,users.ini),$chan,$nick),2,32) == owner) { halt }
    if ($address($hnick,2) == $gettok($readini($+($network,users.ini),$chan,$hnick),1,32)) && ($gettok($readini($+($network,users.ini),$chan,$hnick),2,32) == owner) { io | .msg $chan You may not dehelp a channel owner, You are now being stripped of your Op status. | mode $chan +h $hnick | remini $+($network,users.ini) $chan $nick | mode $chan -o $nick }
    if ($address($hnick,2) == $gettok($readini($+($network,users.ini),$chan,$hnick),1,32)) && ($gettok($readini($+($network,users.ini),$chan,$hnick),2,32) == admin) { io | .msg $chan You may not dehelp a channel admin, You are now being stripped of your Op status. | mode $chan +h $hnick | remini $+($network,users.ini) $chan $nick | mode $chan -o $nick }
    if ($address($hnick,2) == $gettok($readini($+($network,users.ini),$chan,$hnick),1,32)) && ($gettok($readini($+($network,users.ini),$chan,$hnick),2,32) == op) { io | .msg $chan You may not dehelp a channel op, You are now being stripped of your Op status. | mode $chan +h $hnick | remini $+($network,users.ini) $chan $nick | mode $chan -o $nick }
    if ($address($hnick,2) == $gettok($readini($+($network,users.ini),$chan,$hnick),1,32)) && ($gettok($readini($+($network,users.ini),$chan,$hnick),2,32) == helper) { io | .msg $chan You may not dehelp a channel helper, You are now being stripped of your Op status. | mode $chan +h $hnick | remini $+($network,users.ini) $chan $nick | mode $chan -o $nick }
} }
/* 
On Voice/Devoice Events 
*/
on *:voice:#: { 
  if ($+(%,protect,$chan)) {
    if (%relay == on) && ($chan == %chan1) { msg %chan2 Voice %logo.l $vnick %logo.r by %logo.l $nick %logo.r }
    if ($nick == $me) || ($nick == chanserv) || ($nick == Pazuzu) { halt } 
    if ($gettok($readini($+($network,users.ini),$chan,$vnick),2,32) == voice) || ($gettok($readini($+($network,users.ini),$chan,$vnick),2,32) == helper) || ($gettok($readini($+($network,users.ini),$chan,$vnick),2,32) == op) { halt }
    if ($gettok($readini($+($network,users.ini),$chan,$vnick),2,32) == admin) || ($gettok($readini($+($network,users.ini),$chan,$vnick),2,32) == owner) { halt }
    if ($strip($address($nick,2)) == $gettok($readini($+($network,users.ini),$chan,$nick),1,32)) && ($gettok($readini($+($network,users.ini),$chan,$nick),2,32) == helper) { halt }
    if ($strip($address($nick,2)) == $gettok($readini($+($network,users.ini),$chan,$nick),1,32)) && ($gettok($readini($+($network,users.ini),$chan,$nick),2,32) == op) { halt }
    if ($strip($address($nick,2)) == $gettok($readini($+($network,users.ini),$chan,$nick),1,32)) && ($gettok($readini($+($network,users.ini),$chan,$nick),2,32) == admin) { halt }
    if ($strip($address($nick,2)) == $gettok($readini($+($network,users.ini),$chan,$nick),1,32)) && ($gettok($readini($+($network,users.ini),$chan,$nick),2,32) == owner) { halt } 
    if ($gettok($readini($+($network,users.ini),$chan,$vnick),2,32) != voice) { io | .msg $chan %logo.l $vnick %logo.r is not a %logo.l Voice %logo.r in this channel. | mode $chan -v $vnick | .msg $chan %logo.l $nick %logo.r you are now being stripped of your %logo.l Op %logo.r status. | remini $+($network,users.ini) $chan $nick | mode $chan -o $nick }
} }
on *:devoice:#: {
  if ($+(%,protect,$chan)) {
    if (%relay == on) && ($chan == %chan1) { msg %chan2 DeVoice %logo.l $vnick %logo.r by %logo.l $nick %logo.r } 
    if ($nick == $me) { halt }
    if ($strip($address($nick,2)) == $gettok($readini($+($network,users.ini),$chan,$nick),1,32)) && ($gettok($readini($+($network,users.ini),$chan,$nick),2,32) == helper) { halt }
    if ($strip($address($nick,2)) == $gettok($readini($+($network,users.ini),$chan,$nick),1,32)) && ($gettok($readini($+($network,users.ini),$chan,$nick),2,32) == op) { halt }
    if ($strip($address($nick,2)) == $gettok($readini($+($network,users.ini),$chan,$nick),1,32)) && ($gettok($readini($+($network,users.ini),$chan,$nick),2,32) == admin) { halt }
    if ($strip($address($nick,2)) == $gettok($readini($+($network,users.ini),$chan,$nick),1,32)) && ($gettok($readini($+($network,users.ini),$chan,$nick),2,32) == owner) { halt }
    if ($address($vnick,2) == $gettok($readini($+($network,users.ini),$chan,$vnick),1,32)) && ($gettok($readini($+($network,users.ini),$chan,$vnick),2,32) == owner) { io | .msg $chan You may not devoice a channel owner, You are now being stripped of your Op status. | mode $chan +v $vnick | remini $+($network,users.ini) $chan $nick | mode $chan -o $nick }
    if ($address($vnick,2) == $gettok($readini($+($network,users.ini),$chan,$vnick),1,32)) && ($gettok($readini($+($network,users.ini),$chan,$vnick),2,32) == admin) { io | .msg $chan You may not devoice a channel admin, You are now being stripped of your Op status. | mode $chan +v $vnick | remini $+($network,users.ini) $chan $nick | mode $chan -o $nick }
    if ($address($vnick,2) == $gettok($readini($+($network,users.ini),$chan,$vnick),1,32)) && ($gettok($readini($+($network,users.ini),$chan,$vnick),2,32) == op) { io | .msg $chan You may not devoice a channel op, You are now being stripped of your Op status. | mode $chan +v $vnick | remini $+($network,users.ini) $chan $nick | mode $chan -o $nick }
    if ($address($vnick,2) == $gettok($readini($+($network,users.ini),$chan,$vnick),1,32)) && ($gettok($readini($+($network,users.ini),$chan,$vnick),2,32) == helper) { io | .msg $chan You may not devoice a channel helper, You are now being stripped of your Op status. | mode $chan +v $vnick | remini $+($network,users.ini) $chan $nick | mode $chan -o $nick }
    if ($address($vnick,2) == $gettok($readini($+($network,users.ini),$chan,$vnick),1,32)) && ($gettok($readini($+($network,users.ini),$chan,$vnick),2,32) == voice) { io | .msg $chan You may not devoice a channel voice, You are now being stripped of your Op status. | mode $chan +v $vnick | remini $+($network,users.ini) $chan $nick | mode $chan -o $nick }
} }
/* 
On Notice Event 
*/
on *:notice:*:*: {
  if ($me * is already in use* isin $strip($1-)) { .msg nickserv ghost %botnick %botpass }
  if (Ghost with your nick has been killed* isin $strip($1-)) { .nick %botnick | .identify %botpass }
  if (STATUS isin $strip($1-)) { 
    if (0 isin $strip($1-)) { .msg %targ %logo.l %targnick %logo.r No such user online, or not registered. }
    if (1 isin $strip($1-)) { .msg %targ %logo.l %targnick %logo.r User not recognised as nick owner. }
    if (2 isin $strip($1-)) { .msg %targ %logo.l %targnick %logo.r User recognised as nick owner via Access List only. }
    if (3 isin $strip($1-)) { .msg %targ %logo.l %targnick %logo.r User recognised as nick owner via Identify command. }
} }

/* 
On Notify/UnNotify Events 
*/
on 1:notify: { 
  set $+(%,ticks,$network,$nick) 0
  $+(.timer,ticks,$network,$nick) 0 1 inc $($+(%,ticks,$network,$nick),1) 1
}
on 1:unotify: { 
  echo -a $nick was online for: $duration($($+(%,ticks,$network,$nick),2))
  $+(.timer,ticks,$network,$nick) off
  set $+(%,tickstotal,$network,$nick) $calc($($+(%,tickstotal,$network,$nick),2) + $($+(%,ticks,$network,$nick),2))
}
/*
Rawmode
*/
on *:rawmode:%rchan: { 
  if (%serverrelay == on) { relayevent $network $nick sets mode $1 on $2 } 
}
/* 
On Action Event 
*/
on *:action:*:*: { 
  set $+(%,$nick,totalmsg) $calc($($+(%,$nick,totalmsg),2) + 1)
  set $+(%,$nick,totalchar) $calc($len($1-) + $($+(%,$nick,totalchar),2))
  set $+(%,$nick,totalword) $calc($numtok($1-,32) + $($+(%,$nick,totalword),2))
  if (%serverrelay == on) && ($chan == %rchan) { relayevent $network $+($chr(60),$nick) $1- }
  if (%relay == on) && ($chan == %chan1) { msg %chan2 %logo.l $nick %logo.r $1- } 
}
/* 
On Text Event 
*/
on *:text:*:*: {
  set $+(%,$nick,totalmsg) $calc($($+(%,$nick,totalmsg),2) + 1)
  set $+(%,$nick,totalchar) $calc($len($1-) + $($+(%,$nick,totalchar),2))
  set $+(%,$nick,totalword) $calc($numtok($1-,32) + $($+(%,$nick,totalword),2))
  if (%serverrelay == on) && ($chan == %rchan) { relayevent $network $+($chr(60),$nick,$chr(62)) $1- }
  ;
  ; Flood Catcher ( #:# Lines:Seconds )
  ;
  if ($($+(%,$chan,flood),2) == on) { 
    set -u $+ $+(%,$chan,floodin),2) $+(%,$nick,flood) 1 
    if ($($+(%,$nick,flood),2) >= $($+(%,$chan,floodlines),2)) { unset $+(%,$nick,flood) | ban -ku300 $chan $nick 2 Flooding. | .notice $nick You have been banned from %logo.l $chan %logo.r for Flooding. } 
  } 
  ;
  ; Flood Catcher ( Long Messages )
  ;
  if ($($+(%,$chan,bflood),2) == on) { 
    if ($len($strip($1-)) >= $($+(%,$chan,bigflood),2)) { ban -ku300 $chan $nick 2 Flooding. | .notice $nick You have been banned from %logo.l $chan %logo.r for Flooding. } 
  } 
  ;
  ; single server relay
  ;
  if (%relay == on) && ($chan == %chan1) { msg %chan2 %logo.l $nick %logo.r $1- } 
  if (!$read(info.txt, w,$1 $+ *)) { haltdef }
  if ($read(info.txt, w,$1 $+ *)) { if ($1) && (!$2) { .msg $chan $read(info.txt, w,$1 $+ *) } }

  if ($($+(%,trigger,$nick),2) == 3) {
    if ($strip($address($nick,2)) == $gettok($readini($+($network,users.ini),botmaster,$nick),2,32)) { unset $+(%,trigger,$nick) }
    else { .msg $chan %logo.l $nick %logo.r You are being ignored for 5 minutes, for trigger abuse. | ignore -u300 $nick | halt }
  }

  ;
  ; Public Commands
  ;
  if ($+(%trigger,about) == $strip($1)) {
    .timer 1 1 .notice $nick %logo.l SassIRC 12,01m04,01I04,01R08,01C Channel Protection Bot %logo.r Coded By %logo.l PuNkTuReD %logo.r
    .timer 1 4 .notice $nick Is currently being used on %logo.l $hget(Servers,0).item %logo.r server(s) in a total of %logo.l $+(%,totchans),2) %logo.r Channel(s), Last Reboot: %logo.l $uptime(server,2) %logo.r ago.
    .timer 1 7 .notice $nick %logo.l $+(%trigger,commands) %logo.r to see a list of available commands. 
  }
  if ($+(%trigger,checknick) == $strip($1)) {
    if (!$2) { eis | .msg $chan ?checknick command: ?checknick nick }
    else { set -u10 %targ $chan | set -u10 %targnick $2 | .msg nickserv status $2 }
  }
  if ($+(%trigger,commands) == $strip($1)) {
    .notice $nick 04,01**** %logo.l Bot Master %logo.r commands are 04,01Red. %logo.l Channel Owner %logo.r commands are 07,01Orange. %logo.l Public %logo.r commands are 08,01Yellow.
    ; Bot Master Commands
    if ($strip($address($nick,2)) == $gettok($readini($+($network,users.ini),botmaster,$nick),2,32)) {
      .notice $nick 04,01?act nick/channel message - 04,01?addowner nick channel - 04,01?autojoin add/del/list network channel - 04,01?botmaster nick - 04,01?clonescanner on/off - 04,01?cycle channel - 
      .notice $nick 04,01?global messsage - 04,01?kill - 04,01?reboot - 04,01?relay on/off channel_1 channel_2 - 04,01?remember info_here - 04,01?say nick/channel message - 04,01?set nick/password nick/password - 04,01?server add/del server - 
    }
    ; Channel Owner Commands
    if ($strip($address($nick,2)) == $gettok($readini($+($network,users.ini),$chan,$nick),1,32)) && ($gettok($readini($+($network,users.ini),$chan,$nick),2,32) == owner ) { 
      .notice $nick 07,01?addadmin nick - 07,01?addop nick - 07,01?addhelper nick - 07,01?addvoice nick - 07,01?badnick add/del nick - 07,01?ban add/del nick reason - 07,01?baninfo total/banmask - 
      .notice $nick 07,01?bigflood on/off/status # - 07,01?flood on/off/status #:# - 07,01?flyby on/off/status - 07,01?greet on/off message - 07,01?kick nick reason - 07,01?modelock list/modes - 07,01?protect on/off - 07,01?spam on/off/status - 07,01?topiclock on/off topic - 
    }
    ; Public Commands
    .notice $nick 08,01?about - 08,01?checknick nick - 08,01?commands - 08,01?dns nick/address - 08,01?ircop scan channel - 08,01?lastseen nick - 08,01?stats nick - 08,01?rules -
  }
  if ($+(%trigger,dns) == $strip($1)) {
    if (!$2) { eis | .msg $chan ?dns command: ?dns address }
    if ($2) { set -u5 %targ $chan | .dns $2 }
  }
  if ($+(%trigger,ircop) == $strip($1)) {
    if (!$3) { eis | .msg $chan ?ircop command: ?ircop scan #channel }
    if ($2 == scan) { 
      if ($me ison $3) { set -u10 %msgchan $chan | set -u10 %chkchan1 $3 | ircopscan %chkchan1 }
      else { .msg $chan %logo.l $nick %logo.r I can only scan channels i am on. }
  } }
  if ($+(%trigger,lastseen) == $strip($1)) {
    if (!$2) { eis | .msg $chan ?lastseen command: ?lastseen nick | halt }
    if ($2) { 
      if ($2 ison $chan) { .msg $chan %logo.l Last Seen04,01 $2 %logo.r is on %logo.l $chan %logo.r already %logo.l $nick %logo.r }
      else {
        if ($2 == $gettok($read(lastseen.txt, w,* $+ $2- $+ *),2,32)) { .msg $chan %logo.l Last Seen04,01 $2 %logo.r $read(lastseen.txt, w,* $+ $2- $+ *) } 
        else { .msg $chan %logo.l Last Seen %logo.r I have No Records for $2  }
      }
  } }
  if ($+(%trigger,rules) == $strip($1)) {
    .timer 1 1 .msg $chan $iif($($+(%,protect,$chan),2) == on,$(%logo.l  Channel is being protected %logo.r ),) $iif($($+(%,protect,$chan),2) == on,Status protection (@ % +,Op Hop Voice) ,)
    .timer 1 4 .msg $chan $iif($chan == $gettok($readini(users.ini,modelock,$chan),1,32),$(%logo.l  Mode Lock %logo.r ),) $iif($chan == $gettok($readini(users.ini,modelock,$chan),1,32), $gettok($readini(users.ini,modelock,$chan),2-,32) ,)
    .timer 1 7 .msg $chan $iif($($+(%,topiclock,$chan),2) == on,$(%logo.l  Topic lock %logo.r ),) $iif($($+(%,topiclock,$chan),2) == on,$($+(%,topic,$chan),2) ,)
    .timer 1 10 .msg $chan $iif($($+(%,greet,$chan),2) == on,$(%logo.l  Greet Message %logo.r ),) $iif($($+(%,greet,$chan),2) == on,$($+(%,joingreet,$chan),2) ,)
    .timer 1 13 .msg $chan $iif($($+(%,sp,$chan),2) == on,$(%logo.l  Spam Protect %logo.r ),) $iif($($+(%,$chan,flyby),2) == on,$(%logo.l  Fly-By Protect %logo.r ),) $iif($($+(%,$chan,flood),2) == on,$(%logo.l  Flood Protect %logo.r ),) $iif($($+(%,$chan,bflood),2) == on,$(%logo.l  Big Flood Protect %logo.r ),)
  }
  if ($+(%trigger,stats) == $strip($1)) {
    if (!$2) { eis | .msg $chan ?stats command: ?stats nick | .msg $chan Or: ?stats reset nick | halt }
    if ($2) { 
      if ($2 == reset) && ($strip($address($nick,2)) == $gettok($readini($+($network,users.ini),botmaster,$nick),2,32)) { unset $+(%,$3,*) | .msg $chan %logo.l Stats for04,01 $3 %logo.r Have Been Reset. | halt }
      else {
        if ($($+(%,$2,totaljoin),2)) {
          if ($strip($address($nick,2)) == $gettok($readini($+($network,users.ini),botmaster,$nick),2,32)) {
            .msg $chan %logo.l Stats for04,01 $2 %logo.r Total Joins: %logo.l $iif($($+(%,$2,totaljoin),2),$($+(%,$2,totaljoin),2),0) %logo.r Total Parts: %logo.l $iif($($+(%,$2,totalparts),2),$($+(%,$2,totalparts),2),0) %logo.r Total Quits: %logo.l $iif($($+(%,$2,totalquits),2),$($+(%,$2,totalquits),2),0) %logo.r Total Bans: %logo.l $iif($($+(%,$2,totalbans),2),$($+(%,$2,totalbans),2),0) %logo.r Total Kicks: %logo.l $iif($($+(%,$2,totalkicks),2),$($+(%,$2,totalkicks),2),0) %logo.r Total Messages Sent: %logo.l $iif($($+(%,$2,totalmsg),2),$($+(%,$2,totalmsg),2),0) %logo.r Total Letters: %logo.l $iif($($+(%,$2,totalchar),2),$($+(%,$2,totalchar),2),0) %logo.r Total Words: %logo.l $iif($($+(%,$2,totalword),2),$($+(%,$2,totalword),2),0) %logo.r Total Online Time %logo.l $duration($calc($($+(%,ticks,$network,$2),2) + $($+(%,tickstotal,$network,$2),2)))  %logo.r 
            halt
          }
          if ($strip($address($nick,2)) == $gettok($readini($+($network,users.ini),$chan,$nick),1,32)) && ($gettok($readini($+($network,users.ini),$chan,$nick),2,32) == owner) {
            .msg $chan %logo.l Stats for04,01 $2 %logo.r Total Joins: %logo.l $iif($($+(%,$2,totaljoin),2),$($+(%,$2,totaljoin),2),0) %logo.r Total Parts: %logo.l $iif($($+(%,$2,totalparts),2),$($+(%,$2,totalparts),2),0) %logo.r Total Quits: %logo.l $iif($($+(%,$2,totalquits),2),$($+(%,$2,totalquits),2),0) %logo.r Total Bans: %logo.l $iif($($+(%,$2,totalbans),2),$($+(%,$2,totalbans),2),0) %logo.r Total Kicks: %logo.l $iif($($+(%,$2,totalkicks),2),$($+(%,$2,totalkicks),2),0) %logo.r Total Messages Sent: %logo.l $iif($($+(%,$2,totalmsg),2),$($+(%,$2,totalmsg),2),0) %logo.r Total Letters: %logo.l $iif($($+(%,$2,totalchar),2),$($+(%,$2,totalchar),2),0) %logo.r Total Words: %logo.l $iif($($+(%,$2,totalword),2),$($+(%,$2,totalword),2),0) %logo.r Total Online Time %logo.l $duration($calc($($+(%,ticks,$network,$2),2) + $($+(%,tickstotal,$network,$2),2)))  %logo.r
            halt
          }
          if ($strip($address($nick,2)) == $gettok($readini($+($network,users.ini),$chan,$nick),1,32)) && ($gettok($readini($+($network,users.ini),$chan,$nick),2,32) == admin) { 
            .msg $chan %logo.l Stats for04,01 $2 %logo.r Total Joins: %logo.l $iif($($+(%,$2,totaljoin),2),$($+(%,$2,totaljoin),2),0) %logo.r Total Parts: %logo.l $iif($($+(%,$2,totalparts),2),$($+(%,$2,totalparts),2),0) %logo.r Total Quits: %logo.l $iif($($+(%,$2,totalquits),2),$($+(%,$2,totalquits),2),0) %logo.r Total Bans: %logo.l $iif($($+(%,$2,totalbans),2),$($+(%,$2,totalbans),2),0) %logo.r Total Kicks: %logo.l $iif($($+(%,$2,totalkicks),2),$($+(%,$2,totalkicks),2),0) %logo.r Total Messages Sent: %logo.l $iif($($+(%,$2,totalmsg),2),$($+(%,$2,totalmsg),2),0) %logo.r Total Letters: %logo.l $iif($($+(%,$2,totalchar),2),$($+(%,$2,totalchar),2),0) %logo.r Total Words: %logo.l $iif($($+(%,$2,totalword),2),$($+(%,$2,totalword),2),0) %logo.r Total Online Time %logo.l $duration($calc($($+(%,ticks,$network,$2),2) + $($+(%,tickstotal,$network,$2),2)))  %logo.r
            halt
          }
          if ($strip($address($nick,2)) == $gettok($readini($+($network,users.ini),$chan,$nick),1,32)) && ($gettok($readini($+($network,users.ini),$chan,$nick),2,32) == op) {
            .msg $chan %logo.l Stats for04,01 $2 %logo.r Total Joins: %logo.l $iif($($+(%,$2,totaljoin),2),$($+(%,$2,totaljoin),2),0) %logo.r Total Parts: %logo.l $iif($($+(%,$2,totalparts),2),$($+(%,$2,totalparts),2),0) %logo.r Total Quits: %logo.l $iif($($+(%,$2,totalquits),2),$($+(%,$2,totalquits),2),0) %logo.r Total Bans: %logo.l $iif($($+(%,$2,totalbans),2),$($+(%,$2,totalbans),2),0) %logo.r Total Kicks: %logo.l $iif($($+(%,$2,totalkicks),2),$($+(%,$2,totalkicks),2),0) %logo.r Total Messages Sent: %logo.l $iif($($+(%,$2,totalmsg),2),$($+(%,$2,totalmsg),2),0) %logo.r Total Letters: %logo.l $iif($($+(%,$2,totalchar),2),$($+(%,$2,totalchar),2),0) %logo.r Total Words: %logo.l $iif($($+(%,$2,totalword),2),$($+(%,$2,totalword),2),0) %logo.r Total Online Time %logo.l $duration($calc($($+(%,ticks,$network,$2),2) + $($+(%,tickstotal,$network,$2),2)))  %logo.r
            halt
          }
          if ($strip($address($nick,2)) == $gettok($readini($+($network,users.ini),$chan,$nick),1,32)) && ($gettok($readini($+($network,users.ini),$chan,$nick),2,32) == helper) {
            .msg $chan %logo.l Stats for04,01 $2 %logo.r Total Joins: %logo.l $iif($($+(%,$2,totaljoin),2),$($+(%,$2,totaljoin),2),0) %logo.r Total Parts: %logo.l $iif($($+(%,$2,totalparts),2),$($+(%,$2,totalparts),2),0) %logo.r Total Quits: %logo.l $iif($($+(%,$2,totalquits),2),$($+(%,$2,totalquits),2),0) %logo.r Total Bans: %logo.l $iif($($+(%,$2,totalbans),2),$($+(%,$2,totalbans),2),0) %logo.r Total Kicks: %logo.l $iif($($+(%,$2,totalkicks),2),$($+(%,$2,totalkicks),2),0) %logo.r Total Messages Sent: %logo.l $iif($($+(%,$2,totalmsg),2),$($+(%,$2,totalmsg),2),0) %logo.r Total Letters: %logo.l $iif($($+(%,$2,totalchar),2),$($+(%,$2,totalchar),2),0) %logo.r Total Words: %logo.l $iif($($+(%,$2,totalword),2),$($+(%,$2,totalword),2),0) %logo.r Total Online Time %logo.l $duration($calc($($+(%,ticks,$network,$2),2) + $($+(%,tickstotal,$network,$2),2)))  %logo.r
            halt
          }
          else { .msg $chan %logo.l Stats for04,01 $2 %logo.r Total Joins: %logo.l $iif($($+(%,$2,totaljoin),2),$($+(%,$2,totaljoin),2),0) %logo.r Total Parts: %logo.l $iif($($+(%,$2,totalparts),2),$($+(%,$2,totalparts),2),0) %logo.r Total Quits: %logo.l $iif($($+(%,$2,totalquits),2),$($+(%,$2,totalquits),2),0) %logo.r Total Bans: %logo.l $iif($($+(%,$2,totalbans),2),$($+(%,$2,totalbans),2),0) %logo.r Total Kicks: %logo.l $iif($($+(%,$2,totalkicks),2),$($+(%,$2,totalkicks),2),0) %logo.r Total Messages Sent: %logo.l $iif($($+(%,$2,totalmsg),2),$($+(%,$2,totalmsg),2),0) %logo.r Total Letters: %logo.l $iif($($+(%,$2,totalchar),2),$($+(%,$2,totalchar),2),0) %logo.r Total Words: %logo.l $iif($($+(%,$2,totalword),2),$($+(%,$2,totalword),2),0) %logo.r }
        }
        else { .msg $chan %logo.l Stats for04,01 $2 %logo.r No stats Recorded. } 
      } 
  } }
  ;
  ; Bot Master Commands
  ;
  if ($strip($address($nick,2)) == $gettok($readini($+($network,users.ini),botmaster,$nick),2,32)) {
    if ($+(%trigger,act) == $strip($1)) {
      if (!$3) { eis | .msg $chan ?act command: ?act nick/#channel message }
      if ($3) { .describe $chan %logo.l $me %logo.r $3- | .describe $2 $3- }
    }
    if ($+(%trigger,addowner) == $strip($1)) {
      if (!$3) { eis | .msg $chan ?addowner command: ?addowner nick #channel }
      if ($3) { notify $2 | writeini $+($network,users.ini) $3 $2 $address($2,2) owner | .msg $chan Added %logo.l $2 %logo.r as %logo.l $3 %logo.r Owner. }
    }
    if ($+(%trigger,autojoin) == $strip($1)) {
      if (!$2) { eis | .msg $chan ?autojoin command: ?autojoin add/del/list network #channel }
      if ($2 == add) { $iif(%totchans == $null,set %totchans 1,set %totchans $calc(%totchans + 1)) | hadd -m AutoJoin $3 $iif($hget(Autojoin,$3),$+($hget(Autojoin,$3),$chr(44),$4-),$+($4-,$chr(44))) | .msg $chan Added %logo.l $4 %logo.r to %logo.l $3 %logo.r Autojoin channel(s), I will join on my next reboot. }
      if ($2 == del) { 
        set %totchans $calc(%totchans - 1)
        hadd AutoJoin $3 $remtok($hget(Autojoin,$3),$4-,1,44) 
        .msg $chan Deleted %logo.l $4 %logo.r from %logo.l $3 %logo.r Autojoin channel(s), I will leave on my next reboot. 
      }
      if ($2 == list) { 
        if (!$3) { eis | .msg $chan ?autojoin command: ?autojoin list network }
        else { .msg $chan I auto join these channel(s) on $+($3,:) %logo.l $hget(Autojoin,$3) %logo.r }
    } }
    if ($+(%trigger,badnick) == $strip($1)) {
      if (!$4) { eis | .msg $chan ?badnick command: ?badnick add/del nick | halt }
      if ($2 == add) { writeini badnicks.ini $chan $3 $3 | .msg $chan %logo.l Bad Nick04,01 $3 %logo.r Added to bad nicks list for %logo.l $chan %logo.r | halt }
      if ($2 == del) { remini badnicks.ini $chan $3 | .msg $chan %logo.l Bad Nick04,01 $3 %logo.r Removed from bad nicks list for %logo.l $chan %logo.r | halt }
    }
    if ($+(%trigger,baninfo) == $strip($1)) {
      if (!$2) { eis | .msg $chan ?baninfo command: ?baninfo total/banmask | halt } 
      if ($2 == total) { .msg $chan %logo.l Total Bans %logo.r $lines(banned.txt) | halt }
      if (!$read(banned.txt, w, * $+ $2- $+ *)) { .msg $chan No Such Ban Exists. | halt }
      else { .msg $chan $read(banned.txt, w, * $+ $2- $+ *) | halt }
    }
    if ($+(%trigger,botmaster) == $strip($1)) {
      if (!$2) { eis | .msg $chan ?botmaster command: ?botmaster nick | halt } 
      if ($2) { notify $2 | writeini $+($network,users.ini) botmaster $2 $2 $address($2,2) | .msg $chan %logo.l $gettok($readini(users.ini,botmaster,$2),1,32) %logo.r  added to %logo.l Master List %logo.r }
    }
    if ($+(%trigger,clonescanner) == $strip($1)) {
      if (!$2) { eis | .msg $chan ?clonescanner command: ?clonescanner on/off }
      if ($2 == on) { set %clonescanner on | .msg $chan %logo.l Clone Scanner %logo.r On }
      if ($2 == off) { set %clonescanner off | .msg $chan %logo.l Clone Scanner %logo.r Off }
    }
    if ($+(%trigger,cycle) == $strip($1)) {
      if (!$2) { eis | .msg $chan ?cycle command: ?cycle #channel }
      if ($2) { .msg $2 %logo.l Cycling %logo.r as ordered by %logo.l $nick 04,01%logo.r | part $2 | .timer 1 1 join $2 } 
    }
    if ($+(%trigger,forget) == $strip($1)) { write $+(-ds,",$2-,") info.txt | msg $chan ok ill forget that. }
    if ($+(%trigger,global) == $strip($1)) {
      if (!$2) { eis | .msg $chan ?global command: ?global message }
      if ($2) { Global $nick $2- }
    } 
    if ($+(%trigger,kill) == $strip($1)) { scon -a //ame %logo.l Killed %logo.r by %logo.l $nick %logo.r | exit -n }
    if ($+(%trigger,openini) == $strip($1)) { run $mircdirusers.ini }
    if ($+(%trigger,openmircdir) == $strip($1)) { run $mircdir }
    if ($+(%trigger,raw) == $strip($1)) {
      if (!$2) { eis | .msg $chan ?raw command: ?raw command }
      if ($2) { $2- }
    }
    if ($+(%trigger,reboot) == $strip($1)) { scon -a //ame %logo.l Rebooting %logo.r as ordered by %logo.l $nick %logo.r command recieved on %logo.l $network %logo.r | exit -nr }
    if ($+(%trigger,relay) == $strip($1)) {
      if (!$2) { eis | .msg $chan ?relay command: ?relay channel_1 channel_2 }
      if (on == $2) { join $3 | set %chan1 $3 | set %chan2 $4 | set %relay on | msg $chan %logo.l Relay %logo.r from %logo.l $3 %logo.r to %logo.l $4 %logo.r }
      if (off == $2) { part %chan1 | unset %chan1 %chan2 %relay | msg $chan %logo.l Relay %logo.r OFF  }
    }
    if ($+(%trigger,remember) == $strip($1)) { 
      if (!$2) { eis | .msg $chan ?remember command: ?remember info_here }
      if (!$read(info.txt, w, $2 *)) && ($2) { write info.txt $2- | .msg $chan Ok, $nick $+ . | halt }
      if ($read(info.txt, w, $2 *)) && ($2) { write -dw $+ $2 $+ * info.txt | write info.txt $2- | .msg $chan Ok, $nick $+ . Replaced previous info. | halt }
    }
    if ($+(%trigger,say) == $strip($1)) {
      if (!$3) { eis | .msg $chan ?say command: ?say nick/#channel message }
      if ($3) { .msg $chan %logo.l $me %logo.r $3- | .msg $2 $3- }
    }
    if ($+(%trigger,server) == $strip($1)) {
      if (!$2) { eis | .msg $chan ?server command: ?server add/del server }
      if ($2 == add) { hadd -m Servers $3- $3- | .msg $chan Added %logo.l $3 %logo.r as %logo.l Autojoin Server %logo.r }
      if ($2 == del) { hdel -m Servers $3- $3- | .msg $chan Deleted %logo.l $3 %logo.r as %logo.l Autojoin Server %logo.r }
    }
    if ($+(%trigger,set) == $strip($1)) {
      if (!$3) { eis | .msg $chan ?set command: ?set nick/password nick/password }
      if ($2 == nick) { set %botnick $3 | nick $3 | identify %botpass | .notice $nick Set %logo.l $3 %logo.r as %logo.l BotNick %logo.r }
      if ($2 == password) { set %botpass $3 | identify $3 | .notice $nick Set %logo.l $3 %logo.r as %logo.l Password %logo.r }
    }
    if ($+(%trigger,trigger) == $strip($1)) { 
      if ($2) { set %trigger $2 | msg $chan Trigger is now %logo.l $2- %logo.r }
  } }
  ;
  ; Channel Owner Commands
  ;
  if ($strip($address($nick,2)) == $gettok($readini($+($network,users.ini),$chan,$nick),1,32)) && ($gettok($readini($+($network,users.ini),$chan,$nick),2,32) == owner ) {
    if ($+(%trigger,addadmin) == $strip($1)) {
      if (!$2) { eis | .msg $chan ?addadmin command: ?addadmin nick }
      if ($2) { notify $2 | writeini $+($network,users.ini) $chan $2 $address($2,2) admin | mode $chan +a $2 | .msg $chan Added %logo.l $2 %logo.r as %logo.l $chan %logo.r Admin. }
    }
    if ($+(%trigger,addhelper) == $strip($1)) {
      if (!$2) { eis | .msg $chan ?addhelper command: ?addhelper nick  }
      if ($2) { notify $2 | writeini $+($network,users.ini) $chan $2 $address($2,2) helper | mode $chan +h $2 | .msg $chan Added %logo.l $2 %logo.r as %logo.l $chan %logo.r Helper. }
    }
    if ($+(%trigger,addop) == $strip($1)) {
      if (!$2) { eis | .msg $chan ?addop command: ?addop nick }
      if ($2) { notify $2 | writeini $+($network,users.ini) $chan $2 $address($2,2) op | mode $chan +o $2 | .msg $chan Added %logo.l $2 %logo.r as %logo.l $chan %logo.r Op. }
    }
    if ($+(%trigger,addvoice) == $strip($1)) { 
      if (!$2) { eis | .msg $chan ?addvoice command: ?addvoice nick }
      if ($2) { notify $2 | writeini $+($network,users.ini) $chan $2 $address($2,2) voice | mode $chan +v $2 | .msg $chan Added %logo.l $2 %logo.r as %logo.l $chan %logo.r Voice. }
    }
    if ($+(%trigger,badnick) == $strip($1)) {
      if (!$4) { eis | .msg $chan ?badnick command: ?badnick add/del nick }
      if ($2 == add) { writeini badnicks.ini $chan $3 $3 | .msg $chan %logo.l Bad Nick $3 %logo.r Added to bad nicks list for %logo.l $chan %logo.r }
      if ($2 == del) { remini badnicks.ini $chan $3 | .msg $chan %logo.l Bad Nick $3 %logo.r Removed from bad nicks list for %logo.l $chan %logo.r }
    }
    if ($+(%trigger,ban) == $strip($1)) {
      if (!$3) { eis | .msg $chan ?ban command: ?ban add/del nick reason }
      if ($2 == add) { ban -ku600 $chan $3 $4- | .msg $chan Banned %logo.l $3 %logo.r time %logo.l 15 Minute Ban %logo.r reason %logo.l $4- %logo.r }
      if ($2 == del) { mode $chan -b $gettok($read(banned.txt, w, * $+ $3- $+ *),6,32) | .msg $chan Unbanned %logo.l $3 %logo.r }
    }
    if ($+(%trigger,baninfo) == $strip($1)) {
      if (!$2) { eis | .msg $chan ?baninfo command: ?baninfo total/banmask | halt } 
      if ($2 == total) { .msg $chan %logo.l Total Bans %logo.r $lines(banned.txt) | halt }
      if (!$read(banned.txt, w, * $+ $2- $+ *)) { .msg $chan No Such Ban Exists. | halt }
      else { .msg $chan $read(banned.txt, w, * $+ $2- $+ *) | halt }
    }
    if ($+(%trigger,bigflood) == $strip($1)) {
      if (!$2) { eis | .msg $chan ?bigflood command: ?bigflood on/off/status $chr(35) | .msg $chan example: ?flood on 200 ( 200 characters per message sent ) }
      if ($2 == on) { 
        set $+(%,$chan,bflood) on 
        set $+(%,$chan,bigflood) $3 
        .msg $chan %logo.l $chan Big Flood Protect %logo.r is now On: $3
      }
      if ($2 == off) { set $+(%,$chan,bflood) off | .msg $chan %logo.l $chan Big Flood Protect %logo.r is now Off }
      if ($strip($2) == status) { .msg $chan %logo.l $chan Big Flood Protect %logo.r is currently: $($+(%,$chan,bflood),2) }
    }
    if ($+(%trigger,flood) == $strip($1)) {
      if (!$2) { eis | .msg $chan ?flood command: ?flood on/off/status #:# | .msg $chan example: ?flood on 10:3 ( 10 messages in 3 seconds ) }
      if ($2 == on) { 
        set $+(%,$chan,floodlines) $gettok($3,1,58)
        set $+(%,$chan,floodin) $gettok($3,2,58)
        set $+(%,$chan,flood) on 
        .msg $chan %logo.l $chan Flood Protect %logo.r is now On: $3
      }
      if ($2 == off) { set $+(%,$chan,flood) off | .msg $chan %logo.l $chan Flood Protect %logo.r is now Off }
      if ($strip($2) == status) { .msg $chan %logo.l $chan Flood Protect %logo.r is currently: $($+(%,$chan,flood),2) }
    }
    if ($+(%trigger,flyby) == $strip($1)) {
      if (!$2) { eis | .msg $chan ?flyby command: ?flyby on/off/status | halt } 
      if ($2 == on) { set $+(%,$chan,flyby) on | .msg $chan %logo.l $chan Fly By %logo.r is now On }
      if ($2 == off) { set $+(%,$chan,flyby) off | .msg $chan %logo.l $chan Fly By %logo.r is now Off }
      if ($strip($2) == status) { .msg $chan %logo.l $chan Fly By %logo.r is currently $($+(%,$chan,flyby),2) }
    }
    if ($+(%trigger,greet) == $strip($1)) {
      if (!$2) { eis | .msg $chan ?greet command: ?greet on/off message }
      if ($2 == on) { set $+(%,greet,$chan) on | set $+(%,joingreet,$chan) $3- | .msg $chan Added %logo.l $3- %logo.r as %logo.l $chan %logo.r auto greet message. }
      if ($2 == off) { unset $+(%,greet,$chan) | .msg $chan Removed %logo.l $($+(%,joingreet,$chan),2) %logo.r as %logo.l $chan %logo.r auto greet message.  }
    }
    if ($+(%trigger,kick) == $strip($1)) {
      if (!$3) { eis | .msg $chan ?kick command: ?kick nick reason }
      if ($3) { kick $chan $2 $3- | .msg $chan Kicked %logo.l $2 %logo.r from %logo.l $3 %logo.r }
    }
    if ($+(%trigger,modelock) == $strip($1)) {
      if (!$2) { eis | .msg $chan ?modelock command: ?modelock list/modes }
      if ($2 == list) { .msg $chan %logo.l Enforcing Modes %logo.r for %logo.l $chan %logo.r $gettok($readini(users.ini,modelock,$chan),2-,32) | halt }
      else { writeini users.ini modelock $chan $chan $2- | mode $chan $2- | .msg $chan Mode %logo.l $2- %logo.r added to %logo.l $chan %logo.r }
    } 
    if ($+(%trigger,protect) == $strip($1)) {
      if (!$2) { eis | .msg $chan ?protect command: ?protect on/off }
      if ($2 == on) { set $+(%,protect,$chan) on | .msg $chan %logo.l $chan Protection %logo.r is now On }
      if ($2 == off) { unset $+(%,protect,$chan) | .msg $chan %logo.l $chan Protection %logo.r is now Off }
    } 
    if ($+(%trigger,remuser) == $strip($1)) {
      if (!$3) { eis | .msg $chan ?remuser command: ?remuser nick chan }
      else { remini $+($network,users.ini) $3 $2 | mode $3 -aohv $2 $2 $2 $2 | .msg $chan %logo.l $2 %logo.r removed from %logo.l $3 %logo.r access. }
    }
    if ($+(%trigger,spam) == $strip($1)) { 
      if (!$2) { eis | .msg $chan ?spam command: ?spam on/off/status }
      if ($regex($strip($1-),/on|off/i)) { set $+(%,sp,$chan) $2 | .msg $chan %logo.l $chan Spam Protect %logo.r is now $($+(%,sp,$chan),2) $+ . }
      if ($strip($2) == status) { .msg $chan %logo.l $chan Spam Protect %logo.r is currently: $($+(%,sp,$chan),2) }
    } 
    if ($+(%trigger,topiclock) == $strip($1)) {
      if (!$2) { eis | .msg $chan ?topiclock command: ?topiclock on/off topic }
      if ($2 == on) {
        if (!$3) { eis | .msg $chan ?topiclock command: ?topiclock on/off topic }
        else { set $+(%,topic,$chan) $3- | set $+(%,topiclock,$chan) on | topic $chan $3- | .msg $chan %logo.l $chan Topiclock %logo.r On }
      }
      if ($2 == off) { unset $+(%,topiclock,$chan) | .msg $chan %logo.l $chan Topiclock %logo.r Off | halt }
  } }
  ;
  ; Bot Talk
  ;
  if ($me == $strip($1)) && ($right($strip($1-),1) == ?) { 
    if (are you a bot isin $strip($1-)) { .msg $chan Of course I am! }
    if (annoying you isin $strip($1-)) { .msg $chan Most definitly $+($nick,!) Make them stop! | halt }
    set -u5 %randadv $rand(1,8)
    if (%randadv == 1) { .msg $chan What, You cant make decisions for yourself? }  
    if (%randadv == 2) { .msg $chan I wouldn't tell you if i knew. }  
    if (%randadv == 3) { .msg $chan Ask someone who cares. }  
    if (%randadv == 4) { .msg $chan I cant believe you just asked that!!! }  
    if (%randadv == 5) { .msg $chan Come back when Im not so drunk. }  
    if (%randadv == 6) { .msg $chan What sort of question is that? } 
    if (%randadv == 7) { .msg $chan Are you serious? }
    if (%randadv == 8) { .msg $chan You shouldn't be asking questions like that!! }
  } 
  ;
  ; Trigger flood 
  ;
  if ($left($1,1) == $($+(%,trigger),2)) { inc -u10 $+(%,trigger,$nick) } 
  ;
  ; Spam Catcher
  ;
  if ($regex($strip($1-),/\b(?:http|www|com|org|net)\b/i)) && ($($+(%,sp,$chan),2) == on) { 
    if ($+(%,spam,$nick) == $null) { set $+(%,spam,$nick) 1 }
    else { inc $+(%,spam,$nick) 1 }
    if ($($+(%,spam,$nick),2) == 3) { unset $+(%,spam,$nick) | ban -ku300 $chan $nick 2 Spam/Advertising. | .notice $nick You have been banned from %logo.l $chan %logo.r for Spam/Advertising. }
    .msg $chan %logo.l $nick %logo.r Spamming is not allowed in this channel.
  } 
}
/* 
Aliases 
*/
alias addowner { notify $1 | writeini $+($network,users.ini) botmaster $1 $1 $address($1,2) | .msg $chan %logo.l $gettok($readini($+($network,users.ini),botmaster,$1),1,32) %logo.r  added to %logo.l Master List %logo.r }
alias eis { .msg $chan **** %logo.lIncorrect Syntax %logo.r ***** }
alias io { .msg $chan **** %logo.lIllegal Operation %logo.r ***** }
alias ircopscan { 
  if ($nick($1,0) > 1000) { .msg %chkchan %logo.l IRCop Scan %logo.r halted - too many users on channel. } 
  else { .who $1 | set $+(%,ircopcheck,$1) 1 }  
} 
alias chkflyby {
  var %a = 1
  var %b = $comchan($nick,0) 
  while %a <= %b { 
    if ($($+(%,join,$comchan($nick,%a),$nick),2) == $nick) { $iif($+(%,flyby,$comchan($nick,%a)),inc $+(%,flyby,$comchan($nick,%a)),set $+(%,flyby,$comchan($nick,%a)) 1) | ban -u300 $comchan($nick,%a) $nick 2 Fly-By Protect | .msg $comchan($nick,%a) %logo.l $($+(%,join,$comchan($nick,%a),$nick),2) %logo.r was Fly-By %logo.l $($+(%,flyby,$comchan($nick,%a)),2) %logo.r Since $($+(%,botstartdate),2) | halt }
    else { inc %a } 
} }
alias relayevent {
  var %a = $scon(0)
  while (%a) {
    if ($scon(%a).network == $1) { dec %a }
    else { scon %a msg %rchan $2- | dec %a }
} } 
alias global {
  scon -a //ame %logo.l Global Service Message %logo.r from %logo.l $m1 %logo.r on %logo.l $network %logo.r
  scon -a //ame %logo.l $1 %logo.r $2-
}
/* 
Raw Events 
*/
raw 315:*: { 
  if ($($+(%,ircopcheck,%chkchan1),2) != $null) { 
    if ($($+(%,ircops,%chkchan1),2) != $null) { .msg %msgchan %logo.l IRCops %logo.r on %chkchan1 $+ : $($+(%,ircops,%chkchan1),2) $+ . } 
    else { .msg %msgchan %logo.l IRCop Scan %logo.r No IRCops on %chkchan1 $+ . }
    unset %ircop* | .haltdef 
} }
raw 352:*: { 
  if ($($+(%,ircopcheck,%chkchan1),2) != $null) { 
    if (* isin $7) { set $+(%,ircops,%chkchan1) $($+(%,ircops,%chkchan1),2) $6 } 
    .haltdef 
} } 
/*
Menu
*/
menu channel,nicklist {
  Server relay
  .Set Relay Channel:set %rchan $$?"Channel name: example: #Help"
  .Relay Currently %serverrelay:set %serverrelay $iif((%serverrelay == on),off,on) | echo -a ***** Sever Relay is now %serverrelay 
  Add/Delete channel access
  .Add $$1 as owner:writeini $+($network,users.ini) $chan $address($$1,2) OWNER | mode $chan +q $$1 | .msg $chan Added %logo.l $$1 %logo.r as %logo.l $chan %logo.r Owner.
  .Add $$1 as admin:writeini $+($network,users.ini) $chan $address($$1,2) ADMIN | mode $chan +a $$1 | .msg $chan Added %logo.l $$1 %logo.r as %logo.l $chan %logo.r Admin.
  .Add $$1 as op:writeini $+($network,users.ini) $chan $address($$1,2) OP | mode $chan +o $$1 | .msg $chan Added %logo.l $$1 %logo.r as %logo.l $chan %logo.r Op.
  .Add $$1 as helper:writeini $+($network,users.ini) $chan $address($$1,2) HELPER | mode $chan +h $$1 | .msg $chan Added %logo.l $$1 %logo.r as %logo.l $chan %logo.r Helper.
  .Add $$1 as voice:writeini $+($network,users.ini) $chan $address($$1,2) VOICE | mode $chan +v $$1 | .msg $chan Added %logo.l $$1 %logo.r as %logo.l $chan %logo.r Voice.
  .Delete $$1:remini $+($network,users.ini) $chan $$1
  Global Message:global $$?"Message From" $$?"Message"
  Logo
  .Logo Left: set %logo.l $$?""
  .Logo Right: set %logo.r $$?""
}
Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Loading...


×
×
  • Create New...