Typos Master Access List

By Typo on Jun 24, 2008

Typo's Master Access List lets you add or remove individual names or entire channel access lists to/from your Master Access List. You can merge the Master access list with a channels existing access list or delete the channels entire access list and then replace it with your Master Access List so they match eachother exactly.

The script has a dialog where you manage the master list and then when you want to apply it to a channel or copy a channels list into the master list or delete a channels list or the master list you do that thru the menu you get to when right clicking in a channel and selecting Typos Master Access List, then , Options for #.

I have also added support to backup the Master Access Lists so that you can have seperate backup lists for all your needs. You can save the backup list using any name you want and when you load a backed up list it is merged into the Master Access List so that you can even combine multiple backup lists if you wish.

The script automatically translates all added access list entries, when necessary, into one format while adding them. It also, when necessary, automatically translates the lists entires while applying them.

This may sound confusuing but it all works out in the end. If you add a SOP to the list, its translated to 10 while being added and then you go to add that level 10 (formerly a SOP) to a channel that uses hop,aop,sop and not access levels it will be translated back to SOP and added properly. For more info read below, otherwise your done reading and thank you for your interest.

Yet another script that I made by request and am deciding to share.

Enjoy

Image

Image

;Begin Typos Master Access List
on *:load:{ hmake accesslist 20 }
on *:start:{ hmake accesslist 20 | hload accesslist accesslist.txt }
menu channel,query,status,nicklist {
  -
  <[Typo's Master Access List]>
  .Manage the Master Access List.:dialog -ma UserAccessList UserAccessList
  .Backup the Master Access List.:var %filename = $file="Select the location and file name including the extention (like list.txt)" | if ($input(Are you sure you wish to save the current master access list as %filename ? This will overwrite the file if it already exists,y,Please confirm your choice.) == $true) { hsave accesslist %filename | echo 4 -a $timestamp < $+ Attention $+ > Your master access list has been backed up to %filename }
  .Load a backup Master Access List.:if ($input(Are you really ready to load a backup? (did you need to delete the current list?) The backup you load will be merged with the current list.,y,Please confirm your choice.) == $true) { var %filename = $file="Please select the backup access list you wish to load" | if ($input(Are you sure you wish to merge %filename with the master access list?,y,Please confirm your choice) == $true) { hload accesslist %filename | echo 4 -a < $+ Attention $+ > %filename successfully loaded/merged! | refreshlist } }
  .$iif($menu == query,$style(2)) $iif($menu == status,$style(2)) $iif($menu == nicklist,$style(2)) Access List options for this channel.
  ..Apply the Master Access List to the # ChanServ Access List.:if ($input(Are you sure you want to merge your master access list with the # access list?,y,Please confirm your choice.) == $true) { if ($input(Are you POSITIVE that you want to add the master access list to #?,y,Please confirm your choice.) == $true) { ApplyAccess # } }
  ..Copy the # ChanServ Access List to The Master Access List.:copylist #
  ..-
  ..Delete the # ChanServ Access List:if ($input(Are you sure you want to DELETE the # access list?,y,Please confirm your choice.) == $true) { if ($input(Are you absolutelty POSITIVE that you want to DELETE the # access list to #?,y,Please confirm your choice.) == $true) { deleteaccess # } }
  ..-
  .-
  .Delete the Master Access List.:if ($input(Are you POSITIVE that you wish to delete the master access list?,y,Are you sure?) == $true) { if ($input(Really?,y,Are you sure your sure?) == $true) { hfree accesslist | remove -b accesslist.txt | hmake accesslist 20 | if ($dialog(useraccesslist) != $null) { refreshlist } } }
  .-
}
alias AddAccess {
  if ($1 == $null) { echo 4 -a < $+ Warning $+ > That is not a valid name. | return }
  if ($hfind(accesslist,$1,1) == $1) && ($hget(accesslist,$1) == $2) { echo 4 -a < $+ Warning $+ > That name has already been added to the Master Access List! | return } 
  hadd -m accesslist $1 $2
  echo 4 -a < $+ Attention $+ > $1 has been added to the Master Access List.
}
alias RemoveAccess {
  if ($1 == $null) { echo 4 -a < $+ Warning $+ > No name specified. | return }
  if ($hfind(accesslist,$1,1) == $null) { echo 4 -a < $+ Warning $+ > That name is not in the Master Access List. | return }
  hdel accesslist $1
  echo 4 -a < $+ Attention $+ > $1 has been removed from your Master Access List!
}
alias applyaccess { .enable #chanservxop | cs access $1 list | set %xopchan $1 }
alias applyaccess2 {
  var %alxop = $hget(accesslist,0).item
  while (%alxop !<= 0) {
    var %accuserxop = $hget(accesslist,%alxop).item
    if ($hget(accesslist,%accuserxop) isnum) && (%xop == off) { cs access $1 add %accuserxop $hget(accesslist,%accuserxop) } 
    if ($hget(accesslist,%accuserxop) isnum) && (%xop == on) { 
      var %lvlnum = $hget(accesslist,%accuserxop)
      if (%lvlnum <= 3) { echo 4 -a < $+ Warning $+ > %accuserxop has an access level that is 3 or less and will not be added to the $1 access list }
      if (%lvlnum == 4) { var %xopop = hop }
      if (%lvlnum >= 5) && (%lvlnum <= 7) { var %xopop = aop }
      if (%lvlnum >= 7) && (%lvlnum <= 10) { var %xopop = sop }
      if (%lvlnum >= 10) { echo 4 -a < $+ Warning $+ > %accuserxop has an access level greater than 10 but will still only be added as an SOP | var %xopop = sop }
      cs %xopop $1 add %accuserxop  
    }
    if ($hget(accesslist,%accuserxop) !isnum) && (%xop == on) {
      cs $hget(accesslist,%accuserxop) $1 add %accuserxop
    }
    elseif ($hget(accesslist,%accuserxop) !isnum) && (%xop == off) {
      if ($hget(accesslist,%accuserxop == HOP) { var %lvl = 4 }
      if ($hget(accesslist,%accuserxop == AOP) { var %lvl = 5 }
      if ($hget(accesslist,%accuserxop == SOP) { var %lvl = 10 }
      cs access $1 add %accuserxop %lvl
    }
    dec %alxop
  }
  unset %xop %xopchan
  echo 4 -a < $+ Attention $+ > Finished!  The Master Access List has been added to $1 $+ .
}
alias refreshlist {
  if ($dialog(useraccesslist) != $null) {
    var %al = $hget(accesslist,0).item
    if (%al == 0) { did -r useraccesslist 2 }
    while (%al !<= 0) {
      var %accuser = $hget(accesslist,%al).item
      did -a useraccesslist 2 %accuser $hget(accesslist,%accuser) 
      dec %al
    }
  }
}
on *:dialog:useraccesslist:init:0:{ refreshlist }
dialog useraccesslist {
  title " Master access list."
  size -1 -1 86 303
  option dbu
  button "Done", 1, 28 285 25 14, default ok cancel
  list 2, 3 162 80 64, sort size vsbar
  edit "", 3, 7 139 50 10, autohs
  button "Add", 4, 30 151 25 10
  button "Remove selected user.", 5, 10 229 67 10
  edit "", 6, 59 139 19 10, autohs
  text "Users name.", 7, 18 130 33 8
  text " Level", 8, 61 131 17 8
  text "Enter the users name and the desired access level and click add. The dafault access levels are 4=hop, 5=aop, 10=sop, 999=owner. If you enter HOP, AOP or SOP, the script will translate them to access levels.", 9, 2 80 81 50, center
  text "To remove a user from the Master Access List, highlight the nickname and click the 'Remove selected user' button. This does not remove the user from the channels access list.", 10, 4 242 78 41, center
  text "Ideas: You could copy your channels access list into the master access list, then add, remove or update users, then, when your ready, clear the channels access list, apply the now edited master list to the channel and your done. It's also great for copying access lists between channels or backing up your channels access list.", 12, 2 1 81 75, center
}
on *:dialog:useraccesslist:sclick:4:{
  var %tmpacc = $did(6)
  if (%tmpacc !isnum) {
    if (%tmpacc == HOP) { var %acclvl = 4 } 
    if (%tmpacc == AOP) { var %acclvl = 5 }
    if (%tmpacc == SOP) { var %acclvl = 10 }
    if (%tmpacc != HOP) && (%tmpacc != AOP) && (%tmpacc != SOP) { echo 4 -a $timestamp < $+ Warning $+ > That was not a valid entry. | goto end2 }
  }
  elseif (%tmpacc isnum) { var %acclvl = $did(6) }
  else { echo 4 -a $timestamp < $+ Warning $+ > That was not a valid entry. | goto end2 }
  AddAccess $did(3) %acclvl
  did -r useraccesslist 2
  var %al3 = $hget(accesslist,0).item
  refreshlist
  :end
  hsave accesslist accesslist.txt
  :end2
  did -r useraccesslist 3
  did -r useraccesslist 6
}
on *:dialog:useraccesslist:sclick:5:{
  RemoveAccess $gettok($did(2).seltext,1,32)
  did -r useraccesslist 2
  var %al4 = $hget(accesslist,0).item
  refreshlist
  hsave accesslist accesslist.txt
}
alias deleteaccess { set %malchan # | hmake deleteaccesslist 5 | .enable #chanservdel | cs access $1 list }
alias copylist { .enable #chanserv | cs access $1 list }
#chanserv off
on *:notice:*:*:{ 
  if ($nick == Chanserv) {
    if ($1- == End of access list.) { copylistdone }
    if ($1 == No) { echo 4 -a < $+ Warning $+ > No list to copy! }
    if ($1 isnum) && ($2  isnum) { hadd -m accesslist $3 $2 }
    if ($1 isnum) && ($2 !isnum) { 
      if ($2 == hop) { hadd -m accesslist $3 4 }
      if ($2 == aop) { hadd -m accesslist $3 5 }
      if ($2 == sop) { hadd -m accesslist $3 10 } 
    }
  }
}
#chanserv end
alias copylistdone { hsave accesslist accesslist.txt | .disable #chanserv | refreshlist }
#chanservxop off
on *:notice:*:*:{ 
  if ($nick == Chanserv) {
    if ($1 == 2) || ($1- == End of access list.) { xopcopylistdone }
    if ($1 == No) { timer 1 0 xopdone }
    if ($1 isnum) { 
      if ($2 isnum) { set %xop off }
      elseif ($2 !isnum) { set %xop on }
    }
  }
}
#chanservxop end
alias xopdone { if ($input(I was unable to detect whether the xop system was on or off.  Please select YES if the xop system is on (This is the default setting which uses AOP SOP HOP).  Please select NO if the xop system is off (This means you use access levels like the number 5 instead of aop).,y,Please select the appropriate button.) == $false) { set %xop off } | else { set %xop on } | xopcopylistdone } 
alias xopcopylistdone { .disable #chanservxop | applyaccess2 %xopchan }
#chanservdel off
on *:notice:*:*:{ 
  if ($nick == Chanserv) {
    if ($1- == End of access list.) { deletecopylistdone }
    if ($1 isnum) { hadd -m deleteaccesslist $3 $2 }
  }
}
#chanservdel end
alias deletecopylistdone { .disable #chanservdel | delaccess %malchan | unset %malchan }
alias delaccess {
  var %al1del = $hget(deleteaccesslist,0).item
  while(%alldel !<= 0) {
    var %accuser1del = $hget(deleteaccesslist,%al1del).item
    if (%al1del == 0) { goto enddel }  
    if ($hget(deleteaccesslist,%accuser1del) isnum) {
      cs access $1 del %accuser1del
    } 
    else { cs $hget(deleteaccesslist,%accuser1del) $1 del %accuser1del }
    dec %al1del
  }
  hfree deleteaccesslist
}
on *:exit:{ hsave accesslist accesslist.txt }
;End Typos Master access list

Comments

Sign in to comment.
irchainscriptz   -  Dec 08, 2008

Have to agree with Xpl0reR on this one ... gawd I hate agreeing with him LOL but its true otherwise nice script typo 10/10

 Respond  
xplo   -  Dec 08, 2008

chanserv, nickserv scripts are a Big FAIL

use the internal mirc userlist, because not ALL networks have chanserv :/

chanserv suck BIG time

 Respond  
Bullet_Dodger   -  Sep 26, 2008

_>

 Respond  
Eugenio   -  Sep 26, 2008

ROFL
speak for j00self bullet

 Respond  
Bullet_Dodger   -  Sep 26, 2008

People Dont Like This script majorly because its a bit to complicated for there Mofo minds >_>

 Respond  
Typo   -  Sep 26, 2008

Thanks. I don't know why it had/has such a low rating tbh. Then again the majority of my scripts deserve higher ratings than they have. I don't get it tbh but oh well.

Thanks again. :)

 Respond  
Bullet_Dodger   -  Sep 26, 2008

Great script 8/10

 Respond  
Jonesy44   -  Sep 01, 2008

Stop, Zap.

 Respond  
Typo   -  Jun 24, 2008

Good idea on the help tab, I just added it. I\'m not sure I follow you with the edit box idea. Please explain.

 Respond  
Jonesy44   -  Jun 24, 2008

Perhaps a tab and en edit box for the help?

 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.