
More information available at www.teknap.com

Environment Variables.

Each of these can be exported before running BXnap.
	NAPNICK your default nick
	NAPPASS your default pass
	NAPSERVER a server list
	NAPPORT the metaserver port to use.

the serverlist is in the following format.

	servername:port:nick:password:usemeta

	opennap.fortyoz.org::blah:hrm:1

	opennap.fortyoz.org:8888:blah:hrm

Upon startup a ~/.teknaprc is search for and loaded. Within that file you can
have various commands..
	ex.
	server +add server.name:port:nick:password:meta


TekNap [flags] [server] [nickname]

	-N		do not autoconnect to a server
	-r filename	load filename list of server.
	-a		add servers, to not overwrite.
	-n		nickname to use
	-p		password to use [not advisable to use this]
	-C		create user account.


I'd like to thank all those that have contributed time and code to the TekNap
project. Some of this code is taken from BitchX/epic irc clients.

~~~~~~~~~~~~~ Various Commands ~~~~~~~~~~~~~~~~

ADMIN <command> [args]
	Various adminstration commands.

BIND <key> <command>
	bind your keys to something else

BROWSE <nick>
	browse nick for files

CLEAR [-all|-unhold|-scrollback]
	clear a window

CLOSE [servernum]
	close current server. Or specified server.

DELETE <#|*|range>
	Delete transfer with #. * will delete all transfers. A range can be
	specified. 

DF
	Display disk usage

DISCONNECT
	see close.

EVAL
	evaluate a function. This is incomplete.

EXEC [-OUT|-NAME arg|-WINDOW|-MSG nick|-LINE {commands}|-LINEPART {command}|
	-ERRORPART {command}|-END {command}|-CLOSE index|-START|-IN text|
	-DIRECT|-num %process| <command>]

GET [[-browse|-request] args]
	Will attempt to get a file after a /search or /browse is performed.
	Args can be a range of numbers to get.

GLIST
	Display your download/uploads

HISTORY [-clear|#]
	Your command history buffer.

HOTLIST [nick|-nick]
	With no args, display the hotlist.
	nick will be added to your hotlist.
	-nick will remove from your hotlist.

IGNORE [nick|-nick]
	Display the ignore list or add nick to your ignore list or -nick is
	removed.	

JOIN <channel>
	Join to a napster channel.

L [channel]
	Will part from a channel. If no channel is specified your current
	channel is parted.

LASTLOG [-MAX|-LITERAL text|-REVERSE|-TIME|-BEEP|-CLEAR|-APPEND|-FILE name|
	-MORE|-<LEVEL> pattern]
	Displays the lastlog buffer.

LEAVE [channel]
	Will part from a channel. If no channel is specified your current
	channel is parted.

LIST
	Will display all channels available to join.

LOAD <script>
	Load's a script. This is almost like a irc script.

LS [options] [pattern/dir]
	alias for the ls command.

M <nick> <text>
	Sends a msg to nick. Multiple nicks can be specified as well as
	channels using ,'s to separate them.

ME <args>
	send's a me to the current channel.

MOTD
	displays the MOTD of the server. This depends on the value of /set
	SUPPRESS_SERVER_MOTD

MSG <nick> <text>
	Sends a msg to nick. Multiple nicks can be specified as well as
	channels using ,'s to separate them.

NAMES <channel>
	Requests the server to send a list of channel nicks.

ON
	This is a scripting command from BitchX irc client. More
	documentation to be written.

PARSEKEY 
	Used for changing keybinds.

PART [channel]
	Alias for /LEAVE and /L

PING <nick>
	Attempts to ping a nick on napster. indication of server lag.

PRINT [-BITRATE #|-COUNT #|-FREQ #|-MD5|-FORMAT string| pattern]
	Will print out your shared file list. /set FILENAME_FORMAT and /set
	DIRECTORY_FORMAT determine the output if set.

PS
	process list.

QUERY [nick|nick1,nick2]
	query's a nick or group of nicks. 

QUEUE [-remove "pattern"|-clear]
	display the download/upload queue. option allow removal of a
	nick/filename based pattern or ALL entries in both lists;

QUIT
	Quit from the client. If there are active file transfers, a second
	chance is given.

RAW <number> [<args>]
	sends a raw server command. Most useful during debugging.

RBIND
	Show a key for particular bind.

RESUME
	Shows files which can be resumed

RELOAD
	reloads the ~/.TekNap/TekNap.sav file

REQUEST <nick> <exact filename/path>
	attempts to grab a file from nick.

RESUME
	currently under development.

S
	alias for /SEARCH

SAVE
	saves the ~/.TekNap/TekNap.sav file will ALL your /set's

SAY <text>
	send text to current channel.

SCAN [channel]
	display internal nicklist from current_channel or channel.

SEARCH [-type audio/video/image|-any|-maxresults #|-bitrate #|-freq #|
	-line#|] pattern	
	-type is only supported under opennap servers.
	-maxresults > 100 is not possible. it IS a server limitation.

SERVER [-add arg] [-create] [server:port:nick:password:meta]
	display server list.
	-add will add a server to the list without connecting.
	-create to create account on server.

SET 
	Set's various options used within the client.

SHARE [-load [filename]|-save [filename]|-share|-clear|-unshare|
		-type mimetype|-reload|-recurse|-remove "pattern"] [dir dir1]
	This particular command is fairly complicated. In it's simplest form
	the following 4 commands will do what is most often needed.

		/share /home/mp3	scans /home/mp3 recursively for mp3's
		/share -save		saves the shared.dat file
		/share -load		loads the shared.dat file
		/share -share		actually shares the files with the
					server

		-type can be used to specify a particular "mime" type from
		the following list. video, audio, image, any	
		-reload will scan the directory, and search for any missing
		files
		-clear will clear the internal list of files and notify the
		server that we are no longer sharing
		-update will check the internal filelist against your HD
		files to see if they exist. If a file is found that doesn't
		exist, then it is removed and if the server knows about it,
		the server is notified
		-recurse is a toggle to turn off/on the directory recursion.
		-remove will remove the "pattern" specified

SIGNORE ["pattern(s)"]
	Inorder to ignore certain "404" msgs from the server (usually
	moderator or better) a server ignore was implemented.. The pattern
	is a quoted string which you wish to ignore in the future. You can
	use *'s to match multiple words and % to replace a single word in
	the string. Multiple patterns may be specified.
		/signore "Notification from %: % % - configured data port *
			unreachable"
		would ignore the following msg -
Notification from q: qr1 (255.255.255.255) - configured data port 6699 unreachable

STATS
	displays various statistics.

SOUNDEX
	See search. This attempts to use a soundex for mispelted words.
	only supported on opennap servers.

TIMER
	Does a periodic event. Based on the irc client BitchX.

TOPIC
	Display the topic for a channel.

TYPE

VERSION
	display the version of TekNap.

W [nick]
	Displays whois of yourself or specified nick.

WHOIS
	See also /W

WINDOW
	try /window help

Functions

$C  current channel
$F  current server number
$N  your nick
$T  current time

$after([<count>] <char> <text>)
$before([<count>] <char> <text>)

Technical:
   These functions return their respective input strings up to or following
   the specified occurrence of the given character.  If no "count" is given,
   1 (one) is assumed.  If the count is negative, the functions look for
   the specified instance of the given character from the end of the text.

Returns:
   after:  input text after specified occurrence of given character
   before: input text before specified occurrence of given character

Examples:
   $after(@ hop!jnelson@wicked.neato.org)     returns "wicked.neato.org"
   $after(-1 ! hop!jnelson@wicked.neato.org)  returns "hop"
   $after(2 . hop!jnelson@wicked.neato.org)   returns "org"
   $after(-2 . hop!jnelson@wicked.neato.org)  returns "neato.org"
   $before(@ hop!jnelson@wicked.neato.org)    returns "hop!jnelson"
   $before(-1 e hop!jnelson@wicked.neato.org) returns "hop!jnelson@wicked.n"


$aliasctl(alias|assign get|set|match <lval> [<rval>])

Technical:
   This function allows low-level manipulation of aliases and assigns.
   The noun of the action is either "alias" or "assign".  The verb is
   either "get", "set", or "match".  The "lval" must a valid variable name.
   The "rval" is used only if the verb is "set", and is any sequence of
   octets.

   * The "GET" verb allows you to retrieve the value of an alias or assign
     named by "lval".
   * The "SET" verb allows you to set the value of an alias or assign named
     by "lval" to "rval".
   * The "MATCH" verb allows you to retrieve the list of all same-level
     variable names that begin with "lval" (ie, command completion).
     Wildcards are NOT allowed, but the simple use of a single asterisk is
     allowed to match all assigns or aliases.

Practical:
   You would use this function if you needed to get the text value of an
   alias.  For completeness, you can use this to get the value of an
   assign, even though you can (obviously) get that value by $-referencing
   it.  You can set the value of an assign (comparable to using ASSIGN),
   and you can set the value of an alias (comparable to using ALIAS).  You
   can get the list of aliases or assigns that "begin" with a certain
   string, but it doesn't descend arrays (a period).

Examples:
   $aliasctl(alias get join)            returns current value of alias "join"
   $aliasctl(alias set join //channel)  sets an alias called "join"
   $aliasctl(assign match foo)          returns all vars starting with "foo"
   $aliasctl(alias match foo.)          returns all aliases of "foo" struct

$ascii(<integer list>)
$chr(<character list>)

Technical:
   This pair of function is used to convert between 8-bit characters and
   their numeric equivalent (dependent on your locale).  The $ascii()
   function converts from numeric to character, and $chr() converts from
   characters to their numeric values.

   For $ascii(), integers in the range 0..255 are accepted for input.  For
   $chr() any arbitrary list of characters is accepted.

Returns:
   ascii: space-delimited list of integer values
   chr:   concatenated list of characters

Examples:
   /* assume iso8859-1 character set */
   $ascii(abcABC)                     returns "97 98 99 65 66 67"
   $chr(1 2 3)                        returns "ABC" (ctrl-A, -B, -C)
   $chr($ascii(abcABC))               returns "abcABC"

$builtin()

$channel()
$channelnicks()
$cparse()

   $delarray(<array>)

Technical:
   This function removes all items in an array created with $setitem(),
   having the effect of deleting the array.

Practical:
   This function deletes an array.  Generally this is most useful when
   cleaning up after a script.

Returns:
   -1   error, array does not exist
    0   array deleted successfully

See Also:
   Arrays(7); delitem(6); setitem(6)


   $delitem(<array> <item#>)

Technical:
   This function is used to delete an entry from an array created with
   $setitem().  If the item deleted is the only one present in the array,
   the array is deleted too.  If the item is not the last item in the
   array, all items beyond it (with higher item numbers) are shifted down
   by one to fill in the gap.

Practical:
   This function is used to delete items from an array.  The uses for this
   are pretty obvious.  If you add items to an array, it follows that you
   might want to remove them, too.

Returns:
   -2   if the item does not exist in the array
   -1   if the array does not exist
    0   on success

Examples:
   $delitem(array 2)             deletes item 2 from array "array"
   $delitem(fake_array 4)        error, "fake_array_ does not exist
   $delitem(array -2)            error, item -2 does not exist

See Also:
   Arrays(7); getitem(6); setitem(6)


   $finditem(<array> <string>)
   $ifinditem(<array> <string>)
   $ifindfirst(<array> <string>)

Technical:
   These functions do a binary search on the items stored in the given
   array, looking for an exact match of the input string.  It will only
   return the results of an exact match.  Unlike other string handlers in
   the client, these are case-sensitive.  They only operate on arrays
   created with the $setitem() function.

   These functions differ only in which exact match they will return.  The
   $finditem() function returns the item number of the first match found;
   it does not check the array sequentially, so other exact matches with
   lower item numbers may not be returned.  The $ifinditem() function is
   same, except it returns the index number of the first match found (also
   regardless of the actual indexing order).  The $ifindfirst function is
   similar to $ifinditem(), except it returns the first exact match after
   the array has been sorted.

Practical:
   These functions are useful when you want to see if a particular string is
   present in an array.  Being sensitive to case, they are more precise than
   the general pattern-matching functions.

Returns:
     -2   item not found in array
     -1   array does not exist
   > -1   item/index number that matches input

Examples:
   /* contrived sample array */
   $setitem(booya 0 blah)
   $setitem(booya 1 foobar)
   $setitem(booya 2 blah)

   $finditem(booya blah)                   returns 0
   $ifinditem(booya blah)                  returns 1
   $ifindfirst(booya blah)                 returns 0
   $finditem(booya Blah)                   returns -1
   $finditem(foobar blah)                  returns -2


$getarrays()

$getcap()

$getitem()
$getmatches()

$getopt()

$getrmatches()
$gettmatch()

$glob(<file glob pattern>)

Technical:
   This function is used to find filenames that are matched by specified
   patterns.  This function is controlled by a compile time option, so it
   may not be available on every installation.  Multiple patterns may be
   specified.  Hidden files (dot-files) are not displayed unless a glob
    pattern beginning with a dot is given.

Practical:
   This function gives the client the file globbing abilities of modern
   Unix command shells.  It will attempt to find any file or directory
   names matching the given glob pattern.  This is highly useful for
   listing files, or finding files with similar names.

Returns:
   list of files matching input glob pattern, nothing if none match

Examples:
   $glob(~/*)    returns all non-hidden files in your home directory
   $glob(*)      returns all non-hidden files in your current directory
   $glob(.*)     returns all hidden files in your current directory
   $glob(f*)     returns all non-hidden files that start with "f" in cwd

$ifindfirst()
$ifinditem()
$igetitem()
$igetmatches()
$igetrmatches()
$indextoitem()

$isdisplaying()

$itemtoindex()

$leftw()

$listarray()

$numarrays()
$numitems()

$numsort()

$match()

$matchitem()

$md5()

$midw()

$mp3time()

$msar()

$regcomp()
$regerror()
$regexec()
$regfree()

$rightw()
$rmatch()

$rmatchitem()

$sar()

$setitem()

$sort()
$strchr()
$strrchr()
$time()
$twiddle()
  