mIRC Home    About    Download    Register    News    Help

Print Thread
Page 1 of 2 1 2
#230620 15/03/11 10:08 PM
Joined: Mar 2011
Posts: 7
T
Nutrimatic drinks dispenser
OP Offline
Nutrimatic drinks dispenser
T
Joined: Mar 2011
Posts: 7
Hi!

I don't have any knowledge of scripting in mIRC, but I'm looking for a way to create or add a gap between the nicknames and the actual message in the channel and chat windows. I do not want any other function than just creating a that margin/gap. I was unable to find an option for this in mIRC and couldn't find any help googling this either.

I would really appreciate if anyone has or could create a simple script or a guide telling me how to do this!

- seppo

Joined: Jan 2007
Posts: 1,156
D
Hoopy frood
Offline
Hoopy frood
D
Joined: Jan 2007
Posts: 1,156
Only way I know how to do this is to make your window listview and use tabs.

/help /window

Otherwise you can use blank spaces, like $chr(160).

Joined: Aug 2004
Posts: 7,252
R
Hoopy frood
Offline
Hoopy frood
R
Joined: Aug 2004
Posts: 7,252
If I'm understanding you correctly, what you are asking about has been requested as a feature, but, as of 7.19, it does not yet exist in mIRC.

Thus your options are to use a faked spacing. $chr(160) was suggested, but a space character wrapped with bold, underline, or reverse characters will also work.
Using a custom window (see /window for more information) was also suggested.
Another alternative that might work is the usage of spaces.dll (sorry, don't recall where it is off hand, but a Google search for it should bring back results).

Joined: Mar 2011
Posts: 7
T
Nutrimatic drinks dispenser
OP Offline
Nutrimatic drinks dispenser
T
Joined: Mar 2011
Posts: 7

The top is what IRC looks like. I would somehow like to add a margin which puts all the messages in-line and with a gap from the users nicknames. Like the bottom of the image!

Hope this helpes explain what I'm trying to do!

Joined: Jan 2007
Posts: 1,156
D
Hoopy frood
Offline
Hoopy frood
D
Joined: Jan 2007
Posts: 1,156
I'm guessing that script used blank spaces like we said, but calculated how many blank spaces it needed in each line based on the length of the nickname.

Joined: Aug 2004
Posts: 7,252
R
Hoopy frood
Offline
Hoopy frood
R
Joined: Aug 2004
Posts: 7,252

Joined: Mar 2011
Posts: 7
T
Nutrimatic drinks dispenser
OP Offline
Nutrimatic drinks dispenser
T
Joined: Mar 2011
Posts: 7
Well actually the image was just edited in photoshop by me! But I'm looking for a way to do that!

Joined: Sep 2005
Posts: 2,881
H
Hoopy frood
Offline
Hoopy frood
H
Joined: Sep 2005
Posts: 2,881
Code:
alias -l defaultnicklen { return 12 }
alias -l numspaces { return $calc(($iif(%nicklen. [ $+ [ $network ] ],$v1,$defaultnicklen) + 3) - $len($1)) }
alias -l spacechar { return $chr(160) }

raw 005:*:{
  if ($wildtok($1-,nicklen=*,1,32) != $null) { set %nicklen. $+ $network $gettok($v1,2,61) }
}

on ^*:text:*:*:{
  var %outputnick = $+(<,$iif($chan && $left($nick($chan,$nick).pnick,1) isin $prefix,$v1),$nick,>)
  echo -bcfilmrt normal $iif($chan,$chan,$nick) %outputnick $+ $str($spacechar,$numspaces(%outputnick)) $1-
  haltdef
}

on *:input:*:{
  if ($istok(channel chat query,$window($active).type,32)) && (!$inpaste) && ((!$istok(/ $readini($mircini,text,commandchar),$left($1,1),32)) || ($ctrlenter)) {
    var %outputnick = $+(<,$iif($chan && $left($nick($chan,$me).pnick,1) isin $prefix,$v1),$me,>)
    .msg $active $1-
    echo -bcfilmrt $+ $iif(!$chan,a) normal $iif($chan,$chan) %outputnick $+ $str($spacechar,$numspaces(%outputnick)) $1-
    haltdef
  }
}


Change the defaultnicklen alias if you wish. That is just there so that the script doesn't mess up when the server doesn't respond with a "nicklen=<len>" setting in the raw 005 token. I've set it to 12 as that seems to be the nickname length on most servers I frequent.

Joined: Jul 2007
Posts: 1,129
T
Hoopy frood
Offline
Hoopy frood
T
Joined: Jul 2007
Posts: 1,129
Well, $chr(160) is considered a fake space and may not work for some fonts.

Joined: Sep 2005
Posts: 2,881
H
Hoopy frood
Offline
Hoopy frood
H
Joined: Sep 2005
Posts: 2,881
I was under the impression that now that mIRC supports unicode this will be seen as a non-breaking space with all fonts.

Do you know a font it will display differently with?

Joined: Mar 2011
Posts: 7
T
Nutrimatic drinks dispenser
OP Offline
Nutrimatic drinks dispenser
T
Joined: Mar 2011
Posts: 7
Originally Posted By: hixxy
Code:
alias -l defaultnicklen { return 12 }
alias -l numspaces { return $calc(($iif(%nicklen. [ $+ [ $network ] ],$v1,$defaultnicklen) + 3) - $len($1)) }
alias -l spacechar { return $chr(160) }

raw 005:*:{
  if ($wildtok($1-,nicklen=*,1,32) != $null) { set %nicklen. $+ $network $gettok($v1,2,61) }
}

on ^*:text:*:*:{
  var %outputnick = $+(<,$iif($chan && $left($nick($chan,$nick).pnick,1) isin $prefix,$v1),$nick,>)
  echo -bcfilmrt normal $iif($chan,$chan,$nick) %outputnick $+ $str($spacechar,$numspaces(%outputnick)) $1-
  haltdef
}

on *:input:*:{
  if ($istok(channel chat query,$window($active).type,32)) && (!$inpaste) && ((!$istok(/ $readini($mircini,text,commandchar),$left($1,1),32)) || ($ctrlenter)) {
    var %outputnick = $+(<,$iif($chan && $left($nick($chan,$me).pnick,1) isin $prefix,$v1),$me,>)
    .msg $active $1-
    echo -bcfilmrt $+ $iif(!$chan,a) normal $iif($chan,$chan) %outputnick $+ $str($spacechar,$numspaces(%outputnick)) $1-
    haltdef
  }
}


Change the defaultnicklen alias if you wish. That is just there so that the script doesn't mess up when the server doesn't respond with a "nicklen=<len>" setting in the raw 005 token. I've set it to 12 as that seems to be the nickname length on most servers I frequent.


This worked, but I need to create a bigger space between the nicknames and the messages. Another problem is that the colours from my address book don't work when this script is active!

Joined: Oct 2004
Posts: 8,330
Hoopy frood
Offline
Hoopy frood
Joined: Oct 2004
Posts: 8,330
A quick glance seems to indicate that the +3 in the numspaces alias is where you can adjust the number of spaces beyond the max nick length for the server. 3 seems like a good number to me without testing it. Even if someone has the largest nick allowed on the server, you'll still have 3 extra spaces before the text starts. But feel free to edit it.

I'm not sure about the address book coloring right now and don't have time for more than just a quick glance right now. That shouldn't be too hard to add.

@Tomao: As long as the script is used with mIRC 7.x, $chr(160) should be a legitimate "space" character in any font. If it's used on older versions of mIRC, then it depends on the font.

@hixxy: I don't have time before I leave work to really look at this, but I don't see right off hand where it pays attention to the font. Fixed width should be fine, but if the font is variable width, will this always be lined up? It might be in there or may not matter. I can't stick around to examine it further.

Last edited by Riamus2; 16/03/11 08:22 PM.

Invision Support
#Invision on irc.irchighway.net
Joined: Sep 2005
Posts: 2,881
H
Hoopy frood
Offline
Hoopy frood
H
Joined: Sep 2005
Posts: 2,881
Riamus is correct about the + 3 section of the code. +3 in the code counts the "<", ">" and space characters when considering how to align the text. + 3 therefore only adds one space past the maximum length for the server. If you increase this to something like +7 you will get a wider gap (5 spaces).

Here is the new script with all of your concerns addressed:

Code:
alias -l defaultnicklen { return 12 }
alias -l numspaces { return $calc(($iif(%nicklen. [ $+ [ $network ] ],$v1,$defaultnicklen) + 7) - $len($1)) }
alias -l spacechar { return $chr(160) }

raw 005:*:{
  if ($wildtok($1-,nicklen=*,1,32) != $null) { set %nicklen. $+ $network $gettok($v1,2,61) }
}

on ^*:text:*:*:{
  var %outputnick = $+(<,$iif($chan && $left($nick($chan,$nick).pnick,1) isin $prefix,$v1),$nick,>), $&
    %colouredoutputnick = $+(<,$chr(3),$cnick($nick).colour,$iif($chan && $left($nick($chan,$nick).pnick,1) isin $prefix,$v1),$nick,$chr(3),$colour(normal text),>)
  echo -bfilmrt $iif($chan,$chan,$nick) %colouredoutputnick $+ $str($spacechar,$numspaces(%outputnick)) $1-
  haltdef
}

on *:input:*:{
  if ($istok(channel chat query,$window($active).type,32)) && (!$inpaste) && ((!$istok(/ $readini($mircini,text,commandchar),$left($1,1),32)) || ($ctrlenter)) {
    var %outputnick = $+(<,$iif($chan && $left($nick($chan,$me).pnick,1) isin $prefix,$v1),$me,>)
    .msg $active $1-
    echo -bcfimrt $+ $iif(!$chan,a) $iif($chan,$chan) %outputnick $+ $str($spacechar,$numspaces(%outputnick)) $1-
    haltdef
  }
}


Now supports the Abook too smile

Edit:

Riamus,

This will not align in variable width fonts. I'm not sure there's much we can do within the constraints of mIRC to align text correctly in a variable width font, aside from creating our own implementation of the channel windows using picture windows which is of course overkill.

Last edited by hixxy; 16/03/11 09:47 PM.
Joined: Mar 2011
Posts: 7
T
Nutrimatic drinks dispenser
OP Offline
Nutrimatic drinks dispenser
T
Joined: Mar 2011
Posts: 7
Originally Posted By: hixxy

Here is the new script with all of your concerns addressed:

Code:
alias -l defaultnicklen { return 12 }
alias -l numspaces { return $calc(($iif(%nicklen. [ $+ [ $network ] ],$v1,$defaultnicklen) + 7) - $len($1)) }
alias -l spacechar { return $chr(160) }

raw 005:*:{
  if ($wildtok($1-,nicklen=*,1,32) != $null) { set %nicklen. $+ $network $gettok($v1,2,61) }
}

on ^*:text:*:*:{
  var %outputnick = $+(<,$iif($chan && $left($nick($chan,$nick).pnick,1) isin $prefix,$v1),$nick,>), $&
    %colouredoutputnick = $+(<,$chr(3),$cnick($nick).colour,$iif($chan && $left($nick($chan,$nick).pnick,1) isin $prefix,$v1),$nick,$chr(3),$colour(normal text),>)
  echo -bfilmrt $iif($chan,$chan,$nick) %colouredoutputnick $+ $str($spacechar,$numspaces(%outputnick)) $1-
  haltdef
}

on *:input:*:{
  if ($istok(channel chat query,$window($active).type,32)) && (!$inpaste) && ((!$istok(/ $readini($mircini,text,commandchar),$left($1,1),32)) || ($ctrlenter)) {
    var %outputnick = $+(<,$iif($chan && $left($nick($chan,$me).pnick,1) isin $prefix,$v1),$me,>)
    .msg $active $1-
    echo -bcfimrt $+ $iif(!$chan,a) $iif($chan,$chan) %outputnick $+ $str($spacechar,$numspaces(%outputnick)) $1-
    haltdef
  }
}


Now supports the Abook too smile


+ credz for quick and good help! smile Really appreciate it!
However the $me colour still doesn't work from the abook(all the other colours work) and the text isn't inline with any of the fonts I've tried. Is there any change you could do to get those last 2 issues fixed?
I'm using the "Segoe UI"-font size 10, but if it's easier for you, I'm happy using "Trebuchet MS" or "Tahoma" size 10. Don't know if that helps you in any way.

Joined: Sep 2005
Posts: 2,881
H
Hoopy frood
Offline
Hoopy frood
H
Joined: Sep 2005
Posts: 2,881
Those fonts are variable-width fonts. It's not possible to align text within the constraints of mIRC using those fonts (unless I'm missing something).

You need to use a fixed-width font such as fixedsys, courier, courier new, lucida console, consolas.

Here's an updated script which colours your own nick too:

Code:
alias -l defaultnicklen { return 12 }
alias -l numspaces { return $calc(($iif(%nicklen. [ $+ [ $network ] ],$v1,$defaultnicklen) + 7) - $len($1)) }
alias -l spacechar { return $chr(160) }

raw 005:*:{
  if ($wildtok($1-,nicklen=*,1,32) != $null) { set %nicklen. $+ $network $gettok($v1,2,61) }
}

on ^*:text:*:*:{
  var %outputnick = $+(<,$iif($chan && $left($nick($chan,$nick).pnick,1) isin $prefix,$v1),$nick,>), $&
    %colouredoutputnick = $+(<,$chr(3),$cnick($nick).colour,$iif($chan && $left($nick($chan,$nick).pnick,1) isin $prefix,$v1),$nick,$chr(3),$colour(normal text),>)
  echo -bfilmrt $iif($chan,$chan,$nick) %colouredoutputnick $+ $str($spacechar,$numspaces(%outputnick)) $1-
  haltdef
}

on *:input:*:{
  if ($istok(channel chat query,$window($active).type,32)) && (!$inpaste) && ((!$istok(/ $readini($mircini,text,commandchar),$left($1,1),32)) || ($ctrlenter)) {
    var %outputnick = $+(<,$iif($chan && $left($nick($chan,$me).pnick,1) isin $prefix,$v1),$me,>), $&
      %colouredoutputnick = $+(<,$chr(3),$cnick($me).colour,$iif($chan && $left($nick($chan,$me).pnick,1) isin $prefix,$v1),$me,$chr(3),$colour(own text),>)
    .msg $active $1-
    echo -bcfimrt $+ $iif(!$chan,a) "own text" $iif($chan,$chan) %colouredoutputnick $+ $str($spacechar,$numspaces(%outputnick)) $1-
    haltdef
  }
}

Joined: Mar 2011
Posts: 7
T
Nutrimatic drinks dispenser
OP Offline
Nutrimatic drinks dispenser
T
Joined: Mar 2011
Posts: 7
I'm hoping for a update which supports tabstops. That'll probably make it possible with any font?
anyway, thanks alot!! all of u who helped!

Last edited by theseppo; 17/03/11 12:08 PM.
Joined: Jan 2007
Posts: 1,156
D
Hoopy frood
Offline
Hoopy frood
D
Joined: Jan 2007
Posts: 1,156
Then use listview. Did you explore the options I told you about?

Joined: Sep 2005
Posts: 2,881
H
Hoopy frood
Offline
Hoopy frood
H
Joined: Sep 2005
Posts: 2,881
What do you mean by "use listview" -- you can't alter the channel window and add tabstops to the channel window.

Are you walking about re-creating channel windows using @windows? If so, that seems like overkill!

Joined: Jan 2007
Posts: 1,156
D
Hoopy frood
Offline
Hoopy frood
D
Joined: Jan 2007
Posts: 1,156
How do you make columns in a regular channel window?

Joined: Sep 2005
Posts: 2,881
H
Hoopy frood
Offline
Hoopy frood
H
Joined: Sep 2005
Posts: 2,881
You can't, you can only simulate them like I have done above.

Page 1 of 2 1 2

Link Copied to Clipboard