AutoPart
Platform: mIRC
Published Jul 09, 2007
Updated Jul 09, 2007
Menu driven controller to allow you to specify channels you don't want to be in. Sort of like the opposite of Auto-Join on invite.
Channels can be added/removed one at a time, or in sets, and are network specific.
A temporary (2 minute) removal can be set up, if you need to be in one of those channels for some reason, but don't want to remove it and then re-add it again later.
Channels are network specific, and the current channel (if any) is automatically inserted in the Add section (this can be overwritten, of course)
menu * {
Auto-Part
.Add : .auto-part add $$input(Comma or space separated,e,Enter Channel Name(s),$iif($chan,$chan))
.Over-Ride Auto-Part : auto-part pause $$input(Comma or space separated,e,Enter Channel Name(s))
.Remove : auto-part del $$input(Comma or space separated,e,Enter Channel Name(s))
.Review : auto-part list
}
alias -l auto-part {
if $1 == add {
var %ap_channels = $replace($2-,$chr(44),$chr(32))
while %ap_channels {
var %ap_channel = $gettok(%ap_channels,1,32)
.hadd -m AutoPart %ap_channel $network
echo -a Channel %ap_channel has been added for $network
%ap_channels = $remtok(%ap_channels,%ap_channel,1,32)
}
}
elseif $1 == del {
var %ap_channels = $replace($2-,$chr(44),$chr(32))
while %ap_channels {
var %ap_channel = $gettok(%ap_channels,1,32)
.hdel AutoPart %ap_channel
echo -a Channel %ap_channel has been removed from those for $network
%ap_channels = $remtok(%ap_channels,%ap_channel,1,32)
}
}
elseif $1 == pause {
var %ap_channels = $replace($2-,$chr(44),$chr(32))
while %ap_channels {
var %ap_channel = $gettok(%ap_channels,1,32)
.hdel AutoPart %ap_channel
echo -a Channel %ap_channel has been temporarily removed from those for $network $+ . It will be automatically re-added after 2 minutes
$+(.timer,%ap_channel) 1 120 hadd -m AutoPart %ap_channel $network
%ap_channels = $remtok(%ap_channels,%ap_channel,1,32)
}
}
elseif $1 == list {
var %a = 1, %b = $hget(AutoPart,0).item
.msg $me Auto-Part Currently Enabled for:
while %a <= %b {
.timer 1 %a .msg $me $hget(AutoPart,%a).item on $hget(AutoPart,%a).data
inc %a
}
}
}
on *:start:{
if !$hget(AutoPart) { .hmake AutoPart 10 }
if $exists(AutoPart.hsh) { .hload AutoPart AutoPart.hsh }
}
on *:exit:{
.hsave -o AutoPart AutoPart.hsh
}
on *:disconnect:{
.hsave -o AutoPart AutoPart.hsh
}
on me:*:join:#:{
if $hget(AutoPart,$chan) == $network {
.part $chan
}
}