shroudBNC 1.2 TCL Commands

Commands and variables which have been implemented as part of the eggdrop emulation are not listed in this file. For a list of such commands you should read “tcl-commands.doc” (which is part of the eggdrop package) instead.

User management

addbncuser

  • Syntax: addbncuser <User> <Password>
  • Description: Creates a new bouncer user. If the user already exists his password is modified.
  • Returns: Nothing.

bnccheckpassword

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

bncuserlist

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

delbncuser

  • Syntax: delbncuser <User>
  • Description: Deletes a bouncer user.
  • Returns: Nothing.

getbncuser

  • Syntax: getbncuser <User> <Type> [Parameter]
  • Description: Get a value from the user config.
  • Returns: A tcl list.

setbncuser

  • Syntax: setbncuser <User> <Type> [<Value>] [<Value2>]
  • Description: Set a value in the user config.
  • Returns: Nothing.

trafficstats

  • Syntax: trafficstats <User> [<ConnectionType>] [<Type>]
  • Description: Returns traffic statistics for the specified user. ConnectionType can be either server or client. Type can be in or out.
  • Returns: The traffic (in bytes).

User interaction

floodcontrol

  • Syntax: 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: 1 if successful, 0 otherwise, e.g. when <User> is not a valid user.

getusermodes

  • Syntax: getusermodes
  • Description: Returns the user's usermodes.
  • Returns: A string.

hijacksocket

  • Syntax: hijacksocket
  • Description: Converts a client object into a tcl socket idx. The socket is then owned by the tcl script. This function can only be used in a “client” internalbind. The line which the “client” bind was triggered for will be copied to the new socket buffer.
  • Returns: A socket idx.

putclient

  • Syntax: 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

  • Syntax: simul <User> <Command>
  • Description: Simulates <Command> in the context of <User>. shroudBNC 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.

Context management

getctx

  • Syntax: getctx
  • Description: Returns the current context.
  • Returns: A context.

setctx

  • Syntax: setctx <Context>
  • Description: Sets the context which is used for executing commands.
  • Returns: Nothing.

Internal commands

impulse

  • Syntax: impulse <Impulse>
  • Description: Sends various debug commands.
  • Returns: Usually nothing.

internalbind

  • Syntax: internalbind <Type> <Proc> [<MatchText>] [<User>]
  • Description: Create an internalbind.
  • Returns: Nothing.

internalbinds

  • Syntax: internalbinds
  • Description: Returns a list of the current internalbinds.
  • Returns: A list.

internalchanlist

  • Syntax: internalchanlist <Channel>
  • Description: Do not use this. Use chanlist instead. See tcl-commands.doc for more details.
  • Returns: A tcl list.

internalchannels

  • Syntax: internalchannels
  • Description: Do not use this. Use channels instead. See tcl-commands.doc for more details.
  • Returns: A tcl list.

internalclosesocket

  • Syntax: internalclosesocket <idx>
  • Description: Do not use this. Use killdcc instead. See tcl-commands.doc for more details.
  • Returns: Nothing.

internalconnect

  • Syntax: internalconnect <Host> <Port>
  • Description: Do not use this. Use connect instead. See tcl-commands.doc for more details.
  • Returns: A 'dcc' idx.

internalgetchanidle

  • Syntax: internalgetchanidle <Nick> <Channel>
  • Description: Do not use this. Use getchanidle instead. See tcl-commands.doc for more details.
  • Returns: The nick's idletime in seconds.

internallisten

  • Syntax: internallisten <Port> <Type> <Options> <Flag> <SSL> <BindIp>
  • Description: Do not use this. Use listen instead. See tcl-commands.doc for more details.
  • Returns: A 'dcc' idx.

internalsocketwriteln

  • Syntax: internalsocketwriteln <idx> <Line>
  • Description: Do not use this. Use putdcc instead. See tcl-commands.doc for more details.
  • Returns: Nothing.

internalunbind

  • Syntax: internalunbind <Type> <Proc> [<Pattern>] [<User>]
  • Description: Unbind an internalbind.
  • Returns: Nothing.

bnccanhostconnect

  • Syntax: bnccanhostconnect TODO
  • Description: TODO
  • Returns: TODO

undocumented :

bncgetsendq

  • Syntax: bncgetsendq TODO
  • Description: TODO
  • Returns: TODO

internalbinds

  • Syntax: TODO
  • Description: TODO
  • Returns: TODO

internaldnslookup

  • Syntax: TODO
  • Description: TODO
  • Returns: TODO

internalgetipforsocket

  • Syntax: TODO
  • Description: TODO
  • Returns: TODO

internalkilltimer

  • Syntax: TODO
  • Description: TODO
  • Returns: TODO

internaltimer

  • Syntax: internaltimer <interval(seconds)> <Repeat(0|1)> <command> [<parameter(s?)>]
  • Description: TODO
  • Returns: 1 on success
  • Sample: internaltimer 10 0 putmainlog “hello world”
  • SampleComment: It will say hello world one time in 10s

internaltimers

  • Syntax: internaltimers
  • Description: TODO
  • Returns: list of active timers. each item of the list contains 4 sub items : command, interval, repeat and parameter(s?) like the internaltimer arguments.

internalvalidsocket

  • Syntax: internalvalidsocket TODO
  • Description: TODO
  • Returns: TODO

Miscellaneous commands

bncaddcommand

  • Syntax: 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.

bnccommand

  • Syntax: 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.

bncdeletecommand

  • Syntax: bncdeletecommand <Name>
  • Description: Removes a command (that was added via bncaddcommand) from the help command list.
  • Returns: Nothing.

bncdisconnect

  • Syntax: bncdisconnect <Reason>
  • Description: Disconnects a user from the IRC server
  • Returns: Nothing.

bncgetglobaltag

  • Syntax: bncgetglobaltag <Name>
  • Description: Returns the value of a global tag.
  • Returns: A string or NULL.

bncgetglobaltags

  • Syntax: bncgetglobaltags
  • Description: Returns a list of global tags.
  • Returns: A list.

bncgetgvhost

  • Syntax: bncgetgvhost
  • Description: Returns the default vhost.
  • Returns: A string.

bncgetmotd

  • Syntax: bncgetmotd
  • Description: Returns the current motd.
  • Returns: A string.

bncgetreslimit

  • Syntax: bncgetreslimit <Resource> [<User>]
  • Description: Determines the limit for a resource. If no user is specified the global limit is returned.
  • Returns: An integer.

TODO: list every available Resources

bncgettag

  • Syntax: bncgettag <Channel> <Nick> <Tag>
  • Description:
  • Returns:

bncisipblocked

  • Syntax: bncisipblocked <Ip>
  • Description: Checks whether an IP address is temporarily blocked (i.e. can't be used to login).
  • Returns: 1 if the ip is blocked, 0 otherwise.

bncjoinchans

  • Syntax: bncjoinchans <User>
  • Description:
  • Returns:

bnckill

  • Syntax: bnckill <Reason>
  • Description: Disconnects a user from the bouncer.
  • Returns: Nothing.

bnclogbadlogin

  • Syntax: bnclogbadlogin <Ip>
  • Description: Logs a bad login attempt for the specified IP address.
  • Returns: Nothing.

bncmodules

  • Syntax: bncmodules
  • Description: Returns a list of the loaded modules.
  • Returns: A list of the loaded modules.

bncnumversion

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

bncreply

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

bncsetglobaltag

  • Syntax: bncsetglobaltag <Name> <Value>
  • Description: Creates/sets a global tag. Global tags are stored in the sbnc.conf configuration file.
  • Returns: Nothing.

bncsetgvhost

  • Syntax: bncsetgvhost <Host>
  • Description: Sets the default vhost.
  • Returns: Nothing.

bncsetmotd

  • Syntax: bncsetmotd <Motd>
  • Description: Sets the motd.
  • Returns: Nothing.

bncsetreslimit

  • Syntax: bncsetreslimit <Resource> <NewLimit> [<User>]
  • Description: Sets a new limit for a resource. If no user is specified the global limit is set.
  • Returns: Nothing.

bncsettag

  • Syntax: bncsettag <Channel> <Nick> <Tag> <Value>
  • Description:
  • Returns:

bncuptime

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

bncvaliduser

  • Syntax: bncvaliduser <Username>
  • Description: Checks whether the specified user exists.
  • Returns: 1 if the username exsists, 0 otherwise.

bncvalidusername

  • Syntax: bncvalidusername <Username>
  • Description: Checks whether something is a valid username.
  • Returns: 1 if the username is valid, 0 otherwise.

bncversion

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

debugout

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

getchanprefix

  • Syntax: getchanprefix <Channel> <Nick>
  • Description: Returns the “best” prefix of a nick.
  • Returns: The prefix (e.g. @ or +).

getchanrealname

  • Syntax: getchanrealname <Channel> [<Nick>]
  • Description: Returns the user's realname.
  • Returns: A string or NULL.

getcurrentnick

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

getisupport

  • Syntax: getisupport <Feature>
  • Description: Returns a specific feature's value from the server's 005 replies.
  • Returns: The value of the feature.

haltoutput

  • Syntax: haltoutput
  • Description: Halts further processing and output.
  • Returns: Nothing.

isprefixmode

  • Syntax: isprefixmode <Mode>
  • Description: Returns whether a channel-mode can be applied to nicks (e.g. +o or +v).
  • Returns: 1 if the mode can be applied to nicks, 0 otherwise.

md5

  • Syntax: md5 <String> [<Salt>]
  • Description: Calculates an MD5 hash for <String>.
  • Returns: An MD5 hash. If the <Salt> argument is not empty, the returned format is <Salt>$<MD5Hash> and the <MD5Hash> is the hash of <String><Salt>.

putmainlog

  • Syntax: putmainlog <Text>
  • Description: Logs something in the main log. Each connected admin see it.
  • Returns: Nothing.

requiresparam

  • Syntax: requiresparam <Mode>
  • Description: Returns whether a channel-mode requires a parameter.
  • Returns: 3 if the mode is a list (e.g. the banlist) and requires a parameter for setting and unsetting, 2 if the mode needs a parameter for setting and unsetting. 1 if the mode requires a parameter for setting it, 0 if the mode does not require a parameter for setting it.

synthwho

  • Syntax: 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.

Undocumented

putlog

  • Syntax: putlog <Text>
  • Description: …
  • Returns: …
 
en/1.2/tclcommands.txt · Last modified: 2011/08/27 15:15 (external edit)
 
Recent changes RSS feed Creative Commons License Donate Powered by PHP Valid XHTML 1.0 Valid CSS Driven by DokuWiki