Back

Functions on function object #111.
Text alignment functions.
2align() 2col() 3align() align()
Text formatting? functions.
comma() inc2() dec2() textrain() textbounce()
DBref list filtering functions.
remdark() connplyrs()
connplyrs2()
splitcon() grabtype() grabowner() grabparent() grabname() grabflag()
Border functions
cust_bdr_tb() cust_bdr_m()
header_lr() header_c() header_l() header_r() header_n()
Misc Functions
width() dec2hex()
hex2dec()
isdbreflist()
isdbreflist2()

Text Alignment Functions

2align(TEXT1, WIDTH1, TEXT2, WIDTH2): Puts two columns next to each other, good for room parents. TEXT should be seperated with %r. I've recently altered it a bit to be more efficient when the second list is not provided, It'll simply display the first list as it was specified. WIDTH 1&2 should not add up to more than 79 or 82(some clients), while the function will still work, the output will wrap on most clients.

2col(WIDTH1, WIDTH2, TEXT): Splits a list into two columns. Basically splits it into two and runs it through 2align(). Text must be %r seperated. WIDTH1 + WIDTH2 shouldn't be more than 80.

3align(TEXT1, WIDTH1, TEXT2, WIDTH2, TEXT3, WIDTH3): Like 2align() but takes three columns. But it doesn't share the feature where a blank list won't be displayed, I might add that if it's requested.

align(WIDTHS,TEXT1,TEXT2,...TEXTN): Works like 2align() only it can take up to nine columns. WIDTHS is a space seperated lists of column widths which should be the same as the number of columns you specify. The justification of the columns may be changed by specifying 'l', 'c', or 'r' in front of the width. (Note: I was thinking of maybe making this function more like the align() in newer versions of pennMUSH, but it would up the number of function iterations, and potentially reduce the number of columns to 6.)

Text Formatting? functions.

comma(Num): Inserts commas in large numbers. Turning 1000 to 1,000. It supports decimals.

inc2(<Text>[,<Width>]): This is very much like the built-in inc(), but it right justifies the numbers at the end, to either the width of the original number ('test01' = '01' = 2), or the specified <WIDTH>. Note: It doesn't work with negative numbers currently, I may add that in the future if requested, but it would make it pretty complicated.

dec2(<Text>[,<Width>]): Like inc2() but like the built-in dec() instead. This doesn't support negative nums either.

textrain(<Text>[,<Sep>]): This is more for fun than for being useful, It takes text and makes each word vertical, if <Sep> is specified it uses it as the seperator instead of space.

textbounce(<Text>): This makes text wavey.

DBref list filtering functions.

remdark(<DBref List>): This takes a list of dbrefs and removes the ones that are @set DARK.

connplyrs(<DBref List>): This takes a list of player dbrefs and returns the ones that are connected.

splitcon(<DBref List>): Splits a contents list of dbrefs into players and things, and returns them respectively seperated with '|'. I recently updated this to use less invocations under most conditions, and I made another version which can return the lists in q-registers, call it with ufun(#111/F.SPLITCON,<List>,<qP>,<qT>) where <List> is the dbref list, <qP> is the q-register to put the players in, and <qT> is the q-register to put the things in. eg. ufun(#111/F.SPLITCON,#123 #456 #789,P,T)

grabtype(<DBref List>,<Type>): Grabs all dbrefs of a certain object type from a list. This uses a new technique I came up with, it should use fewer invocations than any other method, although it may cut off the end of extremely large dbref lists ie 8000+/- characters, lots of players/garbage may alter this. <Type> can be a wildcard, It can also be GARBAGE. It uses 2+3+3+<# dbrefs> invocations if you are interested. The old method used 2+3+2+(2*<# dbrefs>), so if you do the math, for 20 dbrefs, it would be 47 invocations vs. 28 with the new method.

grabowner(<DBref List>,<Owner Dbref>): Grabs all dbrefs owned by a certain player from a list.

grabparent(<DBref List>,<Parent Dbref>): Grabs all dbrefs with a certain parent from a list.

grabname(<DBref List>,<Name>): Grabs all dbrefs with a matching name, this one is more limited than the others because of long name lengths.

grabflag(<DBref List>,<Flag>[,<Not>]): Grabs all dbrefs with the flag. If <Not> is true then it searches for objects /without/ the flag.

Border Functions

cust_bdr_tb([<Color>[,<width>[,<topmiddle>[,<Topcorner1>[,<Topcorner2>]]]]]): Draw a custom border. If <width> is <0 then it'll try to use width() on %#.

cust_bdr_m(<Text>[,<Color>[,<Width>[,<Border1>[,<Border2>[,<Align>]]]]]): This is designed to be used with cust_bdr_tb(), it puts borders on each side of text.
Example: th [cust_bdr_tb(ch,79,c(196),c(218),c(191))]%r[cust_bdr_m(hello,ch,79,[c(179)])]%r[cust_bdr_tb(ch,79,c(196),c(192),c(217))]

I have also installed versions of Sholevi's header functions, and my own optimizations of them. To try the original versions, prepend orig_ to the beginning of the function name.

header_lr(Title1,Title2,Length,Fill,Fill Color,Title Color,Bracket Color,Left Bracket,Right Bracket): This returns a line with Title1 in the left of the line, and Title2 in the right. Width is the only really necessary argument, you may leave the Title arguments null. Fill is the character(s) to make the line out of.

header_c(Title,Length,Fill,Fill Color,Title Color,Bracket Color,Left Bracket,Right Bracket): This returns a line with Title1 in the center. Width is the only really necessary argument, you may leave the Title arguments null. Fill is the character(s) to make the line out of.

header_l(Title,Length,Fill,Fill Color,Title Color,Bracket Color,Left Bracket,Right Bracket): This returns a line with Title in the left of the line. Width is the only really necessary argument, you may leave the Title arguments null. Fill is the character(s) to make the line out of.

header_r(Title,Length,Fill,Fill Color,Title Color,Bracket Color,Left Bracket,Right Bracket): This returns a line with Title in the right of the line. Width is the only really necessary argument, you may leave the Title arguments null. Fill is the character(s) to make the line out of.

header_n(Length,Fill Color,Fill): This returns a line. Width is the only really necessary argument. Fill is the character(s) to make the line out of.



Misc Functions

width(<DBref>): Returns the width of the screen of the players client. This is @set by &CLIENTWIDTH me=<Width> and @set me/CLIENTWIDTH=visual. All this basically is is default(%0/CLIENTWIDTH,80) you may wish to use that in your code, because I don't know if this function works if I'm darted.

dec2hex(<Decimal Number>)
hex2dec(<Hex Number>)

These functions convert between base-10 and base-16 numbers.

isdbreflist(<DBref List>): This checks the characters that make up <DBref List> to determine if it's made of dbrefs.
isdbreflist2(<DBref List>): This checks each element to make sure they're dbrefs.



Back