Bot Access List

By Kurama_ on Jan 04, 2010

A very simple bot access script. To set yourself as bot master or anyone else as bot master (which isn't recommended) just right click on your or his/her name and select "Set As Bot Master" and there you go. It even has it's on akick function. The script is easy to edit to suit your own needs. In fact this is going to be used for a IRC game I'm creating. I realize I could have used variables in this instead of all the "$readini"'s but I was already half way through the script and was to lazy to go back. It's suppose to be simple and easy to understand anyway so.. <.< Just press Alt + R and copy/paste this into your remotes, save and it's ready to go. Enjoy. 8D

menu nicklist {
  .Set As Bot Master: writeini access.ini Access $address($1,2) Master
}
on *:TEXT:-Access add *:*: {
  if ($readini(access.ini,Access,$nick) == $null) .notice $nick 4Error: You do not have access to this command
  elseif ($4 >= $readini(access.ini,Access,$nick)) && ($readini(access.ini,Access,$nick) != Master) .notice $nick 4Error: The access level can not be equal to or higher than your own unless you are Bot Master
  elseif ($4 > 10) && ($readini(access.ini,Access,$address($nick,2)) == Master) .notice $nick 4Error: Access level can not be higher than 10
  else {
    writeini access.ini Access $address($3,2) $4
    msg $chan $3 ( $+ $address($nick,2) $+ ) has been added to the access list.
  }
}
on 1:TEXT:-Access del *:*: { 
  if ($readini(access.ini,Access,$address($nick,2)) == $null) .notice $nick 4Error: You do not have access to this command
  elseif ($readini(access.ini,Access,$address($nick,2)) <= $readini(access.ini,Access,$address($3,2))) && ($readini(access.ini,Access,$address($nick,2)) != Master) .notice $nick 4Error: The access level you are trying to delete can not be equal to or higher than your own unless you are Bot Master
  elseif ($readini(access.ini,Access,$3) == $null) .notice $nick 4Error: That names isn't on the access list.
  else {
    remini access.ini Access $3 
    msg $chan $3 ( $+ $address($3,2) $+ ) has been deleted from the access list.
  }
}
on *:TEXT:-Access List:*: .play -n $nick access.ini
on @*:Join:#: {
  if ($readini(access.ini,Access,$address($nick,2)) <= 2) mode $chan +v $nick
  elseif ($readini(access.ini,Access,$address($nick,2)) <= 4) mode $chan +h $nick 
  elseif ($readini(access.ini,Access,$address($nick,2)) <= 6) mode $chan +o $nick 
  elseif ($readini(access.ini,Access,$address($nick,2)) <= 8) mode $chan +a $nick 
  elseif ($readini(access.ini,Access,$address($nick,2)) <= 10) mode $chan +q $nick
  elseif ($readini(access.ini,Access,$address($nick,2)) == akick) {
    mode $chan +b $address($nick,2) | kick $chan $nick You are not allowed to be on this channel.
  }
}

Comments

Sign in to comment.
John Daniels   -  Jan 23, 2013

would be helpful if you show how to use it, part from telling us how to set bot master

rebel9  -  Dec 20, 2013

Commands

-Access add user 2 = +v
-Access add user 4 = +h
-Access add user 6 = +o
-Access add user 8 = +a
-Access add user 10 +q

Same thing for delete without the 4th string. also -Access list

Sign in to comment

WorldDMT   -  Jan 06, 2010

hi

about the on join event you can do it better

$address($nick,2) it's like $wildsite

on @*:Join:#:{
  tokenize 32 $readini(access.ini,Access,$wildsite)
  if $istok(1.2.3.4.5.6.7.8.9.10,$1,46) {
    mode # $+(+,$replace($1,1,v,2,v,3,h,4,h,5,o,6,o,7,a,8,a,9,q,10,q)) $nick
  }
  elseif ($1 == akick) ban -k # $nick 2 You are not allowed to be on this channel.
}

that is an exp to give u more ideas to do better the second time good job Kurama_ :)

 Respond  
Kurama_   -  Jan 05, 2010

Thanks Jethro_, Although when I tested this I had no problem with the bot kicking everyone who joins, but since this issue was a previous problem before I submitted the script, It would be a good idea to take the precautions. So thanks. =D

 Respond  
Jethro   -  Jan 04, 2010

For the last part of your join event, you should not omit the brackets, especially for the akick line. Your existing one will kick/ban every one who joins, regardless of being added or not. But with brackets, it won't.> elseif ($readini(access.ini,Access,$address($nick,2)) == akick) {
mode $chan +b $address($nick,2) | kick $chan $nick You are not allowed to be on this channel.
}
}P.S. Even kicking the client running the code without brackets, and you should add a @ prefix to your join event.

on @*:Join:#: {
 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.