mIRC Homepage
(Is there a better term than "bookend"?)

I'd like to change the <>s around nicknames and color them too. Is there a builtin way to do this? I've looked through the options and can't find one.
You need to make a script for that..
Code:
on ^*:text:*:#: {
  haltdef
  echo -a $+(4<,$nick,4>) $1-
}

on *:input:#: {
  haltdef
  echo -a $+(4<,$me,4>) $1-
  .msg $chan $1-
}

And this goes to your remote. ALT + R in mirc.
Then I run into the infamous problem mIRC has with stripping sequential spaces. Or is that better in 7.1?
dont know, never tested. Try and see..
I don't think you want to use echo -a, that will echo everything from every chan into the active window. I have my own little line that echos a custom line out, granted it appears exactly as any other line appears (it's part of my nick highlight script).

Code:
on text
echo $color(normal) -m $chan $timestamp $+(<,,$nick($chan,$nick).color,$iif($left($nick($chan,$nick).pnick,1) isin ~&@%+,$v1),$nick,,>) $1-

on action
echo $color(action) -m $chan $timestamp $+(*,$chr(32),$iif($left($nick($chan,$nick).pnick,1) isin ~&@%+,$v1),$nick) $1-

that isn't quite as simple but it will reproduce a line in a chan exactly as it should appear other wise. The line color will be what is set in the color options, ~&@%+ modes will shown on nicks, the nick color will be as set in the address book, uh I think that is all. I also included the on action in case you want to change the * to something else.

Just change < and > to whatever you want in that line up there
Nice oneliner pball, thanks. But it seems 7.1 does still lose extra spaces. I wish it would stop that.. I'll have to look up spaces.dll again, or do some more research for ways around it.

Edit: Get spaces.dll from http://www.xise.nl/mirc/ and place it in $mircdir, then add the following to a script (I did to a new one named display.mrc):
Code:
on ^*:text:*:#: {
  if (($exists(spaces.dll)) && ($dll(spaces.dll, loaded, ) == 1)) {
; the following line splits $rawmsg (which still includes all spaces)
; on the first occurance of the string " :" - after which the message
; will be.  Before which is the source, target, etc.
; I can't split on the second ":" because IPv6 addresses that don't rev-DNS have lots of :s.
    var %msg = $mid($rawmsg,$calc($pos($rawmsg,$+($chr(32),:),1)+2),2048)
    $dll(spaces.dll, echo, $color(normal) -m $chan $timestamp $+(,$nick($chan,$nick).color,<,,$iif($left($nick($chan,$nick).pnick,1) isin ~&@%!+,$v1),$chr(32),$nick,,$nick($chan,$nick).color,>,) %msg)
  }
  else {
    echo $color(normal) -m $chan $timestamp $+(,$nick($chan,$nick).color,<,,$iif($left($nick($chan,$nick).pnick,1) isin ~&@%!+,$v1),$chr(32),$nick,,$nick($chan,$nick).color,>,) $1-
  }
  haltdef
}

on *:INPUT:#:{
  if ((/* iswm $1) && (!$ctrlenter)) { return }
  if (($exists(spaces.dll)) && ($dll(spaces.dll, loaded, ) == 1)) {
    var %input = $dll(spaces.dll, input, )
    $dll(spaces.dll, send, PRIVMSG $target : $+ %input)
    $dll(spaces.dll, echo, -m $chan $timestamp $+(,$nick($chan,$me).color,<,,$iif($left($nick($chan,$me).pnick,1) isin ~&@%!+,$v1),$chr(32),$nick,,$nick($chan,$me).color,>,) %input)
  }
  else {
    PRIVMSG $target $1-
    echo -m $chan $timestamp $+(,$nick($chan,$me).color,<,,$iif($left($nick($chan,$me).pnick,1) isin ~&@%!+,$v1),$chr(32),$nick,,$nick($chan,$me).color,>,) $1-
  }
  haltdef
}

The above will use spaces.dll if it finds it or fall back to regular mIRC if it doesn't (and you'll lose consecutive spaces). spaces.dll must be in your $mircdir.
Keep in mind that if you want the flash/beep/highlight to work on messages, you want to add those switches to /echo as well.
Originally Posted By: Chris233
Then I run into the infamous problem mIRC has with stripping sequential spaces. Or is that better in 7.1?


At least in 7.1 you can replace all spaces by non breaking spaces and will be sure they look correctly to yourself. Since you're only echoing the lines, and not sending the lines to other users that might be running a non-unicode client, you should be able to replace $chr(32) regular spaces by $chr(160) nonbreaking spaces.

Code:
on $^*:text:/(.*)/:#: echo $chan $+(<, $nick, >) $replace($regml(1), $chr(32), $chr(160))


This should work without requiring external .dll files. (See the other examples to retain mode prefix and nick color.)
© mIRC Discussion Forums