mIRC Home    About    Download    Register    News    Help

Print Thread
Built-in way to change the nick bookends (<>)? #224910 21/08/10 06:38 PM
Joined: Dec 2002
Posts: 35
C
Chris233 Offline OP
Ameglian cow
OP Offline
Ameglian cow
C
Joined: Dec 2002
Posts: 35
(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.

Last edited by Chris233; 21/08/10 06:38 PM.
Re: Built-in way to change the nick bookends (<>)? [Re: Chris233] #224915 21/08/10 08:04 PM
Joined: Feb 2003
Posts: 3,432
S
sparta Offline
Hoopy frood
Offline
Hoopy frood
S
Joined: Feb 2003
Posts: 3,432
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.


if ($me != tired) { return } | else { echo -a Get a pot of coffee now $+($me,.) }
Re: Built-in way to change the nick bookends (<>)? [Re: sparta] #224916 21/08/10 08:11 PM
Joined: Dec 2002
Posts: 35
C
Chris233 Offline OP
Ameglian cow
OP Offline
Ameglian cow
C
Joined: Dec 2002
Posts: 35
Then I run into the infamous problem mIRC has with stripping sequential spaces. Or is that better in 7.1?

Re: Built-in way to change the nick bookends (<>)? [Re: Chris233] #224918 21/08/10 09:47 PM
Joined: Feb 2003
Posts: 3,432
S
sparta Offline
Hoopy frood
Offline
Hoopy frood
S
Joined: Feb 2003
Posts: 3,432
dont know, never tested. Try and see..


if ($me != tired) { return } | else { echo -a Get a pot of coffee now $+($me,.) }
Re: Built-in way to change the nick bookends (<>)? [Re: sparta] #224919 21/08/10 10:09 PM
Joined: Nov 2009
Posts: 295
P
pball Offline
Fjord artisan
Offline
Fjord artisan
P
Joined: Nov 2009
Posts: 295
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


http://scripting.pball.win
My personal site with some scripts I've released.
Re: Built-in way to change the nick bookends (<>)? [Re: pball] #224920 21/08/10 10:20 PM
Joined: Dec 2002
Posts: 35
C
Chris233 Offline OP
Ameglian cow
OP Offline
Ameglian cow
C
Joined: Dec 2002
Posts: 35
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.

Last edited by Chris233; 21/08/10 10:50 PM.
Re: Built-in way to change the nick bookends (<>)? [Re: Chris233] #224943 22/08/10 01:23 PM
Joined: Oct 2004
Posts: 8,327
Riamus2 Offline
Hoopy frood
Offline
Hoopy frood
Joined: Oct 2004
Posts: 8,327
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.


Invision Support
#Invision on irc.irchighway.net
Re: Built-in way to change the nick bookends (<>)? [Re: Riamus2] #225067 24/08/10 10:34 PM
Joined: Aug 2010
Posts: 134
T
Thels Offline
Vogon poet
Offline
Vogon poet
T
Joined: Aug 2010
Posts: 134
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.)


Learning something new every day.