Chatspace Room Bot Control

By blackvenomm666 on Jun 15, 2011

Ok this is an overhaul on my original code which im having deleted so i can just keep this one up. I took time redid how its set up for control.
There are now 3 levels of command. Owner which can control everything. Chan Owner which can control everything in their channel. And Chan User which can only control what a normal mod can within the channel.

Load into a new remotes file on your bot then go to your menubar/nicklist go to user access and add your nick as owner. From there you can bring your bot into several channels or leave in just one.

On the Channel/Channels you add each nick you want in the control system accordingly. Only add people you trust. Commands to add people are .addowner makes a nick capable of controlling the bot no matter what .delowner deletes em from the bots ownerlist. .addchanuser <<use it on the channel you want the person to have bot access it will add them as a channel user just like having aop. .delchanuser <<<again use on the channel you want the person removed from. .Addchanowner <<use it on the channel you want the person to have access on it gives the person the power of Sop on the channel. and .delchanowner will delete someone from the channel owner list. the rest are just standard commands .o .-o .v .-v that kinda stuff.

Ok now it is also server specific so if you have it running on multiple servers someone from one server can't come and control it on another:D

New update is well i realised a security flaw with the bot script. I completely didnt think about checks and balances between the 3 levels. So before the lowest level person could have kicked/banned the highest. Well now i have made 2 aliases to take care of that problem:)

menu menubar,nicklist, {
  .User Access
  ..Add Owner: { writeini botcontrol.ini $server $+ owner $$?="Owner What Nick?" yes }
  ..Del owner: { remini botcontrol.ini $server $+ owner $$?"Deowner What Nick?" }
  ..Add Channel User: { writeini botcontrol.ini $chan $+ $server $$?="Make What Nick Channel User?" yes }
  ..Del Channel User: { remini botcontrol.ini $chan $+ $server $$?"Delete What Nick From Channel User List?" }
  ..Add Channel Owner: { writeini botcontrol.ini $chan $+ $server $+ owner $$?="Make What Nick Channel User?" yes }
  ..Del Channel Owner: { remini botcontrol.ini $chan $+ $server $+ owner $$?"Delete What Nick From Channel User List?" }
}
on *:text:*:#:{
  tokenize 32 $strip($1-) 
  if ($readini(botcontrol.ini, $server $+ owner,$nick)) {
    if ($1 == .addowner) { writeini botcontrol.ini $server $+ owner $2 yes }  
    elseif ($1 == .delowner) { remini botcontrol.ini $server $+ owner $2  } 
    elseif ($1 == .clear) { Scid -a clearall }
    elseif ($1 == .join) { .join #$2  }
    elseif ($1 == .nick) { tnick $2 }
    elseif ($1 == .p2p) { query $2 $$3- }
    elseif ($1 == .ntc) { notice $2 $$3- }
    elseif ($1 == .suicide) { quit $$2- }
    }
  if ($readini(botcontrol.ini,$chan $+ $server $+ owner,$nick) || $readini(botcontrol.ini,$server $+ owner,$nick)) { 
    if ($1 == .aop) { .set %check1 $nick | checkaccess | .set %check2 $2 | checkaccess2 
    if (%access >= %access2) { .services aop $chan add $2 | .mode $chan +o $2 } }
    elseif ($1 == .raop) { .set %check1 $nick | checkaccess | .set %check2 $2 | checkaccess2 
    if (%access >= %access2) { .services aop $chan del $2 | .mode $chan -o $2 } } 
    elseif ($1 == .sop) { .set %check1 $nick | checkaccess | .set %check2 $2 | checkaccess2 
    if (%access >= %access2) { .services sop $chan add $2 | .mode $chan +o $2 } }
    elseif ($1 == .rsop) { .set %check1 $nick | checkaccess | .set %check2 $2 | checkaccess2 
    if (%access >= %access2) { .services sop $chan del $2 | .mode $chan -o $2 } }
    elseif ($1 == .vop) { .set %check1 $nick | checkaccess | .set %check2 $2 | checkaccess2 
    if (%access >= %access2) { .services vop $chan add $2 | .mode $chan +o $2 } }
    elseif ($1 == .rvop) { .set %check1 $nick | checkaccess | .set %check2 $2 | checkaccess2 
    if (%access >= %access2) { .services vop $chan del $2 | .mode $chan -o $2 } }
    elseif ($1 == .mem) { .set %check1 $nick | checkaccess | .set %check2 $2 | checkaccess2 
    if (%access >= %access2) { .services mem $chan add $2 | .mode $chan +o $2 } }
    elseif ($1 == .rmem) { .set %check1 $nick | checkaccess | .set %check2 $2 | checkaccess2 
    if (%access >= %access2) { .services mem $chan del $2 | .mode $chan -o $2 } }
    elseif ($1 == .addchanowner) { writeini botcontrol.ini $chan $+ $server $+ owner $2 yes }  
    elseif ($1 == .delchanowner) { remini botcontrol.ini $chan $+ $server $+ owner $2  } 
    elseif ($1 == .addchanuser) { writeini botcontrol.ini $chan $+ $server $2 yes }  
    elseif ($1 == .delchanuser) { remini botcontrol.ini $chan $+ $server $2  }  
    elseif ($1 == $me) && ($2 == pmod) { .set %check1 $nick | checkaccess | .set %check2 $2 | checkaccess2 
      if (%access >= %access2) { 
        .services aop $chan add $3 | .mode $chan +o $3
      }
    }
    elseif ($1 == .res) { .services reset #$2 }
    elseif ($1 == $me) && ($2 == powner) { .set %check1 $nick | checkaccess | .set %check2 $2 | checkaccess2 
      if (%access >= %access2) { 
        .services sop $chan add $3 | .mode $chan +o $3
      }
    }
    elseif ($1 == $me) && ($2 == rmod) { .set %check1 $nick | checkaccess | .set %check2 $2 | checkaccess2 
      if (%access >= %access2) {  
        .services aop $chan del $3 | .mode $chan -o $3
      }
    }
    elseif ($1 == $me) && ($2 == rowner) { .set %check1 $nick | checkaccess | .set %check2 $2 | checkaccess2 
      if (%access >= %access2) { 
        .services sop $chan del $3 | .mode $chan -o $3
      }
    }
    elseif ($1 == .ownercommands) {
      msg $nick Room Control Commands are .o mod yourself .o nickhere mod specified nick .-o demod yourself .-o nickhere demod specified nick .v voice yourself .-v devoice yourself
      .timer 1 3 msg $nick .v nickhere voice specified nick .-v nickhere devoice specified nick. .kick nickhere kicks the specified nick .ban nickhere bans specified nick 
      .timer 1 5 msg $nick channel owner/owneronly .sop nickhere give room owner to nick .rsop nickhere take owner from nick  .aop nickhere give perm mod .raop remove perm mod 
      .timer 1 7 msg $nick channel owner/owneronly .vop nickhere gives perm voice .rvop nickhere takes perm voice .mem nickhere gives perm member .rem nickhere removes perm member
      .timer 1 9 msg $nick .tb minuteshere nickhere timeban .q nickhere gives quiet status to nick .-q nickhere takes quiet status .cbans clears all the channels bans
      .timer 1 11 msg $nick .+s sets room to secret .-s unsets secret .i sets room to invite only .-i unsets invite only .j sets room so only people with vop/aop/sop may join .-j unsets .j
      .timer 1 13 msg $nick .ml sets the channel to moderated need at least voice to talk .-m unsets moderated .bans checks the channel bans and lists them in the channel
      .timer 1 15 msg $nick channelowner or owner only bot access .addowner nickhere adds a nick as owner .delowner nick deletes the nick from owner .addchanuser nickhere adds a nick as a channel user .delchanuser delets a person from the channel user list
      .timer 1 17 msg $nick .addchanowner nickhere will add a user to the channel owner access of the bot .delchanowner nickhere deletes channel owner from bot access
    }
  }
  if ($readini(botcontrol.ini,$chan $+ $server,$nick) || ($readini(botcontrol.ini,$chan $+ $server $+ owner,$nick) || $readini(botcontrol.ini,$server $+ owner,$nick))) { 
    if ($1 == .o ) { if (!$2) {
        .mode $chan +o $nick
      }
      else { .mode $chan +o $2
      }
    }
    if ($1 == $me) && ($2 == mod) {
      if ($3 == me) {
        .mode $chan +o $nick
      }
      else { .mode $chan +o $3 
      }
    }
    if ($1 == .-o) { if (!$2) {
        .mode $chan -o $nick
      }
        else { .mode $chan -o $2 
      }
    }
    if ($1 == $me) && ($2 == demod) {  
      if ($3 == me) {
        .mode $chan -o $nick
      }
       else { .mode $chan -o $3 
      }
    }
    if ($1 == .v) { if (!$2) {
        .mode $chan +v $nick
      }
       else { .mode $chan +v $2 
      }
    }
    if ($1 == $me) && ($2 == voice) {  
      if ($3 == me) {
        .mode $chan +v $nick
      }
         else { .mode $chan +v $3 
      }
    }
    if ($1 == .-v) { if (!$2) {
        .mode $chan -v $nick
      }
      else { .mode $chan -v $2 
      }
    }
    if ($1 == $me) && ($2 == devoice) {  
      if ($3 == me) {
        .mode $chan -v $nick
      }
      else { .mode $chan -v $3
      }
    }
    if ($1 == .in) { if (!$3) {
        invite $2 $chan
      }
      else { invite $2 #$3 
      }
    }
    if ($1 == .part) { if (!$2) {
        part #
      }
      else { .part #$2 
      }
    }
    elseif ($1 == .bans) { .set %checkbanchan $chan | .set %checkban on | .mode $chan +b }
    elseif ($1 == .q) && ($2 != $me) { .set %check1 $nick | checkaccess | .set %check2 $2 | checkaccess2 
    if (%access >= %access2) { .mode $chan -o $2 | .mode $chan -v $2 | .mode $chan +q $2 3 } }
    elseif ($1 == .-q) { .set %check1 $nick | checkaccess | .set %check2 $2 | checkaccess2 
    if (%access >= %access2) { .mode $chan -q $address($2,4) } }
    elseif ($1 == .ntce) { .notice $2 $3- }
    elseif ($1 == .kick) && ($2 != $me) { .set %check1 $nick | checkaccess | .set %check2 $2 | checkaccess2 
    if (%access >= %access2) { .mode $chan -o $2 | kick $chan $2 } }
    elseif ($1 == .ban) && ($2 != $me) { .set %check1 $nick | checkaccess | .set %check2 $2 | checkaccess2 
    if (%access >= %access2) { .mode $chan -o $2 | ban # $address($2,4) | .kick $chan $2 } }
    elseif ($1 == .tb) && ($3 != $me) { .set %check1 $nick | checkaccess | .set %check2 $3 | checkaccess2 
    if (%access >= %access2) {  .mode $chan -o $3 | .ban -ku $+ $calc($2 * 60) $chan $address($3,4) | kick $chan $3  } }
    elseif ($1 == .+s) { .mode # +s | msg $nick $chan now set as secret }
    elseif ($1 == .-s) { .mode # -s | msg $nick $chan now unset as secret }
    elseif ($1 == .+i) { .mode # +i | msg $nick $chan now set as invite only }
    elseif ($1 == .-i) { .mode # -i | msg $nick $chan now unset as invite only }
    elseif ($1 == .+j) { .mode # +j | msg $nick $chan now set as member only. only people with vop/aop/sop may join }
    elseif ($1 == .-j) { .mode # -j | msg $nick $chan now unset as member only }
    elseif ($1 == .+m) { .mode # +ml | msg $nick $chan now set as moderated. Need at least voice to talk }
    elseif ($1 == .-m) { .mode # -m | msg $nick $chan now unset as moderated }
    elseif ($1 == .hop) { hop # }
    elseif ($1 == .unban) { .mode $chan -b $2 }
    elseif ($1 == .cbans) { .set %cbanchan $chan | .set %cban on | .mode $chan +b }
    elseif ($1 == .say) { msg # $2- }
    elseif ($1 == .msg) { msg $2 $3- }
    elseif ($1 == .commands) {
      describe # commands are !bar !fight evil !fight nick .buy nick .freeslave nick !transfer nick mneyammount !mymoney .myslaves !rpgstats !myfights
      .timer 1 1 describe # joke commands are !blonde !momma !pc !pizza !pickup !quotes !stupid !condoms !elevator !emo !internet !love !norris !walmart !clowns
    }
    elseif ($1 == .allcommands) {
      msg $nick Room Control Commands are .o mod yourself .o nickhere mod specified nick .-o demod yourself .-o nickhere demod specified nick .v voice yourself .-v devoice yourself
      .timer 1 3 msg $nick .v nickhere voice specified nick .-v nickhere devoice specified nick. .kick nickhere kicks the specified nick .ban nickhere bans specified nick 
      .timer 1 7 msg $nick .tb minuteshere nickhere timeban .q nickhere gives quiet status to nick .-q nickhere takes quiet status .cbans clears all the channels bans
      .timer 1 9 msg $nick .+s sets room to secret .-s unsets secret .i sets room to invite only .-i unsets invite only .j sets room so only people with vop/aop/sop may join .-j unsets .j
      .timer 1 11 msg $nick .ml sets the channel to moderated need at least voice to talk .-m unsets moderated .bans checks the channel bans and lists them in the channel
    }
    if (slap isin $$1-) && ($me isin $$1-) && ($chan != #lobby)  { msg $chan 12,1im sorry master it won't happen again } 
    else if ($$1 == $me) && (!$2-) && ($chan != #lobby)  { msg $chan 12,1how may i be of service $nick }
  }
}
on *:Invite:*: {
  if ($readini(botcontrol.ini,$chan $+ $server $+ owner,$nick) || $readini(botcontrol.ini,$server $+ owner,$nick)) { 
    .join $chan
  }
}
alias checkaccess {
  if ($readini(botcontrol.ini,$chan $+ $server $+ owner, %check1)) { .set %access 5
  }
  elseif ($readini(botcontrol.ini,$server $+ owner, %check1)) { .set %access 10
  }
  elseif ($readini(botcontrol.ini,$chan $+ $server, %check1)) { .set %access 1
  }
}
alias checkaccess2 {
  if ($readini(botcontrol.ini,$chan $+ $server $+ owner, %check2)) { .set %access2 5
  }
  elseif ($readini(botcontrol.ini,$server $+ owner, %check2)) { .set %access2 10
  }
  elseif ($readini(botcontrol.ini,$chan $+ $server, %check2)) { .set %access2 1
  }
  elseif (!$readini(botcontrol.ini,$chan $+ $server $+ owner, %check2)) { .set %access2 0
  }
  elseif (!$readini(botcontrol.ini,$server $+ owner, %check2)) { .set %access2 0
  }
  elseif (!$readini(botcontrol.ini,$chan $+ $server, %check2)) { .set %access2 0
  }
}

raw 367 :*: {
  if (%checkban == on) {
    .msg %checkbanchan $3 set by $4
  }
  elseif (%cban == on) {
    .mode %cbanchan -b $3
  }
}
raw 368 :*: {
  if (%checkban == on) {
    .set %checkban off
  }
  elseif (%cban == on) {
    .set %cban off
  }
}

;on *:BAN:#: { 
; .set %banmask
;mode $chan -b $banmask
;.mode $chan +b $5
;}

Comments

Sign in to comment.
blackvenomm666   -  Jan 08, 2012

O_O

 Respond  
TMFKSOFT   -  Jan 08, 2012

UPDATED?!

 Respond  
blackvenomm666   -  Jul 06, 2011

updated.

 Respond  
blackvenomm666   -  Jun 17, 2011

UPDATED

 Respond  
Jethro   -  Jun 16, 2011

I see. You're not alone.

 Respond  
blackvenomm666   -  Jun 16, 2011

umm well making a comment makes people see it again:P so i commented that and i had a couple people looking at it but talking to me in chats

 Respond  
Jethro   -  Jun 16, 2011

To whom are you talking?

 Respond  
blackvenomm666   -  Jun 15, 2011

updated already haha

 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.