by AZ0123
Basic procs and functions for inclusion in larger projects.

[Dec|12|2005 Update:]

Removed az_uhear() after discovering the ohearers() proc was already in the language. You learn something new everyday, thanks Destroy!


Currently contains the following definitions:

/**** Constants ****/

Defines the number of ticks in a given measure of time
az_SEC - 10 ticks
az_MIN - 60 seconds
az_HOUR - 60 minutes
az_DAY - 24 hours
az_WEEK - 7 days
az_MONTH - 30 days
az_YEAR - 365 days

/**** List Husbandry ****/
az_Olist(List) - Cleanly Opens a List

az_Clist(List) - Safely Closes a List

az_Alist(List, Item) - Adds an Item to the List, uses az_Olist() if needed

az_Rliast(List, Item) - Removes an Item from the List, uses az_Clist() if needed

az_islist(List) - returns TRUE if List is a list, else returns FALSE

az_neighbors(X, Y, Z, Range) - returns a list of immediate neighboring turfs to the x,y,z location in range of r excluding the turf at the specified x,y,z location

az_corral(Value, Min, Max) - returns Value or nearest: Min or Max

az_childtypes(Type) - returns only the children of the type

az_oscrview(Range, Center) - an oview() proc for the client screen (client proc)

az_get_scrdir(Loc1, Loc2) - a get_dir() proc for the client screen

az_resolve_loc(Loc) - turns a screen_loc into a list holding the location's X and Y coordinates on the client screen along with the pixel offsets for both axises

az_words2list(Text, Seperator) - converts an ordered text string into a list by spliting the string at each seperator

az_list2words(words, seperator) - converts a list into an ordered text string with each element divided by a seperator

az_text2list(Text) - Converts a text string to a list of its characters

az_remove_duplicates(var/list/List) - Removes duplicate entries from a list, but does not take list associations into account, only items or values in the index of the list (may change in future versions)

az_invert_list(List) - Inverts the contents of a list by swapping positions

az_first_char(Text) - returns the first character of a text string

az_hex2dec(Text) - Converts a text hexidecimal value into a decimal number
ie: will convert "f" to 15, "Cc" to 204 and "400" to 1024

az_rgb2list(Text) - Converts an RGB hexidecimal text string into a list of numbers corasponding to the colors:
ie "r"=204, "g"=102, "b"=51

Will be adding more soon....