mIRC Home    About    Download    Register    News    Help

Print Thread
Joined: Dec 2002
Posts: 17
C
Chimera Offline OP
Pikka bird
OP Offline
Pikka bird
C
Joined: Dec 2002
Posts: 17
When doing /ame or /amsg with colours, it would be nice if mirc recognised the channels that have +c mode and stripped the colours just for those channels so the message is still sent to all channels, instead of being blocked by channels with that mode.
I'm not sure how hard this would be, but I think channel modes for blocking control codes are pretty standardised across irc servers.
Should I report this as a bug? I don't think /ame and /amsg are doing their intended job if channels that block control codes miss out.

Joined: Dec 2002
Posts: 1,321
H
Hoopy frood
Offline
Hoopy frood
H
Joined: Dec 2002
Posts: 1,321
This will do what you need.
Code:

alias ame {
  var %+c, %-c, %i = 1
  while ($chan(%i)) {
    var %chan = $ifmatch
    if (c isin $chan(%i).mode) %+c = $addtok(%+c,%chan,44)
    else %-c = $addtok(%-c,%chan,44)
    echo $color(action) -bflmnqrti2 %chan * $me $1-
    if ($numtok(%+c,44) == 4) {
      .raw PRIVMSG %+c $+(:,$chr(1),ACTION $strip($1-),$chr(1))
      unset %+c
    }
    elseif ($numtok(%-c,44) == 4) {
      .raw PRIVMSG %-c $+(:,$chr(1),ACTION $1-,$chr(1))
      unset %-c
    }
    inc %i
  }
  if (%+c) .raw PRIVMSG %+c $+(:,$chr(1),ACTION $strip($1-),$chr(1))
  if (%-c) .raw PRIVMSG %-c $+(:,$chr(1),ACTION $1-,$chr(1))
}
alias amsg {
  var %+c, %-c, %i = 1
  while ($chan(%i)) {
    var %chan = $ifmatch
    if (c isin $chan(%i).mode) %+c = $addtok(%+c,%chan,44)
    else %-c = $addtok(%-c,%chan,44)
    echo $color(own) -bflmnqrti2 %chan $+(<,$chr(3),$nick($chan,$me).color,$me,$chr(3),>) $1-
    if ($numtok(%+c,44) == 4) {
      .raw PRIVMSG %+c $+(:,$strip($1-))
      unset %+c
    }
    elseif ($numtok(%-c,44) == 4) {
      .raw PRIVMSG %-c $+(:,$1-)
      unset %-c
    }
    inc %i
  }
  if (%+c) .raw PRIVMSG %+c $+(:,$strip($1-))
  if (%-c) .raw PRIVMSG %-c $+(:,$1-)
}


DALnet: #HelpDesk and #m[color:#FF0000]IR[color:#EEEE00]C
Joined: Dec 2002
Posts: 17
C
Chimera Offline OP
Pikka bird
OP Offline
Pikka bird
C
Joined: Dec 2002
Posts: 17
Thanx for the speedy reply. I guess it's up to Khaled to decide if this is trivial enough to leave to a scripted workaround people need to look here for (or do themselves), and maybe just change the helpfile so it doesn't say "all" channels.


Link Copied to Clipboard