sBNC Tcl Commands
Version: 0.9
-------------------------------------

*** User management ***

bncuserlist

  Description: Returns a list of all bouncer accounts.
  Returns: A tcl list.

getbncuser <User> <Type> [Parameter]

  Description:
  Returns:

setbncuser <User> <Type> [<Value>] [<Value2>]

  Description:
  Returns:

addbncuser <User> <Password>

  Description: Creates a new bouncer user.
  Returns: Nothing.

delbncuser <User>

  Description: Deletes a bouncer user.
  Returns: Nothing.

bnccheckpassword <User> <Password>

  Description: Checks whether a given password matches a specific user's password.
  Returns: 1 if the <Password> is correct, 0 otherwise.

trafficstats <User> [<ConnectionType>] [<Type>]

  Description:
  Returns:

*** User interaction ***

putclient <Text>

  Description: Sends <Text> to the client connection that is attached to a bouncer user.
  Returns: 1 if successful, 0 otherwise, e.g. when the current context is not valid or when the user is not logged in.

simul <User> <Command>

  Description: Simulates <Command> in the context of <User>. sBNC performs the <Command> as if the user has typed /<Command>.
  Returns: 1 if successful, 0 otherwise, e.g. when <User> is not a valid user.

floodcontrol <Function>

  Description: Enables or disables the flood-protection for a user or returns status information about it.
    Valid values for <Function>:
    bytes - returns the number of bytes in the user's queue.
    items - just like 'bytes', however it returns the number of items.
    on - enables the flood protection
    off - disables the flood protection
  Returns: 0 if the function failed, 1 if the function succeeded (for on / off) or the number of bytes / items.

** Context management ***

setctx <Context>

  Description: Sets the context which is used for executing commands.
  Returns: Nothing.

getctx

  Description: Returns the current context.
  Returns: A context.

*** Internal commands ***

internalchanlist <Channel>

  Description: Returns the list of nicks for a given channel.
  Returns: A tcl list.

internalchannels

  Description: Returns a list of channels which the user is on.
  Returns: A tcl list.

internalgetchanidle <Nick> <Channel>

  Description:
  Returns:

internallisten <Port> <Type> <Options> <Flag>

  Description: Do not use this. Use listen instead. See tcl-commands.doc for more details.
  Returns: A 'dcc' idx.

internalsocketwriteln <idx> <Line>

  Description:  Do not use this. Use putdcc instead. See tcl-commands.doc for more details.
  Returns: Nothing.

internalconnect <Host> <Port>

  Description:  Do not use this. Use connect instead. See tcl-commands.doc for more details.
  Returns: A 'dcc' idx.

internalclosesocket <idx>

  Description:  Do not use this. Use killdcc instead. See tcl-commands.doc for more details.
  Returns: Nothing.

internalbind <Type> <Proc>

  Description:
  Returns:

internalunbind <Type> <Proc>

  Description:
  Returns:

*** Misc commands ***

bncversion

  Description: Returns the version of sBNC, e.g. 0.9 0090000.
  Returns: A string identifying the current version.

bncnumversion

  Description: Returns the version of sBNC, e.g. 0090000
  Returns: A string identifying the current version.

bncuptime

  Description: Returns the timestamp of the time when sBNC was started.
  Returns: A UNIX timestamp.

bnccommand <Command> <Parameters>

  Description: Executes a module-specific command. This is used to communicate with other sBNC modules.
  Returns: The return value is module specific. If no module processed the command an empty string is returned.

bncmodules

  Description:
  Returns:

bncjoinchans <User>

  Description:
  Returns:

md5 <String>

  Description: Calculates an MD5 hash for <String>.
  Returns: An MD5 hash.

debugout <String>

  Description: Echos <String> in the debug console. This command is Win32-specific.
  Returns: Nothing.

haltoutput

  Description:
  Returns:

bncsettag <Channel> <Nick> <Tag> <Value>

  Description:
  Returns:

bncgettag <Channel> <Nick> <Tag>

  Description:
  Returns:

getisupport <Feature>

  Description:
  Returns:

requiresparam <Mode>

  Description:
  Returns:

isprefixmode <Mode>

  Description:
  Returns:

getchanprefix <Channel> <Nick>

  Description:
  Returns:

bnckill <Reason>

  Description: Disconnects a user from the bouncer.
  Returns: Nothing.

bncdisconnect <Reason>

  Description: Disconnects a user from the irc server.
  Returns: Nothing.

bncreply <text>

  Description: Sends a notice/msg to the current user (depending on how the command-bind was triggered.)
  Returns: Nothing.

getcurrentnick

  Description: Use $::botnick instead.
  Returns: The bot's current nick.

bncgetmotd

  Description: Returns the current motd.
  Returns: A string.

bncsetmotd <Motd>

  Description: Sets the motd.
  Returns: Nothing.

bncgetgvhost

  Description: Returns the default vhost.
  Returns: A string.

bncsetgvhost <Host>

  Description: Sets the default vhost.
  Returns: Nothing:

bncvalidusername <Username>

  Description: Checks whether something is a valid username.
  Returns: 1 if the username is valid, 0 otherwise.

synthwho <Channel> <Simulate>

  Description: Synthesizes a /who reply for the given channel.
  Returns: 1 if successful, 0 otherwise. Undefined behaviour can occur
  when Simulate and the reply are both 0.

getchanrealname <Channel> [<Nick>]

  Description: Returns the user's realname.
  Returns: A string or NULL.

bncaddcommand <Name> <Category> <Description> [<HelpText>]

  Description: Adds a new command for /sbnc help. This command can only
  be used in an "internalbind command"-proc which was triggered for the command "help".
  Returns: Nothing.

bncdeletecommand <Name>

  Description: Removes a command from the command list.
  Returns: Nothing.

bncsetglobaltag <Name> <Value>

  Description: Creates/sets a global tag. Global tags are stored in the sbnc.conf configuration file.
  Returns: Nothing.

bncgetglobaltag <Name>

  Description: Returns the value of a global tag.
  Returns: A string or NULL.
