mIRC Home    About    Download    Register    News    Help

Print Thread
#24387 15/05/03 06:25 PM
Joined: Jan 2003
Posts: 66
M
maezr Offline OP
Babel fish
OP Offline
Babel fish
M
Joined: Jan 2003
Posts: 66
How can this be done?

Joined: Jan 2003
Posts: 66
M
maezr Offline OP
Babel fish
OP Offline
Babel fish
M
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?

A
Anonymous
Unregistered
Anonymous
Unregistered
A
/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
C
Hoopy frood
Offline
Hoopy frood
C
Joined: Dec 2002
Posts: 3,138
$len(string)

Joined: Dec 2002
Posts: 2,809
C
Hoopy frood
Offline
Hoopy frood
C
Joined: Dec 2002
Posts: 2,809
$len(this is the string) = 18

Joined: Jan 2003
Posts: 66
M
maezr Offline OP
Babel fish
OP Offline
Babel fish
M
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
C
Hoopy frood
Offline
Hoopy frood
C
Joined: Dec 2002
Posts: 2,809
$calc(2 + 2 / 4 * 2 ^ 2 -(3-2*6^2))

Joined: Jan 2003
Posts: 66
M
maezr Offline OP
Babel fish
OP Offline
Babel fish
M
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
M
maezr Offline OP
Babel fish
OP Offline
Babel fish
M
Joined: Jan 2003
Posts: 66
also, how do I change the color of nicks in the nicklist?

Joined: Dec 2002
Posts: 2,809
C
Hoopy frood
Offline
Hoopy frood
C
Joined: Dec 2002
Posts: 2,809
/cline

Joined: Dec 2002
Posts: 1,922
O
Hoopy frood
Offline
Hoopy frood
O
Joined: Dec 2002
Posts: 1,922
For aligning, use this alias:
Code:
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
Offline
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
M
maezr Offline OP
Babel fish
OP Offline
Babel fish
M
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
N
Fjord artisan
Offline
Fjord artisan
N
Joined: Dec 2002
Posts: 580
Nice Online, That is some good info, since mirc can't deal with double spaces. smile


NaquadaBomb
www.mirc-dll.com
#24401 17/05/03 01:34 PM
Joined: Feb 2003
Posts: 2,812
Hoopy frood
Offline
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!
#24402 23/05/03 11:44 AM
Joined: Dec 2002
Posts: 580
N
Fjord artisan
Offline
Fjord artisan
N
Joined: Dec 2002
Posts: 580
listbox's are in dialogs, not windows weirdo... smile

Don't feel bad I thought this once too...


NaquadaBomb
www.mirc-dll.com
#24403 24/05/03 02:52 AM
Joined: Dec 2002
Posts: 699
N
Fjord artisan
Offline
Fjord artisan
N
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


Link Copied to Clipboard