|
Joined: Jan 2003
Posts: 66
Babel fish
|
OP
Babel fish
Joined: Jan 2003
Posts: 66 |
|
|
|
|
Joined: Jan 2003
Posts: 66
Babel fish
|
OP
Babel fish
Joined: Jan 2003
Posts: 66 |
one more quick question, doesn't deserve its own topic...
what's the identifier for the number of characters total in a string?
|
|
|
|
Anonymous
Unregistered
|
Anonymous
Unregistered
|
/aline -p @Window text In mIRC type /help /aline
Edit: $len() .. type /help $len
Last edited by r0ck; 15/05/03 06:28 PM.
|
|
|
|
Joined: Dec 2002
Posts: 3,138
Hoopy frood
|
Hoopy frood
Joined: Dec 2002
Posts: 3,138 |
|
|
|
|
Joined: Dec 2002
Posts: 2,809
Hoopy frood
|
Hoopy frood
Joined: Dec 2002
Posts: 2,809 |
$len(this is the string) = 18
|
|
|
|
Joined: Jan 2003
Posts: 66
Babel fish
|
OP
Babel fish
Joined: Jan 2003
Posts: 66 |
One more simple question (I'm really, really out of practice).
I've looked in the help again, but can't find it. How do you do mathematical operations?
|
|
|
|
Joined: Dec 2002
Posts: 2,809
Hoopy frood
|
Hoopy frood
Joined: Dec 2002
Posts: 2,809 |
$calc(2 + 2 / 4 * 2 ^ 2 -(3-2*6^2))
|
|
|
|
Joined: Jan 2003
Posts: 66
Babel fish
|
OP
Babel fish
Joined: Jan 2003
Posts: 66 |
Nevermind, I got that.
Next question, though...
Okay, right now I'm making a script where I want things lined up...
basically it's displaying $nick $channel $1- in an @window
but because different nicks and different channels are different lengths, it doesn't line up correctly
I tried using something like
$str($chr(32),$calc(15 - $len($nick)))
but it doesn't seem to make any difference
|
|
|
|
Joined: Jan 2003
Posts: 66
Babel fish
|
OP
Babel fish
Joined: Jan 2003
Posts: 66 |
also, how do I change the color of nicks in the nicklist?
|
|
|
|
Joined: Dec 2002
Posts: 2,809
Hoopy frood
|
Hoopy frood
Joined: Dec 2002
Posts: 2,809 |
|
|
|
|
Joined: Dec 2002
Posts: 1,922
Hoopy frood
|
Hoopy frood
Joined: Dec 2002
Posts: 1,922 |
For aligning, use this alias: alias align return $1 $+ $str($chr(160),$calc($2 - $len($1))) Like this: //echo -a $align(nick,10) $align(channel,10) text ($chr(160) is a "hard space", meaning mirc will not strip it out)
|
|
|
|
Joined: Feb 2003
Posts: 2,812
Hoopy frood
|
Hoopy frood
Joined: Feb 2003
Posts: 2,812 |
For aligning, try using $chr(9) - Tab key. It displays as a box character in channel windows, but in custom @windows it appears as a Tab (width of 5 spaces).
Type: /help /window With the -t switch, you can even specify Tab Positions you want to align each column up to.
- Raccoon
Well. At least I won lunch. Good philosophy, see good in bad, I like!
|
|
|
|
Joined: Jan 2003
Posts: 66
Babel fish
|
OP
Babel fish
Joined: Jan 2003
Posts: 66 |
Er, that -t bit threw me off.
How exactly does it work? Calling a window with -t doesn't seem to change anything...
Also, how can I keep things alligned if not using a font like fixedsys (all chars the same space)? I've seen it done in other scripts..
|
|
|
|
Joined: Dec 2002
Posts: 580
Fjord artisan
|
Fjord artisan
Joined: Dec 2002
Posts: 580 |
Nice Online, That is some good info, since mirc can't deal with double spaces.
|
|
|
|
Joined: Feb 2003
Posts: 2,812
Hoopy frood
|
Hoopy frood
Joined: Feb 2003
Posts: 2,812 |
__ Help File __ The -t switch used to set the tab positions in a listbox. t[N,...,N] = specifies the tab positions in a listbox, if text contains tabs it will be spaced out according to these tab settings. ___
/window -ex -t5,10,15,20 @window
The above creates a window with an editbox that is maximized, and has tabstops at average-character-width of 5 spaces, then 5 spaces after that, and 5 after that, and finally 5 after that.
//echo @window $+(hi,$chr(9),how,$chr(9),are,$chr(9),you,$chr(9),?)
The words will be spaced out into columns of matching and even width, no matter if the font is fixed or variable width.
Note that the -t switch is separated from the first set of switches. It also doesn't require a Listbox or ListWindow, but works in plain-old text @windows too.
- Raccoon
Well. At least I won lunch. Good philosophy, see good in bad, I like!
|
|
|
|
Joined: Dec 2002
Posts: 580
Fjord artisan
|
Fjord artisan
Joined: Dec 2002
Posts: 580 |
listbox's are in dialogs, not windows weirdo... ![smile smile](/images/graemlins/mirc/smile.gif) Don't feel bad I thought this once too...
|
|
|
|
Joined: Dec 2002
Posts: 699
Fjord artisan
|
Fjord artisan
Joined: Dec 2002
Posts: 699 |
From mirc.hlp Custom Windows ... Switches and Parameters ... l[N] = listbox, if N is specified then a side-listbox N characters wide is created
|
|
|
|
|