Add the follow lines of code to your remotes (Alt-R):
Code:

  [color:#004400]
;  For channel text someone else types
   [/color]
#Custom.Display.Channel on
 
on ^*:TEXT:*:#:{
  echo $color(normal) -mbflirt $chan $&
    $+($chr(40), $chr(3), $nick($chan, $nick).color, $pcnick($nick), $chr(3), $chr(41)) $1-
  haltdef
}
  [color:#004400]
;  For channel text you type
  [/color]
on *:INPUT:#:{
  if /* !iswm $1- && $ctrlenter == $false {
    if ($ShouldPrefixOwn) echo $color(own) -mait $&
      $+($chr(40), $chr(3), $nick($chan, $me).color, $pcnick($me), $chr(3), $chr(41)) $1-
    else $&
      echo $color(own) -mait ) $1-
    .msg $active $1-
    halt
  }
}
 
#Custom.Display.Channel end
 [color:#004400] 
;  For query text someone else types
  [/color]
#Custom.Display.Query on
 
on ^*:TEXT:*:?:{
  echo $color(normal) -mbflirt $nick $*
    $+($chr(40), $chr(3), $cnick($nick).color, $nick, $chr(3), $chr(41)) $1-
  haltdef
}
  [color:#004400]
;  For query text you type
  [/color]
on *:INPUT:?:{
  if /* !iswm $1- && $ctrlenter == $false {
    if ($ShouldPrefixOwn) echo $color(own) -mait $&
      $+($chr(40), $chr(3), $cnick($me).color, $me, $chr(3), $chr(41)) $1-
    else echo $color(own) -mait ) $1-
    .msg $active $1-
    halt
  }
}
#Custom.Display.Query end
  [color:#004400]
;  Return the $pcnick(nick)
;  after checking mirc.ini to see if the $nick($chan, $nick).pnick should be returned.
  [/color]
alias -l pcnick return $iif($gettok($readini($mircini, Options, n2), 30, 44) == 1, $nick($chan, $1).pnick, $1)
  [color:#004400]
;  $ShouldPrefixOwn
;  returns $true or $null, depending on how you have your mIRC set up.
  [/color]
alias -l ShouldPrefixOwn if ($gettok($readini($mircini, Options, n0), 23, 44) == 1) return $true
  [color:#004400]
;  Popup menus to turn channel and query reformatting on and off individually.
  [/color]
menu status,channel,query {
  [color:#004400]
  ;  Main menu: Custom (Nick)
  [/color]
  Custom (Nick)
  [color:#004400]
  ;  Custom (Nick) Submenu: Channel
  [/color]
  .$iif($group(#Custom.Display.Channel) == on, $style(1)) Channel:{
    $iif($group(#Custom.Display.Channel) == on, .disable, .enable) #Custom.Display.Channel
  }
  [color:#004400]
  ;  Custom (Nick) Submenu: Query
  [/color]
  .$iif($group(#Custom.Display.Query) == on, $style(1)) Query:{
    $iif($group(#Custom.Display.Query) == on, .disable, .enable) #Custom.Display.Query
  }
  [color:#004400]
  ;  Custom (Nick) Submenu: Line separator
  [/color]
  .-
  [color:#004400]
  ;  Custom (Nick) Submenu: Both Channel and Query
  [/color]
  .$iif($group(#Custom.Display.Channel) == on, $style(1)) Both:{
    $iif($group(#Custom.Display.Channel) == on, .disable, .enable) #Custom.Display.*
  }
}

For an on TEXT event (which reacts to text someone else types in a query or channel window), you must use the ^ prefix to make the event fire before the normal event fires, thus allowing you to replace the default text (with <nick> blah) with whatever format you prefer. This doesn't apply to your own text because on INPUT fires right after you hit the enter key in the window (query or channel) and no text is echoed to the window until all on INPUT events have completed; therefore, the ^ is not needed.

The actual echo commands use several flags to try to make sure your global settings (Alt-O Options) will be followed even though this is a custom event. -m means that the message you're echoing is a user message as opposed to an event, like on JOIN. -bfl apply your beep/flash/highlight settings to the line being echoed. -r applies your strip settings to the message. -i indents the line 2 spaces, just like mIRC does by itself. -t includes a timestamp prior to the nick if you have timestamping turned on globally.

The $cnick() and $nick($chan, $nick).color identifiers are used to include the same colors you have set up in Alt-B / Nicks or /cnick. The .pnick prefaces nicks with their channel status character, if there is one.

The local identifier (not visible outside this script file) $pcnick(nick) checks to see if you have Alt-O (Options) / IRC / Show mode prefix checked. The local identifier $ShouldPrefixOwn checks to see if you have Alt-O / IRC / Prefix own messages checked.

Three popups are provided to manage the script, available in the Status Window, in any channel or in any query window. They are all grouped under a popup called Custom (Nick). Channel turns channel reformatting on and off, Query turns query reformatting on and off, and Both turns them both on and off (based on the current setting of the Channel reformatting). A check mark will appear beside each of them if they are enabled.

[EDIT: fixed the on INPUT events to actually send the target the text you typed.]

Last edited by Hammer; 02/03/03 12:45 PM.

DALnet: #HelpDesk and #m[color:#FF0000]IR[color:#EEEE00]C