A little snippet I thought would be useful to others.
Basic channel menu to start the process, If there aren't any ban's it won't open the dialog, Otherwise it will do.
Tell's the user who set it for one ban, If more than one selected ban, It'll replace the user who set it with "Multiple Entries"
I hope you guys find this useful.
menu channel,menubar {
Ban List Dialog:iblstart
}
dialog ibllist {
title "Ban List Dialog by Danneh/GrimReaper"
size -1 -1 211 137
option dbu
box "List of bans:", 1, 3 3 137 131
list 2, 7 11 128 106, multsel check result
box "Ban Information:", 3, 143 3 64 51
text "Set by:", 4, 147 11 18 8
text "", 5, 147 21 56 8
text "Date set:", 6, 147 31 23 8
text "", 7, 147 41 56 8
button "CheckAll", 8, 143 57 64 12
button "Remove", 9, 143 72 64 12
button "Remove Selected", 10, 143 87 64 12
button "Remove All", 11, 143 102 64 12
button "Ok/Cancel", 12, 156 118 37 12, ok cancel
text "", 13, 7 122 128 8
}
on *:DIALOG:ibllist:init:*: {
if ($ibl($active,0) != 0) {
var %a = 1
while (%a <= $ibl($active,0)) {
did -a $dname 2 $ibl($active,%a)
inc %a
}
did -a $dname 13 Total entries on $+($active,$chr(58)) $ibl($active,0)
noop $input(All entries have been added..,o,Success!)
}
else {
noop $input(There are no entries for $+($active,.),o,Closing Dialog!)
dialog -x $dname
}
}
on *:DIALOG:ibllist:sclick:2,8-11: {
var %a
if ($did == 2) {
if ($did($dname,2,0).sel == 1) {
did -ra $dname 5 $ibl($active,$did($dname,2).sel).by
did -ra $dname 7 $ibl($active,$did($dname,2).sel).date
}
elseif ($did($dname,2,0).sel >= 2) {
did -ra $dname 5 Multiple Entries
did -ra $dname 7 Multiple Entries
}
elseif ($did($dname,2,0).sel == 0) {
if ($did($dname,5) != $null) && ($did($dname,7) != $null) {
did -r $dname 5,7
}
}
}
if ($did == 8) {
%a = 1
while (%a <= $did($dname,2).lines) {
if ($did(8).text == CheckAll) {
did -s $dname 2 %a
}
elseif ($did(8).text == UnCheckAll) {
did -l $dname 2 %a
}
inc %a
}
if ($did(8).text == CheckAll) {
did -ra $dname 8 UnCheckAll
}
elseif ($did(8).text == UnCheckAll) {
did -ra $dname 8 CheckAll
}
}
if ($did == 9) {
if ($did($dname,2,0).sel == 1) {
mode $active -b $did($dname,2,$did($dname,2).sel).text
did -d $dname 2 $did($dname,2).sel
.timer 1 1 refreshibl
}
}
if ($did == 10) {
%a = 0
var %bans
while ($did($dname,2,0).csel > 0) {
%bans = %bans $did($dname,2,$did($dname,2,1).csel).text
did -d $dname 2 $did($dname,2,1).csel
inc %a
if (%a == $modespl) {
mode $active - $+ $str(b,%a) %bans
%bans = $null
%a = 0
}
}
if (%bans) {
mode $active - $+ $str(b,%a) %bans
}
.timer 1 1 refreshibl
}
if ($did == 11) {
%a = 0
var %bans
while ($did($dname,2).lines > 0) {
%bans = %bans $did($dname,2,1).text
did -d $dname 2 1
inc %a
if (%a == $modespl) {
mode $active - $+ $str(b,%a) %bans
%bans = $null
%a = 0
}
}
if (%bans) {
mode $active - $+ $str(b,%a) %bans
}
.timer 1 1 refreshibl
}
}
alias iblstart {
if ($me !ison $active) {
return
}
if (!$chan($active).ibl) {
.enable #IBLList
.timerIBLListTimeout 1 8 ibltimeout
mode $active +b
}
else {
ibldialog
}
}
alias ibldialog {
dialog $iif($dialog(ibllist),-v,-m ibllist) ibllist
}
alias -l refreshibl {
did -ra ibllist 13 Total entries on $+($active,$chr(58)) $ibl($active,0)
}
#IBLList off
raw 368:*: {
HALTDEF
.timerIBLListTimeout off
.disable #IBLList
ibldialog
}
#IBLList end
alias ibltimeout {
.disable #IBLList
ibldialog
}
is not the best way to grab the bans. i've found that if the banlist has not been modified for a bit such as adding/removing of bans. that some or all of the bans will not show up this is an example of another way to do it that i set up via my bot.
look at his whole code. he checks $chan().ibl before initiating the dialog and will request the ban list from the server if the IBL isn't necessarily up-to-date. that is the most sensible method.
ok i do have one suggestion though buddy. using the
var %a = 1
while (%a <= $ibl($active,0)) {
is not the best way to grab the bans. i've found that if the banlist has not been modified for a bit such as adding/removing of bans. that some or all of the bans will not show up this is an example of another way to do it that i set up via my bot.
elseif ($1 == .bans) { .set %checkbanchan $chan | .set %checkban on | .mode $chan +b }
raw 367 :*: {
if (%checkban == on) {
.msg %checkbanchan $3 set by $4
}
}
this is the raw that says end of banlist for w.e channel
raw 368 :*: {
if (%checkban == on) {
.set %checkban off
}
}
which im sure you could easily change and implement into your coding if you feel like doing so
Thanks SunnyD, I always try and find way's to improve what is always there, I don't personally like the default viewer in mIRC so I decided to make my own.
Eventually, I will update it with adding of new bans etc, But for now, I'm leaving it as is, I'm in going to attempt to make an Android App. Even tho I don't know Java one little bit. lol
@PyThOn, I will see what I can do in the next update, It's been a while since I wrote anything in mSL as I've been writing in TCL for the last month for a few friends of mine so they can have a bot.
Thanks Ryan. You know where to find me if you need any help with anything. Even tho I know what your coding is like. :p