Was Tired of getting kicked/kbed from channels from amsging so I made an amsg script to halt from some channels.
/amsg text
/addchan #channel
/delchan #channel
alias addchan {
if ($1 isin %amsg) { echo Channel is already on Ignore | halt }
var %x %amsg
set %amsg %x $1
echo Added to Amsg Ignore
}
alias delchan {
if ($1 !isin %amsg) { echo Channel is not on Ignore | halt }
var %x %amsg
var %x2 $remove(%x,$1)
set %amsg %x2
echo $1 Removed from Amsg ignore list
}
alias amsg {
var %x $chan(0)
while (%x) {
if ($chan(%x) isin %amsg) {
dec %x
}
else {
msg $chan(%x) $1-
dec %x
}
}
}
nice lil code but you may want to look into $addtok and $remtok as well as $istok.
also you may want to add some checks to it as well like if $chr(35) was added before the channel name or not.
also may be add a check if anything is in the %amsg var when you trigger the mass message.
this is just an example nothing more.....
alias addamsg {
if ($left($1,1) != $chr(35) || $istok(%amsg,$1,32)) {
echo -a $iif($left($1,1) != $chr(35),Please put $chr(35) before the name of the channel ex:#channel,$iif($istok(%amsg,$1,32),Channel is already in the list.)) }
else { set %amsg $addtok(%amsg,$1,32) | echo -a $1 has been added. }
}
alias delamsg {
if ($left($1,1) != $chr(35) || !$istok(%amsg,$1,32)) {
echo -a $iif($left($1,1) != $chr(35),Please put $chr(35) before the name of the channel ex:#channel,$iif(!$istok(%amsg,$1,32),Channel is not in the list.)) }
else { set %amsg $remtok(%amsg,$1,1,32) | echo -a $1 has been removed. }
}
alias amsg2 {
if (%amsg && $1) {
var %x $chan(0)
while (%x) {
if (!$istok(%amsg,$chan(%x),32)) msg $chan(%x) $1-
dec %x
}
}
}