mIRC Home    About    Download    Register    News    Help

Print Thread
Joined: Aug 2004
Posts: 4
B
btc Offline OP
Self-satisified door
OP Offline
Self-satisified door
B
Joined: Aug 2004
Posts: 4
Hey, there. I'm starting to really get into customizing my IRC client. One of the things I think I will never be able to script is the following feature, so I'll request it here.

This would go under the Display>Options>Line Options box as "First-line Hanging". When enabled, it would look something like this:

Code:
<btc>  This is a long line of text that I'd like to
       see tucked under parallel with the username.


Though I'm not a programmer, I can foresee some of the difficulties in coding this (variable nick lengths, variable width fonts), so you could code it to hang the text at a certain pixel distance from the left side of the window. This is a step in the right direction, but doesn't quite achieve what I'm after.

That said, this option would also have to include some manner of mandatory username length/truncation. (So the username displayed is always exactly this many characters wide.) This still doesn't solve the variable width font, and this is a very specific cosmetic request that I'd like to have.

Code:
<     btc> This is a line of text.  It will carry
           over to the next line.
<JuliusCe> hey



OK, so all of *that* said, I did get another idea while writing this message. I wonder if it actually is possible to script this. The effect I want is seen above (it's basically like the old pirch display, I think). I will be using a fixed-width font, so if I can determine how many characters fit on one full line displayed in the window, I could make a script to parse the line into a new line for this many number of characters. Say a window holds 50 characters from left to right (including the timestamp and the nickname). If the incoming line of text is 223 characters, the script would first add "[xx:xx] <xxxxxxxx> " which is 19 characters, so it would display 31 more on this line, then echo a new line preceeded by 19 blanks, and then 31 more characters.

Another revelation as I type this... this will cut off words. bleh. See, this is why it would neat to get something like it hard-coded. -_-;

Anyway, if this inspires anymore ideas, let me know.

BTC

Joined: Dec 2002
Posts: 788
C
Hoopy frood
Offline
Hoopy frood
C
Joined: Dec 2002
Posts: 788
Is what your talking about 'Justification' ?

If, so you can use something like;

alias just {
; /just nick #chan text
var %d = $calc(83 - ($len($1) + 4))
var %l = $len($3-)
var %i = 1
while (%l >= %i) {
echo -mbflirtc normal $2 < $+ $1 $+ > $mid($3-,%i,%d)
inc %i %d
}
}

/just nickname #channel text

Placed inside an 'On Text' would justify peoples text and halt mIRCs.
i.e.

On ^*:text:*:#:{
just $nick $chan $1-
haltdef
}


Eamonn.

Joined: Dec 2002
Posts: 2,962
S
Hoopy frood
Offline
Hoopy frood
S
Joined: Dec 2002
Posts: 2,962
That just wraps text at some arbitrary line length and won't account for changes in listbox size or window size, which is what he's looking for.

It can be scripted using something like echo -mbflrti $+ $len($+(<,$nick,>)) $target $+(<,$nick,>) $1- however it doesn't work exactly right since the width of -iN characters won't correctly match the width of the characters used in the <nickname> format on a variable width font. Also the code I've pasted doesn't take into account the width of the timestamp, but that's a big headache of code to write so I left it out.

All things considered, a built-in option is the only way to do this practically.


Spelling mistakes, grammatical errors, and stupid comments are intentional.
Joined: Dec 2002
Posts: 788
C
Hoopy frood
Offline
Hoopy frood
C
Joined: Dec 2002
Posts: 788
Yeah wasnt exactly 100% sure of what exactly he was looking for and yeah, a built in option would be a practical alternative.

Eamonn.

Joined: Apr 2003
Posts: 426
Fjord artisan
Offline
Fjord artisan
Joined: Apr 2003
Posts: 426
So why not use echo -i $+ $calc($len($timestamp) + $len($+(<,$nick,>)))?

Anyway, it doesn't matter for much, as far as I can remember, echo -iN has still got a hardset number of characters it can indent to.

Like you say, a built in option is the way to go.


--------
mIRC - fun for all the family (except grandma and grandpa)
Joined: Dec 2002
Posts: 2,962
S
Hoopy frood
Offline
Hoopy frood
S
Joined: Dec 2002
Posts: 2,962
Forgot about $timestamp. Anyway, you'd need to add 2 to that $calc() for the space between the the timestamp and nick, and between the nick and the text.


Spelling mistakes, grammatical errors, and stupid comments are intentional.
Joined: Apr 2003
Posts: 426
Fjord artisan
Offline
Fjord artisan
Joined: Apr 2003
Posts: 426
Yeah you would smile


--------
mIRC - fun for all the family (except grandma and grandpa)

Link Copied to Clipboard