Chanserv Access list Dialog

By thegingon on May 23, 2012

Screenshots

Chan's access list viewer and editor
;§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§
;§§ Made by: yoav sternberg
;§§ Title: access list.mrc
;§§ Date: 22-05-2012
;§§ Description: Chanserv Access Dialog Editor
:§§ version: 0.8 beta
;§§
;§§ DO NOT CHANGE ANYTHING IN THIS FILE
;§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§
I created chanserv access dialog.
What is included in the script:

  • Chan's access list viewer and editor - you can see Chan's access list and add/delete nick for that .
  • Whois on nick - you can do whois on nick that on Chan's access list if him online - semicredit to http://www.hawkee.com/snippet/8959/ for the Design and code
;§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§
;§§                        Made by: thegingon
;§§               Title:       access list.mrc
;§§               Date:          22-05-2012
;§§               Description:  Chanserv Access Dialog Editor
;§§
;§§               DO NOT CHANGE ANYTHING IN THIS FILE
;§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§

menu channel {
  .access list:/accesslistd
}
alias -l accesslistd {
  set %if $chan | /accesslist |  /did -r access_list 4 | /did -a access_list 4 creating access list for - # | write -c access.ini | writeini access.ini chan 1 # | access2 #
}                                                                      
alias -l access2  { /.enable #access_list2 | /cs access $$1 list }
alias accesslist { /dialog -md access_list access_list }

alias -l not_online { var %nick = $readini(access.ini,$did(access_list, 6).sel,name)) | noop $input(the nick %nick isn't online,o,%nick isn't online) }
dialog access_list {
  title "access list"
  size -1 -1 242 152
  option dbu
  text "Channel:", 2, 10 10 23 8
  edit "", 3, 39 9 55 10, autohs
  text "", 4, 145 7 97 15
  button "Start", 5, 101 8 37 12
  list 6, 9 35 220 80, size
  text "", 7, 69 25 80 10
  button "delete his/her access", 8, 26 118 55 18
  button "whois nick", 9, 91 118 55 18
  button "add access", 10, 159 118 55 18
  text "credit to yoav sternberg (thegingon-bnc on rizon)", 1, 59 141 136 8
}

on *:dialog:access_list:init:0:{
  write -c access.ini
  if (%if) { did -a access_list 3 %if | /did -b access_list 3 }
  unset %if
}
;$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$
;                                                      whois
;$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$
dialog whois {
  title "whois dialog"
  size -1 -1 180 110
  option dbu
  edit "" 3, 5 5 170 90, read multi hsbar vsbar
  button "close", 6, 136 98 40 10
}
on *:dialog:whois:sclick:6:{ dialog -x whois whois }
on *:dialog:whois:init:0:{
  whois $readini(access.ini,$did(access_list, 6).sel,name)
  did -r whois 3
  did -a whois 3 Whois Results: $crlf
  did -a whois 3 -------------------- $crlf

}
raw 319:*:{ if ($dialog(whois)) { haltdef | did -a whois 3 Channels: $3- $crlf } }
raw 311:*:{ 
  if ($dialog(whois)) {
    haltdef 
    did -a whois 3 Whois: From $1 to $2 $crlf
    did -a whois 3 Address: $+($3,@,$4) $crlf 
  }
}
raw 312:*:{ if ($dialog(whois)) { haltdef | did -a whois 3 Server: $3 $+ , $4- $crlf } }
raw 330:*:{ if ($dialog(whois)) { haltdef | did -a whois 3 AuthServ Account: $3 $crlf } }
raw 307:*:{ if ($dialog(whois)) { haltdef | did -a whois 3 $2- $crlf } } 
raw 338:*:{ if ($dialog(whois)) { haltdef | did -a whois 3 $1- $crlf } }
raw 401:*:{ if ($dialog(whois)) { haltdef | did -a whois 3 $2- $crlf } }
raw 317:*:{ 
  if ($dialog(whois)) { 
    haltdef | did -a whois 3 Idle: $duration($3) $+ , Signed on: $asctime($4,dddd mm/dd/yyyy HH:nntt) $crlf
  } 
}
raw 318:*:{ if ($dialog(whois)) { haltdef } }
raw 352:*:{ if ($dialog(access_list)) { set -u5 %online 1 } }
raw 315:*:{ if ($dialog(access_list)) {  haltdef  | $iif(%online == 1,dialog -m whois whois,.timer 1 0 not_online) } }

;$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$
;                                                      groups
;$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$

#access_list2 off
on ^*:NOTICE:Access *list *for*:*:{ haltdef }
on ^*:NOTICE:*Num *Lev *Nick:*:{
  //haltdef
  set %chanservaccess 1
  set %n_of_access_nick 1
}
on ^$*:NOTICE:/^  (.*)  (.*)  (.*)/Si:*:{
  if (%chanservaccess == 1) {
    haltdef
    writeini access.ini %n_of_access_nick level $regml(2)
    writeini access.ini %n_of_access_nick name $regml(3)
    write access.txt $regml(2) : $regml(3)
    inc %n_of_access_nick   
  } 
}
on ^*:NOTICE:End of access list.:*:{
  haltdef
  var %w = 1
  did -r access_list 6
  if ($readini(access.ini,%w,level) isnum) { did -a access_list 7 levels system }
  else { did -a access_list 7 xop system }
  did -r access_list 4 | did -a access_list 4 completed
  while (%n_of_access_nick > %w) {
    did -a access_list 6 $readini(access.ini,%w,level) : $readini(access.ini,%w,name)
    inc %w 
  }
  .disable #access_list2
  unset %chanservacc* | unset %n_of_access_nick
  /did -e access_list 3
}
#access_list2 end

#access_list3 off
on ^$*:NOTICE: /^(\S+) deleted from (\S+) (\S+) list\.$/Si:*:{
  haltdef
  var %line = $didwm(access_list,6,$regml(3) : $regml(1),0)
  remini access.ini %line 
  did -d access_list 6 %line
  /did -r access_list 4 | /did -a access_list 4 success deleted $regml(1) from $regml(3) list on $regml(2)
  .disable #access_list3
}

on ^*:NOTICE:*denied*:*:{
  if (Permission isin $1-) {
    haltdef
    var %line = $did(access_list, 6).sel
    var %text = $did(access_list, 6, %line).text
    noop $regex(%text,/^(.+) : (.+)$/)
    /did -r access_list 4 | /did -a access_list 4 * access denied - you can't delete $regml(2) from  $regml(1) in $readini(access.ini,chan,1) 
    .disable #access_list3
  }
}

#access_list3 end

#access_list4 off
on ^$*:NOTICE:/^(\S+) deleted from (\S+) (\S+) list\.$/Si:*:{
  haltdef
  var %line = $didwm(access_list,6,*: $regml(1),0)
  remini access.ini %line 
  did -d access_list 6 %line
  /did -r access_list 4 | /did -a access_list 4 success deleted $regml(1) from $regml(3) list on $regml(2)
  .disable #access_list4
}
on ^*:NOTICE:*denied*:*:{
  if (access isin $1-) {
    haltdef
    var %line = $did(access_list, 6).sel
    var %text = $did(access_list, 6, %line).text
    noop $regex(%text,/^(.+) : (.+)$/)
    /did -r access_list 4 | /did -a access_list 4 * access denied - you can't delete $regml(2) from access level - $regml(1) in $readini(access.ini,chan,1) 
    .disable #access_list4
  }
}
#access_list4 end

on *:dialog:access_list:sclick:5:{
  if ($did(3) == $null) { /did -r access_list 4 | /did -a access_list 4 * please write chan }
  elseif ($did(3).text !ischan) { /did -r access_list 4 | /did -a access_list 4 * you must to be on this chan }
  elseif ($me isvoice $did(3).text) || ($me isop $did(3).text) || ($me ishop $did(3).text) || (& isin $nick($did(3).text,$me).pnick) || (~ isin $nick($did(3).text,$me).pnick) { /did -r access_list 4 | /did -a access_list 4 creating access list for - $did(3).text | write -c access.ini | writeini access.ini chan 1 $did(3).text | access2 $did(3).text | /did -b access_list 3 }
  else { /did -r access_list 4 | /did -a access_list 4 * you are not voicer or higher in $did(3).text . }
}

on *:dialog:access_list:sclick:8:{
  if ($did(access_list, 6).sel == 0) { /did -r access_list 4 | /did -a access_list 4 * you can't delete nothing }
  elseif (xop isin $did(7).text) { /.enable #access_list3 | $iif($input(are you sure that do you want to delete $readini(access.ini,$did(access_list, 6).sel,name) access $crlf $+ in the chan $readini(access.ini,chan,1) ?,yaq,delete access,access list deleting),.msg ChanServ $readini(access.ini,$did(access_list, 6).sel,level) $readini(access.ini,chan,1)) DEL $readini(access.ini,$did(access_list, 6).sel,name) }
  elseif (levels isin $did(7).text) { /.enable #access_list4 | $iif($input(are you sure that do you want to delete $readini(access.ini,$did(access_list, 6).sel,name) access $crlf $+ in the chan $readini(access.ini,chan,1) ?,yaq,delete access,access list deleting),/.msg ChanServ ACCESS $readini(access.ini,chan,1) DEL $readini(access.ini,$did(access_list, 6).sel,name)) }
}

on *:dialog:access_list:sclick:9:{
  if ($did(access_list, 6).sel == 0) { /did -r access_list 4 | /did -a access_list 4 * you can't whois nothing }
  else { 
    /who $readini(access.ini,$did(access_list, 6).sel,name)
  }
}
on *:dialog:access_list:sclick:10:{
  if (!$readini(access.ini,chan,1)) { | .timer 1 0 noop $input(you need to be Focused on channel before adding access.,o) | return }
  else { 
    if ($$?!="do you want to add access in the chan $readini(access.ini,chan,1) ?" == $false) { .timer 1 0 noop $input(you need to be Focused on channel that you want to add access in it before adding access.,oh) | return }
    set %nick [ [ $$?="what is the nick that do u want to add access to him in the chan $readini(access.ini,chan,1) ? " ] ]
    var %system = $iif(levels isin $did(7).text,level,permission)
    :level
    set %level [ [ $$?="what is the %system that do u want to add to %nick in the chan $readini(access.ini,chan,1) ? " ] ]
    if (levels !isin $did(7).text) {
      if (%level !== vop) || (%level !== vop) || (%level !== vop) || (%level !== vop) { .timer 1 0 noop $input(wrong XOP level - try again,o) | goto level } 
    }
    elseif (%level !isnum) { .timer 1 0 noop $input(wrong level - that not a number - try again,o) | goto level }
    $iif(levels isin $did(7).text,/.enable #access_list5,/.enable #access_list6)
    $iif(levels isin $did(7).text,/.msg ChanServ ACCESS $readini(access.ini,chan,1) ADD %nick %level,/.msg ChanServ %level $readini(access.ini,chan,1) ADD %nick)
  }
}

#access_list5 off
on ^*:NOTICE:*denied*:*:{
  if (access isin $1-) {
    haltdef
    /did -r access_list 4 | /did -a access_list 4 * access denied - you can't add %nick to access level - %level in $readini(access.ini,chan,1)
    unset %nick | unset %level 
    .disable #access_list5
  }
}
on ^*:NOTICE:*added to * access list at level*.:*:{
  haltdef
  /did -r access_list 4 | /did -a access_list 4 success add $strip($1) to level $strip($9) on $readini(access.ini,chan,1)
  var %n = 1     
  while ($readini(access.ini,%n,name) !== $null) {
    inc %n
  }
  writeini access.ini %n name %nick
  writeini access.ini %n level %level
  did -a access_list 6 %level : %Nick
  unset %level | unset %nick 
  .disable #access_list5
}
#access_list5 end

#access_list6 off
on ^*:NOTICE:*denied*:*:{
  if (Permission isin $1-) {
    haltdef
    /did -r access_list 4 | /did -a access_list 4 * Permission denied - you can't add to %nick the Permission - %level in $readini(access.ini,chan,1)
    unset %nick | unset %level 
    .disable #access_list5
  }
}

on ^*:NOTICE:*added to * list*:*:{
  haltdef
  /did -r access_list 4 | /did -a access_list 4 success add $strip($1) to Xop level - $strip($5) on $readini(access.ini,chan,1)
  var %n = 1     
  while ($readini(access.ini,%n,name) !== $null) {
    inc %n
  }
  writeini access.ini %n name %nick
  writeini access.ini %n level %level
  did -a access_list 6 %level : %Nick
  unset %level | unset %nick 
  .disable #access_list6
}
#access_list6 end

Comments

Sign in to comment.
Stewie1k94   -  Aug 10, 2012

Nice snippet. :)

 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.