1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 244 245 246 247 248 249 250 251 252 253 254 255 256 257 258 259 260 261 262 263 264 265 266 267 268 269 270 271 272 273 274 275 276 277 278 279 280 281 282 283 284 285 286 287 288 289 290 291 292 293 294 295 296 297 298 299 300 301 302 303 304 305 306 307 308 309 310 311 312 313 314 315 316 317 318 319 320 321
|
shroudBNC Tcl Commands
Version: 1.3
-------------------------------------
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 ***
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. If the user already exists his password is modified.
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 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 ***
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>. 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.
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.
getusermodes
Description: Returns the user's usermodes.
Returns: A string.
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.
** 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: Do not use this. Use chanlist instead. See tcl-commands.doc for more details.
Returns: A tcl list.
internalchannels
Description: Do not use this. Use channels instead. See tcl-commands.doc for more details.
Returns: A tcl list.
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 <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 <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> [<MatchText>] [<User>]
Description:
Returns:
internalunbind <Type> <Proc> [<Pattern>] [<User>]
Description:
Returns:
impulse <Impulse>
Description:
Returns:
*** Misc commands ***
bncversion
Description: Returns the version of shroudBNC, e.g. 0.9 0090000.
Returns: A string identifying the current version.
bncnumversion
Description: Returns the version of shroudBNC, e.g. 0090000
Returns: A string identifying the current version.
bncuptime
Description: Returns the timestamp of the time when shroudBNC was started.
Returns: A UNIX timestamp.
bnccommand <Command> <Parameters>
Description: Executes a module-specific command. This is used to communicate with other shroudBNC 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 a specific feature's value from the server's 005 replies.
Returns: The value of the feature.
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
requires a parameter for setting it.
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.
getchanprefix <Channel> <Nick>
Description: Returns the "best" prefix of a nick.
Returns: The prefix (e.g. @ or +).
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.
bncvaliduser <Username>
Description: Checks whether the specified user exists.
Returns: Boolean value.
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.
bncgetglobaltags
Description: Returns a list of global tags.
Returns: A list.
putmainlog <Text>
Description: Logs something in the main log.
Returns: Nothing.
bncisipblocked <Ip>
Description: Checks whether an IP address is temporarily blocked (i.e. can't be used to login).
Returns: Boolean value.
bnclogbadlogin <Ip>
Description: Logs a bad login attempt for the specified IP address.
Returns: Nothing.
|