SMF Script 8 — File Browser

SMFScript8v8.13 / SMFScript8v8.13 / system / opasist.mrc

opasist.mrc — 11.77 KB — Download this file

alias blist.lcl if ($1 = $null) return | .enable #oa.events | window -blk +e @Banlist fixedsys 10 | titlebar @banlist for $1 | aline -h $colour(text) @Banlist $spaces(Address,40) $spaces(Banned by,30) On date | mode $1 +b
menu @banlist {
  $iif($me isop $gettok($window(@banlist).title,2,32) && $gettok($sline($active,1),1,160) != address,Unban):mode $gettok($window(@banlist).title,2,32) -b $remove($1,$chr(160)) | clear @banlist | blist.lcl $gettok($window(@banlist).title,2,32)
  $iif($me !isop $gettok($window(@banlist).title,2,32) && a isin $usermodes && $gettok($sline($active,1),1,160) != address,Unban):samode $gettok($window(@banlist).title,2,32) -b $remove($1,$chr(160)) | clear @banlist | blist.lcl $gettok($window(@banlist).title,2,32)
}
alias channel.menu if ($dialog(Channel)) return | if ($left($active,1) = $chr(35)) set %oa.chan $active | else { if ($1) set %oa.chan $1 | else return } | .enable #oa.events | dialog -mn Channel Channel | mode %oa.chan +b | did -a Channel 103 $chan(%oa.chan).topic | if ($chan(%oa.chan).mode) did -a channel 154 $gettok($chan(%oa.chan).mode,1,32) | else did -a channel 154 Modes | oa.ncklst.get | if ($me !isop %oa.chan) did -b Channel 109,103,102,108,154,207,211,212,213,214
alias oa.ncklst.get did -r Channel 207 | :loop | inc %oa.nck.num | set %oa.nck.tmp $nick(%oa.chan,%oa.nck.num) | if (%oa.nck.tmp) { did -a Channel 207 $iif(%oa.nck.tmp isop %oa.chan,@) $+ $iif(%oa.nck.tmp isvo %oa.chan,+) $+ %oa.nck.tmp | goto loop } | unset %oa.nck.num
dialog Channel {
  title "The SMF Op Assistant"
  size -1 -1 555 270
  button "Close",1,305 236 245 26,cancel
  text "Topic",201,15 15 275 13,center
  box "Channel",200,5 5 295 257
  text "Ban List",202,15 56 265 13,center
  list 109,15 71 275 150,
  edit "",103,15 30 209 23,autohs
  button "Set Topic",102,226 31 64 21
  button "Unban",108,19 226 64 26
  button "Detailed Banlist",254,89 226 128 26
  button "",154,223 226 64 26
  list 207,430 10 120 226
  button "Op",211,305 11 120 26
  button "Voice",212,305 42 120 26
  button "Kick",213,305 73 120 26
  button "Ban",214,305 104 120 26
}
on *:dialog:Channel:sclick:*:{
  if ($did = 213) && ($did(207,$did(207).sel)) { if ($dialog(Kick)) return | set %k.nick $remove($did(207,$did(207).sel),+,@) | set %k.chan %oa.chan | kick.con } | if ($did = 214) && ($did(207,$did(207).sel)) { if ($dialog(Bancon)) halt | set %b.nick $remove($did(207,$did(207).sel),+,@) | set %b.chan %oa.chan | ban.con } | if ($did = 211) && ($did(207,$did(207).sel)) { if ($did(211) = op) mode %oa.chan +o $remove($did(207,$did(207).sel),+,@) | else mode %oa.chan -o $remove($did(207,$did(207).sel),+,@) } | if ($did = 212) && ($did(207,$did(207).sel)) { if ($did(212) = voice) mode %oa.chan +v $remove($did(207,$did(207).sel),+,@) | else mode %oa.chan -v $remove($did(207,$did(207).sel),+,@) } | if ($did = 207) { if (@ isin $did(207,$did(207).sel)) did -a Channel 211 Deop | else did -a Channel 211 Op | if (+ isin $did(207,$did(207).sel)) did -a Channel 212 Devoice | else did -a Channel 212 Voice }
  if ($did = 1) { unset %oa.* | .disable #oa.events | if ($dialog(cm)) { dialog -x cm | unset %oa.chan.mode.* } } | if ($did = 2) && ($did(4)) && ($did(3,$did(3,1).sel)) { mode %oa.chan $did(3,$did(3,1).sel) $did(4) | did -r Channel 3 | oa.ncklst.get | unset %oa.mod* } | if ($did = 4) set %oa.mode.nick $did(4,$did(4,1).sel) | if ($did = 102) && ($did(103,$did(103,1).text)) topic %oa.chan $did(103,$did(103,1).text) | if ($did = 108) && ($did(109,$did(109,1).sel)) mode %oa.chan -b $did(109,$did(109,1).sel) | if ($did = 154) .timer 1 0 oa.chan.modes | if ($did = 254) { dialog -x Channel | window -blk +e @Banlist fixedsys 10 | titlebar @banlist for %oa.chan | aline -h $colour(text) @Banlist $spaces(Address,33) $spaces(Banned by,30) On date | mode %oa.chan +b }
}
on *:close:@Banlist: if (%oa.chan) channel.menu %oa.chan | else .disable #oa.events
alias oa.chan.modes if (%oa.chan = $null) { if ($1) { set %oa.chan $1 | set %oa.md.cls - } | else return } | dialog -mo CM CM | if (l isin $gettok($chan(%oa.chan).mode,1,32)) { set %oa.chan.mode.limit $chan(%oa.chan).limit | did -c cm 4 | did -ra cm 5 $chan(%oa.chan).limit } | if (i isin $gettok($chan(%oa.chan).mode,1,32)) did -c cm 3 | if (p isin $gettok($chan(%oa.chan).mode,1,32)) did -c cm 7 | if (s isin $gettok($chan(%oa.chan).mode,1,32)) did -c cm 8 | if (k isin $gettok($chan(%oa.chan).mode,1,32)) { set %oa.chan.mode.set %oa.chan.mode.set $+ k | set %oa.chan.mode.key $chan(%oa.chan).key | did -c cm 9 | did -ra cm 10 $chan(%oa.chan).key } | if (m isin $gettok($chan(%oa.chan).mode,1,32)) did -c cm 11 | if (n isin $gettok($chan(%oa.chan).mode,1,32)) did -c cm 12 | if (t isin $gettok($chan(%oa.chan).mode,1,32)) did -c cm 13
dialog CM {
  size -1 -1 200 200
  title "Channel Modes"
  button "Cancel",1,100 164 54 26,cancel
  button "OK",2,41 164 54 26,ok
  check "&Invite Only",3,5 10 75 13
  check "&limited to",4,5 28 60 13
  edit "",5,68 23 75 23
  text "users",6,144 28 50 13 
  check "&Private",7,5 46 51 13
  check "&Secret",8,5 64 50 13
  check "&Key",9,5 82 40 13
  edit "",10,45 77 75 23,autohs
  check "&Moderated",11,5 100 70 13
  check "&No ext. messages",12,5 118 102 13
  check "&Topic can only be changed by ops",13,5 136 190 13
}
alias minus if (%oa.chan.mode.unset) return - $+ %oa.chan.mode.unset
alias plus if (%oa.chan.mode.set) return + $+ %oa.chan.mode.set
on *:dialog:cm:sclick:*:{
  if ($did = 2) {
    if (k isin %oa.chan.mode.unset) && (l isin %oa.chan.mode.unset) mode %oa.chan $minus(%oa.chan.mode.unset) $key(%oa.chan.mode.key) $plus(%oa.chan.mode.set) | if (k isin %oa.chan.mode.set) && (l isin %oa.chan.mode.set) { set %oa.chan.mode.set $remove(%oa.chan.mode.set,l,k) $+ lk | mode %oa.chan $plus(%oa.chan.mode.set) $limit(%oa.chan.mode.limit) $key(%oa.chan.mode.key) $minus(%oa.chan.mode.unset) } | if (k isin %oa.chan.mode.unset) && (l isin %oa.chan.mode.set) mode %oa.chan $minus(%oa.chan.mode.unset) $key(%oa.chan.mode.key) $plus(%oa.chan.mode.set) $limit(%oa.chan.mode.limit)
    if (k isin %oa.chan.mode.set) && (l isin %oa.chan.mode.unset) mode %oa.chan $minus(%oa.chan.mode.unset) $plus(%oa.chan.mode.set) $key(%oa.chan.mode.key) | if (k isin %oa.chan.mode.set) && (l !isin %oa.chan.mode.unset) && (l !isin %oa.chan.mode.set) mode %oa.chan $minus(%oa.chan.mode.unset) $plus(%oa.chan.mode.set) $key(%oa.chan.mode.key) | if (k isin %oa.chan.mode.unset) && (l !isin %oa.chan.mode.unset) && (l !isin %oa.chan.mode.set) mode %oa.chan $minus(%oa.chan.mode.unset) $key(%oa.chan.mode.key) $plus(%oa.chan.mode.set)
    if (l isin %oa.chan.mode.set) && (k !isin %oa.chan.mode.unset) && (k !isin %oa.chan.mode.set) mode %oa.chan $minus(%oa.chan.mode.unset) $plus(%oa.chan.mode.set) $limit(%oa.chan.mode.limit) | if (l isin %oa.chan.mode.unset) && (k !isin %oa.chan.mode.unset) && (k !isin %oa.chan.mode.set) mode %oa.chan $minus(%oa.chan.mode.unset) $plus(%oa.chan.mode.set) | if (k !isin %oa.chan.mode.set) && (k !isin %oa.chan.mode.unset) && (l !isin %oa.chan.mode.set) && (l !isin %oa.chan.mode.unset) mode %oa.chan $minus(%oa.chan.mode.unset) $plus(%oa.chan.mode.set) | if (%oa.md.cls) unset %oa.md.cls %oa.chan | unset %oa.chan.mode.*
  }
  if ($did = 3) { if ($did(3).state = 0) { if (%oa.chan.mode.set) set %oa.chan.mode.set $remove(%oa.chan.mode.set,i) | set %oa.chan.mode.unset %oa.chan.mode.unset $+ i } | else { if (%oa.chan.mode.unset) set %oa.chan.mode.unset $remove(%oa.chan.mode.unset,i) | set %oa.chan.mode.set %oa.chan.mode.set $+ i } } | if ($did = 4) { if ($did(4).state = 0) { if (%oa.chan.mode.set) set %oa.chan.mode.set $remove(%oa.chan.mode.set,l) | set %oa.chan.mode.unset %oa.chan.mode.unset $+ l } | else { if (%oa.chan.mode.unset) set %oa.chan.mode.unset $remove(%oa.chan.mode.unset,l) | set %oa.chan.mode.set %oa.chan.mode.set $+ l } }
  if ($did = 7) { if ($did(7).state = 0) { if (%oa.chan.mode.set) set %oa.chan.mode.set $remove(%oa.chan.mode.set,p) | set %oa.chan.mode.unset %oa.chan.mode.unset $+ p } | else { if (%oa.chan.mode.unset) set %oa.chan.mode.unset $remove(%oa.chan.mode.unset,p) | set %oa.chan.mode.set %oa.chan.mode.set $+ p } } | if ($did = 8) { if ($did(8).state = 0) { if (%oa.chan.mode.set) set %oa.chan.mode.set $remove(%oa.chan.mode.set,s) | set %oa.chan.mode.unset %oa.chan.mode.unset $+ s } | else { if (%oa.chan.mode.unset) set %oa.chan.mode.unset $remove(%oa.chan.mode.unset,s) | set %oa.chan.mode.set %oa.chan.mode.set $+ s } }
  if ($did = 9) { if ($did(9).state = 0) { if (%oa.chan.mode.set) set %oa.chan.mode.set $remove(%oa.chan.mode.set,k) | set %oa.chan.mode.unset %oa.chan.mode.unset $+ k } | else { if (%oa.chan.mode.unset) set %oa.chan.mode.unset $remove(%oa.chan.mode.unset,k) | set %oa.chan.mode.set %oa.chan.mode.set $+ k } } |   if ($did = 13) { if ($did(13).state = 0) { if (%oa.chan.mode.set) set %oa.chan.mode.set $remove(%oa.chan.mode.set,t) | set %oa.chan.mode.unset %oa.chan.mode.unset $+ t } | else { if (%oa.chan.mode.unset) set %oa.chan.mode.unset $remove(%oa.chan.mode.unset,t) | set %oa.chan.mode.set %oa.chan.mode.set $+ t } }
  if ($did = 11) { if ($did(11).state = 0) { if (%oa.chan.mode.set) set %oa.chan.mode.set $remove(%oa.chan.mode.set,m) | set %oa.chan.mode.unset %oa.chan.mode.unset $+ m } | else { if (%oa.chan.mode.unset) set %oa.chan.mode.unset $remove(%oa.chan.mode.unset,m) | set %oa.chan.mode.set %oa.chan.mode.set $+ m } } | if ($did = 12) { if ($did(12).state = 0) { if (%oa.chan.mode.set) set %oa.chan.mode.set $remove(%oa.chan.mode.set,n) | set %oa.chan.mode.unset %oa.chan.mode.unset $+ n } | else { if (%oa.chan.mode.unset) set %oa.chan.mode.unset $remove(%oa.chan.mode.unset,n) | set %oa.chan.mode.set %oa.chan.mode.set $+ n } }
  if ($did = 1) { unset %oa.chan.mode.* | if (%oa.md.cls) unset %oa.md.cls %oa.chan }
}
alias limit if ($abs($1) < 1) return 5 | return $1
alias key if ($1 = $null) return key | return $1
on *:dialog:cm:edit:*: if ($did = 5) { set %oa.chan.mode.limit $did(5) | if (l !isin %oa.chan.mode.set) set %oa.chan.mode.set %oa.chan.mode.set $+ l } | if ($did = 10) { set %oa.chan.mode.key $did(10) |  | if (k !isin %oa.chan.mode.set) set %oa.chan.mode.set %oa.chan.mode.set $+ k }
on *:dialog:Channel:edit:8: set %oa.kick.msg $did(8,$did(8,1).text)
#oa.events off
raw 367:*: if ($dialog(Channel)) did -a Channel 109 $3 | if ($window(@Banlist)) aline -h $colour(text) @Banlist $spaces($3,40) $spaces($gettok($4,1,33),30) $asctime($5) | if ($dialog(Channel) = $null) && ($window(@Banlist) = $null) .disable #oa.events | haltdef
raw 368:*: if ($window(@Banlist)) window -b @Banlist | if ($dialog(Channel) = $null) && ($window(@Banlist) = $null) .disable #oa.events | haltdef
on *:mode:%oa.chan: if ($dialog(Channel) = $null) return | if ($chan(%oa.chan).mode) did -a channel 154 $gettok($chan(%oa.chan).mode,1,32) | else did -a channel 154 Modes
on *:TOPIC:%oa.chan: if ($dialog(Channel) = $null) return | did -r Channel 103 | if ($chan(%oa.chan).topic) did -a Channel 103 $chan(%oa.chan).topic
on *:join:%oa.chan: if ($dialog(Channel) = $null) return | oa.ncklst.get
on *:unban:%oa.chan: if ($dialog(Channel) = $null) return | did -r Channel 109 | mode $chan +b
on *:ban:%oa.chan: if ($dialog(Channel) = $null) return | did -r Channel 109 | mode $chan +b
on *:op:%oa.chan: if ($dialog(Channel) = $null) return | if ($opnick = $me) did -e Channel 109,103,102,108,154,207,211,212,213,214 | oa.ncklst.get
on *:deop:%oa.chan: if ($dialog(Channel) = $null) return | if ($opnick = $me) did -b Channel 109,103,102,108,154,207,211,212,213,214 | oa.ncklst.get
on *:voice:%oa.chan: if ($dialog(Channel) = $null) return | oa.ncklst.get
on *:devoice:%oa.chan: if ($dialog(Channel) = $null) return | oa.ncklst.get
on *:NICK: if ($dialog(Channel) = $null) return | oa.ncklst.get
on *:kick:%oa.chan: if ($dialog(Channel) = $null) return | .timer 1 2 oa.ncklst.get
on *:part:%oa.chan: if ($dialog(Channel) = $null) return | .timer 1 2 oa.ncklst.get
on *:quit: if ($dialog(Channel) = $null) return | .timer 1 2 oa.ncklst.get
#oa.events end