There are 3 ways to do that.
The first one is looping through $nick($active,%var) and using $didwm() to check whether one of them is found in the bot list. In this case, you'll ask botserv to remove that nick from the channel. Example:
On *:dialog:botlist:sclick:1:{
var %# = $active, %b = $did(12).seltext
if !%b || $me !ison %# { halt }
var %i = $nick(%#,0)
while %i {
if $didwm(12,$nick(#%,%i)) {
msg botserv unassign %# $did(12,$ifmatch)
break
}
dec %i
}
msg botserv assign %# %b
echo 3 -a Bot successfully assigned to %#
echo 3 -a Thank you for using Aazn Listbot
}
Another way is looping through $did(botlist,12,%var), and using the "ison" operator to check whether one of the listed bots is on the channel, in which case botserv will be asked to remove it. For example,
var %i = $did(12).lines
while %i {
if $did(12,%i) ison %# {
msg botserv unassign %# $ifmatch
break
}
dec %i
}
The third way is my favorite, because no loop is needed there. We use $didtok() to return the content of the listbox as a single string, make up a regular expression pattern out of it, and use the new regex feature of $fline() to scan the side-listbox of the channel for a matching nick. Here's an example,
var %r = ^[ $+ $prefix $+ ]?( $+ $replace($didtok(12,10),\,\\,$chr(123),\{,[,\[,^,\^,|,\|,$lf,|) $+ )$
if $fline(%#,%r,1,3) {
msg botserv unassign %# $nick(%#,$ifmatch)
}
Now you can pick up whatever idea you like
Edit: fixed $replace x 4 :tongue: