1
0
mirror of https://github.com/moparisthebest/hexchat synced 2024-11-22 17:22:18 -05:00
hexchat/share/doc/tcl.md
2012-11-04 23:55:36 +01:00

68 KiB

HexChat Tcl Interface

(This file is currently not converted properly to Markdown format.)


Note to Eggdrop Scripters:  The Tcl Plugin for XChat will not run eggdrop scripts.  Contrary to popular belief, Tcl was not invented by or for eggdrop.  Eggdrop, like many other successful projects is just another happy user of Tcl.  Tcl was around long before Eggdrop and is broadly considered the industry standard language for automation.

Name: /reload - Clear and reload all tcl scripts.
Synopsis:
/reload
Description: Clears out and reloads all tcl scripts. Any variables defined and any open files are lost.
See Also: /source
Downloads: Download recommended Tcl plugin support scripts.

Name: /source - Load a specific tcl script file.
Synopsis:
/source filename
Description: Loads a tcl script into XChat.
See Also: /reload
Downloads: Download recommended Tcl plugin support scripts.

Name: /tcl - Execute any tcl command
Synopsis:
/tcl command ?args?
Description: Allows for the immediate execution of any tcl command.
Example:
/tcl puts "Hello, XChat World!"
/tcl configdir
Downloads: Download recommended Tcl plugin support scripts.

Tcl Plugin TCL Commands

Name: alias - Creates a new xchat command.
Synopsis:
alias name { script }
Description: Creates a new xchat command and executes script when that command is entered.

Upon executing the alias, the following variables will be set:

$_cmd the alias name
$_rest params included with alias


You can also hook all text (non-commands) sent to any given tab/window by pre-pending the name of any tab with an '@'.
Example:
# do 'ls -al' command on any directory
alias ls {
  print "[eval "exec ls -al $_rest"]"
  complete
}

uppercase everything I say in #somechannel

alias @#somechannel { /say [string toupper $_rest] complete }

brag about my uptime

alias uptime { /say [bold][me]'s Uptime:[bold] [string trim [exec uptime]] }

See Also: complete, on
Downloads: Download recommended Tcl plugin support scripts.

Name: away - Returns your /away message.
Synopsis:
away ?server|context?
Description: Returns your /away message. If no server or context is omitted, the current server is assumed.
Example:
set awaymsg [away]
See Also: findcontext, getcontext
Downloads: Download recommended Tcl plugin support scripts.

Name: channel - Return the current query/channel name.
Synopsis:
channel ?context?
Description: Returns the name of the current channel or query. You may also specify a specific context to get the name of.
Example:
set thischannel [channel]
See Also: channels, findcontext, getcontext, server, servers
Downloads: Download recommended Tcl plugin support scripts.

Name: channels - Returns of list of all channels you are in.
Synopsis:
channels ?server|context?
Description: Returns a list of all channels you are in. If server or context is omitted, the current server is assumed.
Example:
alias mychannels {
  foreach s [servers] {
    print "Server: $s"
    foreach c [channels $s] {
      print " - Channel: $c - [topic $s $c]"
    }
  }
  complete
}
See Also: channel, findcontext, getcontext, server, servers
Downloads: Download recommended Tcl plugin support scripts.

Name: chats - Returns a list of opened dcc chats.
Synopsis:
chats
Description: Returns the name of the current active dcc chats.
Example:
set mychats [chats]
print "I am directly connected to [join $mychats ", "]"
See Also: channels, dcclist, queries
Downloads: Download recommended Tcl plugin support scripts.

Name: command - Simulate a command entered into xchat.
Synopsis:
command ?server|context? ?channel|nick? text
Description: Executes any internal or external chat command as if it had been typed into xchat directly. If server or channel|nick are omitted, the current ones are assumed.
Example:
command "whois [me]"
command #mychannel "me wonders what this does."
command irc.myserver.com #thatchannel "say Hello, World!"
command irc.nyserver.com "away I'm gone"
See Also: findcontext, getcontext, raw
Downloads: Download recommended Tcl plugin support scripts.

Name: complete - Set return mode of an 'on' or 'alias' script
Synopsis:
complete ?retcode?
Description: Similar to TCL's return command, complete halts further processing of an on or alias script and sets a return value.

EAT_NONE Allows all other plugins and xchat to see this event.
EAT_XCHAT Halts further processing by xchat
EAT_PLUGIN Halts further processing by other plugins (default).
EAT_ALL Halts further processing by other plugins and xchat.

Example:
on XC_TABOPEN whatever {
  print "Hello from [channel]"
  complete
}

alias bar { /me has been on irc long enough to still be traumatized by !bar scripts. complete }

See Also: alias, on
Downloads: Download recommended Tcl plugin support scripts.

Name: dcclist - Returns detailed information about all dcc chats and files transfers.
Synopsis:
dcclist
Description: Returns a list of all dcc chats and transfers.

Each list entry is made up of the following elements:

type chatsend, chatrecv, filesend, filerecv.
status queued, active, failed, done, connecting, aborted.
nick Nick of other user.
filename Name of file being sent or reveived.
size size of file being sent or reveived.
resume resume position of file being sent or reveived.
pos current position of file being sent or reveived.
cps current transfer speed in bytes per second.
address address of remote connection.
port port of the remote connection.

Example:
foreach entry [dcclist] {
  print "$entry"
}
See Also: chats
Downloads: Download recommended Tcl plugin support scripts.

Name: findcontext - Finds a context based on a channel and/or server name.
Synopsis:
findcontext ?server? ?channel|nick?
Description: Finds a context based on a channel and/or server name. If the server is omitted, it finds any channel (or query) by the given name on the current server. If channel|nick is omitted, it finds the default server tab for that server.
Example:
set context [findcontext irc.whatever.com]
set context [findcontext #mychannel]
set context [findcontext irc.whatever.com #thatchannel]
set context [findcontext]
Notes: This function is not normally needed with the tclplugin. It is included only to add completeness with the XChat C API.
See Also: getcontext, setcontext
Downloads: Download recommended Tcl plugin support scripts.

Name: getcontext - Returns the current context for your plugin.
Synopsis:
getcontext
Description: Returns the current context for your plugin. You can use this later with setcontext.
Example:
set context [getcontext]
Notes: This function is not normally needed with the tclplugin. It is included only to add completeness with the XChat C API.
See Also: findcontext, setcontext
Downloads: Download recommended Tcl plugin support scripts.

Name: getinfo - Returns information based on your current context.
Synopsis:
getinfo field
Description: Provides direct access to XChat C API command xhat_get_info. Most of these have replacement tcl plugin commands that offer more functionality.

The following fields are currently defined:

away away reason or NULL if you are not away.
channel current channel name.
configdir HexChat config directory, e.g.: /home/user/.config/hexchat.
host real hostname of the server you connected to.
network current network name or NULL.
nick your current nick name.
server current server name (what the server claims to be).
topic current channel topic.
version HexChat version number.

Example:
print "I am using XChat [getinfo version]"
See Also: away, channel, host, me, network, server, topic, version, configdir
Downloads: Download recommended Tcl plugin support scripts.

Name: getlist - Returns information from XChats list of lists
Synopsis:
getlist ?listname?
Description: Returns a list of information from XChat's internal list of lists. If listname is omitted, the names of all the available lists are returned.

The first entry in the list is the names of all the fields for that list. The rest of list are the actual list entries.
See Also: channels, dcclist, ignores, queries, servers
Downloads: Download recommended Tcl plugin support scripts.

Name: host - Returns the hostname of the server.
Synopsis:
host ?server|context?
Description: Returns the hostname of the server you connected to. If you connected to a networks round-robin name, e.g. irc.openprojects.org, irc.newnet.net, etc., it will return that name. If server is omitted, the current one is assumed.
Example:
print "I attempted to connect to [host] on [network]."
print "I am actually connected to [server]."
Notes: If you want to know the exact server name, use server.
See Also: findcontext, getcontext, network, server
Downloads: Download recommended Tcl plugin support scripts.

Name: ignores - Returns list of ignored hosts.
Synopsis:
ignores
Description: Returns a list of all ignored hosts.

Each list entry is made up the hostmask being ignored, followed by a sub-list of the types of ignores on that mask.
Example:
set ignorelist [ignores]
foreach entry $ignorelist {
  print "Ignoring:"
  print "[lindex $entry 0]: [lindex $entry 1]"
}
Downloads: Download recommended Tcl plugin support scripts.

Name: killtimer - Kills the specified timer.
Synopsis:
killtimer timerID
Description: Removes the specified timerID from the timer queue.
See Also: timer, timerexists, timers
Downloads: Download recommended Tcl plugin support scripts.

Name: me - Returns your nick.
Synopsis:
me ?server|context?
Description: Returns your current nick. If server is omitted, the current one is used by default.
See Also: findcontext, getcontext
Downloads: Download recommended Tcl plugin support scripts.

Name: network - Returns the name of the network.
Synopsis:
network ?server|context?
Description: Returns the name of the network, relative to the server list, that you are connected to. If no serveris omitted, the current one current one is used by default.
Example:
print "I attempted to connect to [host] on [network]."
print "I am actually connected to [server]."
See Also: findcontext, getcontext, host, server
Downloads: Download recommended Tcl plugin support scripts.

Name: nickcmp - Performs an RFC1459 compliant string compare.
Synopsis:
nickcmp string1 string2
Description: This command performs an RFC1459 compliant string compare. Use this to compare channels and nicknames. The function works the same way as strcasecmp.

Because of IRC's scandanavian origin, the characters {}| are considered to be the lower case equivalents of the characters [], respectively. This is a critical issue when determining the equivalence of two nicknames.
Returns: An integer less than, equal to, or greater than zero if string1 is found, respectively, to be less than, to match, or be greater than string2.
Downloads: Download recommended Tcl plugin support scripts.

Name: off - Removes a script previously assigned with on
Synopsis:
off token ?label?
Description: Removes a script from the specified XChat token and label. If label is omitted, all scripts for that token are removed.
See Also: on
Downloads: Download recommended Tcl plugin support scripts.

Name: on - Execute a command on an irc event
Synopsis:
on token label { script | procname }
Description: Whenever token is triggered, script will be executed. label is some descriptive word that identifies which script is being executed when you have multiple scripts assigned to the same event. It is suggested that you use your initials or the name of your script as the 'label'.

The token can be any server token or an internal XChat event. When executing your script, the following variables will be set:

$_label As defined by the 'on' command.
$_src source of the event. nick!ident@host -or- irc.servername.com
$_cmd irc command. JOIN, PRIVMSG, KICK, etc.
$_dest intended target of this event. nick,
$_rest the rest of the message.
$_raw the raw line received from the irc server.
$_private '0' means the message was public, '1' = private.


You may further use splitsrc command to create the additional variables:

$_nick irc user nick extracted from $_src
$_ident irc user ident extracted from $_src
$_host irc user hostname extracted from $_src


For channel management scripts, you may use any word with '!' in front (e.g. !pingme") as the token. Any time someone uses that command in a channel or in a private message, the script will be executed.

The following custom XChat internal token are also available:

INVITE (rfc1459) Invited to channel.
JOIN (rfc1459) Joined a channel
KICK (rfc1459) Kicked from a channel
KILL (rfc1459) Killed from server
MODE (rfc1459) Channel or User mode change
NICK (rfc1459) Nick change.
NOTICE (rfc1459) Private Notice
PART (rfc1459) Parted a channel
PING (rfc1459) Server Ping
PRIVMSG (rfc1459) Private Message
QUIT (rfc1459) Quit the server.
TOPIC (rfc1459) Channel topic change
WALLOPS (rfc1459) Wallops
ACTION Incoming /me whatever action command.
CHAT Incoming line of text from dcc chat conversation.
CTCP Incoming CTCP (PING, VERSION, etc)
CTCR Incoming reply from your CTCP to someone else.
SNOTICE Incoming notice from a server.
001 (rfc1459) RPL_WELCOME
002 (rfc1459) RPL_YOURHOST
003 (rfc1459) RPL_CREATED
004 (rfc1459) RPL_MYINFO
005 (rfc1459) RPL_PROTOCTL
006 (rfc1459) RPL_MAP
007 (rfc1459) RPL_MAPEND
200 (rfc1459) RPL_TRACELINK
201 (rfc1459) RPL_TRACECONNECTING
202 (rfc1459) RPL_TRACEHANDSHAKE
203 (rfc1459) RPL_TRACEUNKNOWN
204 (rfc1459) RPL_TRACEOPERATOR
205 (rfc1459) RPL_TRACEUSER
206 (rfc1459) RPL_TRACESERVER
207 (rfc1459) RPL_TRACESERVICE
208 (rfc1459) RPL_TRACENEWTYPE
209 (rfc1459) RPL_TRACECLASS
211 (rfc1459) RPL_STATSLINKINFO
212 (rfc1459) RPL_STATSCOMMANDS
213 (rfc1459) RPL_STATSCLINE
214 (rfc1459) RPL_STATSOLDNLINE
215 (rfc1459) RPL_STATSILINE
216 (rfc1459) RPL_STATSKLINE
217 (rfc1459) RPL_STATSQLINE
218 (rfc1459) RPL_STATSYLINE
219 (rfc1459) RPL_ENDOFSTATS
220 (rfc1459) RPL_STATSBLINE
221 (rfc1459) RPL_UMODEIS
222 (rfc1459) RPL_SQLINE_NICK
223 (rfc1459) RPL_STATSGLINE
224 (rfc1459) RPL_STATSTLINE
225 (rfc1459) RPL_STATSELINE
226 (rfc1459) RPL_STATSNLINE
227 (rfc1459) RPL_STATSVLINE
231 (rfc1459) RPL_SERVICEINFO
232 (rfc1459) RPL_RULES
233 (rfc1459) RPL_SERVICE
234 (rfc1459) RPL_SERVLIST
235 (rfc1459) RPL_SERVLISTEND
241 (rfc1459) RPL_STATSLLINE
242 (rfc1459) RPL_STATSUPTIME
243 (rfc1459) RPL_STATSOLINE
244 (rfc1459) RPL_STATSHLINE
245 (rfc1459) RPL_STATSSLINE
247 (rfc1459) RPL_STATSXLINE
248 (rfc1459) RPL_STATSULINE
249 (rfc1459) RPL_STATSDEBUG
250 (rfc1459) RPL_STATSCONN
251 (rfc1459) RPL_LUSERCLIENT
252 (rfc1459) RPL_LUSEROP
253 (rfc1459) RPL_LUSERUNKNOWN
254 (rfc1459) RPL_LUSERCHANNELS
255 (rfc1459) RPL_LUSERME
256 (rfc1459) RPL_ADMINME
257 (rfc1459) RPL_ADMINLOC1
258 (rfc1459) RPL_ADMINLOC2
259 (rfc1459) RPL_ADMINEMAIL
261 (rfc1459) RPL_TRACELOG
265 (rfc1459) RPL_LOCALUSERS
266 (rfc1459) RPL_GLOBALUSERS
271 (rfc1459) RPL_SILELIST
272 (rfc1459) RPL_ENDOFSILELIST
275 (rfc1459) RPL_STATSDLINE
290 (rfc1459) RPL_HELPHDR
291 (rfc1459) RPL_HELPOP
292 (rfc1459) RPL_HELPTLR
293 (rfc1459) RPL_HELPHLP
294 (rfc1459) RPL_HELPFWD
295 (rfc1459) RPL_HELPIGN
300 (rfc1459) RPL_NONE
301 (rfc1459) RPL_AWAY
302 (rfc1459) RPL_USERHOST
303 (rfc1459) RPL_ISON
304 (rfc1459) RPL_TEXT
305 (rfc1459) RPL_UNAWAY
306 (rfc1459) RPL_NOWAWAY
307 (rfc1459) RPL_WHOISREGNICK
308 (rfc1459) RPL_RULESSTART
309 (rfc1459) RPL_ENDOFRULES
310 (rfc1459) RPL_WHOISHELPOP
311 (rfc1459) RPL_WHOISUSER
312 (rfc1459) RPL_WHOISSERVER
313 (rfc1459) RPL_WHOISOPERATOR
314 (rfc1459) RPL_WHOWASUSER
315 (rfc1459) RPL_ENDOFWHO
316 (rfc1459) RPL_WHOISCHANOP
317 (rfc1459) RPL_WHOISIDLE
318 (rfc1459) RPL_ENDOFWHOIS
319 (rfc1459) RPL_WHOISCHANNELS
320 (rfc1459) RPL_WHOISSPECIAL
321 (rfc1459) RPL_LISTSTART
322 (rfc1459) RPL_LIST
323 (rfc1459) RPL_LISTEND
324 (rfc1459) RPL_CHANNELMODEIS
329 (rfc1459) RPL_CREATIONTIME
331 (rfc1459) RPL_NOTOPIC
332 (rfc1459) RPL_TOPIC
333 (rfc1459) RPL_TOPICWHOTIME
334 (rfc1459) RPL_LISTSYNTAX
335 (rfc1459) RPL_WHOISBOT
341 (rfc1459) RPL_INVITING
342 (rfc1459) RPL_SUMMONING
343 (rfc1459) RPL_TICKER
346 (rfc1459) RPL_INVITELIST
347 (rfc1459) RPL_ENDOFINVITELIST
348 (rfc1459) RPL_EXLIST
349 (rfc1459) RPL_ENDOFEXLIST
351 (rfc1459) RPL_VERSION
352 (rfc1459) RPL_WHOREPLY
353 (rfc1459) RPL_NAMREPLY
361 (rfc1459) RPL_KILLDONE
362 (rfc1459) RPL_CLOSING
363 (rfc1459) RPL_CLOSEEND
364 (rfc1459) RPL_LINKS
365 (rfc1459) RPL_ENDOFLINKS
366 (rfc1459) RPL_ENDOFNAMES
367 (rfc1459) RPL_BANLIST
368 (rfc1459) RPL_ENDOFBANLIST
369 (rfc1459) RPL_ENDOFWHOWAS
371 (rfc1459) RPL_INFO
372 (rfc1459) RPL_MOTD
373 (rfc1459) RPL_INFOSTART
374 (rfc1459) RPL_ENDOFINFO
375 (rfc1459) RPL_MOTDSTART
376 (rfc1459) RPL_ENDOFMOTD
378 (rfc1459) RPL_WHOISHOST
379 (rfc1459) RPL_WHOISMODES
381 (rfc1459) RPL_YOUREOPER
382 (rfc1459) RPL_REHASHING
383 (rfc1459) RPL_YOURESERVICE
384 (rfc1459) RPL_MYPORTIS
385 (rfc1459) RPL_NOTOPERANYMORE
386 (rfc1459) RPL_QLIST
387 (rfc1459) RPL_ENDOFQLIST
388 (rfc1459) RPL_ALIST
389 (rfc1459) RPL_ENDOFALIST
391 (rfc1459) RPL_TIME
392 (rfc1459) RPL_USERSSTART
393 (rfc1459) RPL_USERS
394 (rfc1459) RPL_ENDOFUSERS
395 (rfc1459) RPL_NOUSERS
401 (rfc1459) ERR_NOSUCHNICK
402 (rfc1459) ERR_NOSUCHSERVER
403 (rfc1459) ERR_NOSUCHCHANNEL
404 (rfc1459) ERR_CANNOTSENDTOCHAN
405 (rfc1459) ERR_TOOMANYCHANNELS
406 (rfc1459) ERR_WASNOSUCHNICK
407 (rfc1459) ERR_TOOMANYTARGETS
408 (rfc1459) ERR_NOSUCHSERVICE
409 (rfc1459) ERR_NOORIGIN
411 (rfc1459) ERR_NORECIPIENT
412 (rfc1459) ERR_NOTEXTTOSEND
413 (rfc1459) ERR_NOTOPLEVEL
414 (rfc1459) ERR_WILDTOPLEVEL
421 (rfc1459) ERR_UNKNOWNCOMMAND
422 (rfc1459) ERR_NOMOTD
423 (rfc1459) ERR_NOADMININFO
424 (rfc1459) ERR_FILEERROR
425 (rfc1459) ERR_NOOPERMOTD
431 (rfc1459) ERR_NONICKNAMEGIVEN
432 (rfc1459) ERR_ERRONEUSNICKNAME
433 (rfc1459) ERR_NICKNAMEINUSE
434 (rfc1459) ERR_NORULES
435 (rfc1459) ERR_SERVICECONFUSED
436 (rfc1459) ERR_NICKCOLLISION
437 (rfc1459) ERR_BANNICKCHANGE
438 (rfc1459) ERR_NCHANGETOOFAST
439 (rfc1459) ERR_TARGETTOOFAST
440 (rfc1459) ERR_SERVICESDOWN
441 (rfc1459) ERR_USERNOTINCHANNEL
442 (rfc1459) ERR_NOTONCHANNEL
443 (rfc1459) ERR_USERONCHANNEL
444 (rfc1459) ERR_NOLOGIN
445 (rfc1459) ERR_SUMMONDISABLED
446 (rfc1459) ERR_USERSDISABLED
447 (rfc1459) ERR_NONICKCHANGE
451 (rfc1459) ERR_NOTREGISTERED
455 (rfc1459) ERR_HOSTILENAME
459 (rfc1459) ERR_NOHIDING
460 (rfc1459) ERR_NOTFORHALFOPS
461 (rfc1459) ERR_NEEDMOREPARAMS
462 (rfc1459) ERR_ALREADYREGISTRED
463 (rfc1459) ERR_NOPERMFORHOST
464 (rfc1459) ERR_PASSWDMISMATCH
465 (rfc1459) ERR_YOUREBANNEDCREEP
466 (rfc1459) ERR_YOUWILLBEBANNED
467 (rfc1459) ERR_KEYSET
468 (rfc1459) ERR_ONLYSERVERSCANCHANGE
469 (rfc1459) ERR_LINKSET
470 (rfc1459) ERR_LINKCHANNEL
471 (rfc1459) ERR_CHANNELISFULL
472 (rfc1459) ERR_UNKNOWNMODE
473 (rfc1459) ERR_INVITEONLYCHAN
474 (rfc1459) ERR_BANNEDFROMCHAN
475 (rfc1459) ERR_BADCHANNELKEY
476 (rfc1459) ERR_BADCHANMASK
477 (rfc1459) ERR_NEEDREGGEDNICK
478 (rfc1459) ERR_BANLISTFULL
479 (rfc1459) ERR_LINKFAIL
480 (rfc1459) ERR_CANNOTKNOCK
481 (rfc1459) ERR_NOPRIVILEGES
482 (rfc1459) ERR_CHANOPRIVSNEEDED
483 (rfc1459) ERR_CANTKILLSERVER
484 (rfc1459) ERR_ATTACKDENY
485 (rfc1459) ERR_KILLDENY
486 (rfc1459) ERR_HTMDISABLED
491 (rfc1459) ERR_NOOPERHOST
492 (rfc1459) ERR_NOSERVICEHOST
501 (rfc1459) ERR_UMODEUNKNOWNFLAG
502 (rfc1459) ERR_USERSDONTMATCH
511 (rfc1459) ERR_SILELISTFULL
512 (rfc1459) ERR_TOOMANYWATCH
513 (rfc1459) ERR_NEEDPONG
518 (rfc1459) ERR_NOINVITE
519 (rfc1459) ERR_ADMONLY
520 (rfc1459) ERR_OPERONLY
521 (rfc1459) ERR_LISTSYNTAX
600 (rfc1459) RPL_LOGON
601 (rfc1459) RPL_LOGOFF
602 (rfc1459) RPL_WATCHOFF
603 (rfc1459) RPL_WATCHSTAT
604 (rfc1459) RPL_NOWON
605 (rfc1459) RPL_NOWOFF
606 (rfc1459) RPL_WATCHLIST
607 (rfc1459) RPL_ENDOFWATCHLIST
610 (rfc1459) RPL_MAPMORE
640 (rfc1459) RPL_DUMPING
641 (rfc1459) RPL_DUMPRPL
642 (rfc1459) RPL_EODUMP
999 (rfc1459) ERR_NUMERICERR
XC_TABOPEN (xchat) A new channel/nick/server tabs was created.
XC_TABCLOSE (xchat) One of the channel/nick/server tabs was closed.
XC_TABFOCUS (xchat) You changed focus to a new tab.
XC_ADDNOTIFY (xchat) Add Notify
XC_BANLIST (xchat) Ban List
XC_BANNED (xchat) Banned
XC_CHANGENICK (xchat) Change Nick
XC_CHANACTION (xchat) Channel Action
XC_HCHANACTION (xchat) Channel Action Hilight
XC_CHANBAN (xchat) Channel Ban
XC_CHANDATE (xchat) Channel Creation
XC_CHANDEHOP (xchat) Channel DeHalfOp
XC_CHANDEOP (xchat) Channel DeOp
XC_CHANDEVOICE (xchat) Channel DeVoice
XC_CHANEXEMPT (xchat) Channel Exempt
XC_CHANHOP (xchat) Channel Half-Operator
XC_CHANINVITE (xchat) Channel INVITE
XC_CHANLISTHEAD (xchat) Channel List
XC_CHANMSG (xchat) Channel Message
XC_CHANMODEGEN (xchat) Channel Mode Generic
XC_CHANMODES (xchat) Channel Modes
XC_HCHANMSG (xchat) Channel Msg Hilight
XC_CHANNOTICE (xchat) Channel Notice
XC_CHANOP (xchat) Channel Operator
XC_CHANRMEXEMPT (xchat) Channel Remove Exempt
XC_CHANRMINVITE (xchat) Channel Remove Invite
XC_CHANRMKEY (xchat) Channel Remove Keyword
XC_CHANRMLIMIT (xchat) Channel Remove Limit
XC_CHANSETKEY (xchat) Channel Set Key
XC_CHANSETLIMIT (xchat) Channel Set Limit
XC_CHANUNBAN (xchat) Channel UnBan
XC_CHANVOICE (xchat) Channel Voice
XC_CONNECTED (xchat) Connected
XC_CONNECT (xchat) Connecting
XC_CONNFAIL (xchat) Connection Failed
XC_CTCPGEN (xchat) CTCP Generic
XC_CTCPGENC (xchat) CTCP Generic to Channel
XC_CTCPSEND (xchat) CTCP Send
XC_CTCPSND (xchat) CTCP Sound
XC_DCCCHATABORT (xchat) DCC CHAT Abort
XC_DCCCONCHAT (xchat) DCC CHAT Connect
XC_DCCCHATF (xchat) DCC CHAT Failed
XC_DCCCHATOFFER (xchat) DCC CHAT Offer
XC_DCCCHATOFFERING (xchat) DCC CHAT Offering
XC_DCCCHATREOFFER (xchat) DCC CHAT Reoffer
XC_DCCCONFAIL (xchat) DCC Conection Failed
XC_DCCGENERICOFFER (xchat) DCC Generic Offer
XC_DCCHEAD (xchat) DCC Header
XC_MALFORMED (xchat) DCC Malformed
XC_DCCOFFER (xchat) DCC Offer
XC_DCCIVAL (xchat) DCC Offer Not Valid
XC_DCCRECVABORT (xchat) DCC RECV Abort
XC_DCCRECVCOMP (xchat) DCC RECV Complete
XC_DCCCONRECV (xchat) DCC RECV Connect
XC_DCCRECVERR (xchat) DCC RECV Failed
XC_DCCFILEERR (xchat) DCC RECV File Open Error
XC_DCCRENAME (xchat) DCC Rename
XC_DCCRESUMEREQUEST (xchat) DCC RESUME Request
XC_DCCSENDABORT (xchat) DCC SEND Abort
XC_DCCSENDCOMP (xchat) DCC SEND Complete
XC_DCCCONSEND (xchat) DCC SEND Connect
XC_DCCSENDFAIL (xchat) DCC SEND Failed
XC_DCCSENDOFFER (xchat) DCC SEND Offer
XC_DCCSTALL (xchat) DCC Stall
XC_DCCTOUT (xchat) DCC Timeout
XC_DELNOTIFY (xchat) Delete Notify
XC_DISCON (xchat) Disconnected
XC_FOUNDIP (xchat) Found IP
XC_IGNOREADD (xchat) Ignore Add
XC_IGNORECHANGE (xchat) Ignore Changed
XC_IGNOREFOOTER (xchat) Ignore Footer
XC_IGNOREHEADER (xchat) Ignore Header
XC_IGNOREREMOVE (xchat) Ignore Remove
XC_IGNOREEMPTY (xchat) Ignorelist Empty
XC_INVITE (xchat) Invite
XC_INVITED (xchat) Invited
XC_JOIN (xchat) Join
XC_KEYPRESS (xchat) Key Press
XC_KEYWORD (xchat) Keyword
XC_KICK (xchat) Kick
XC_KILL (xchat) Killed
XC_MSGSEND (xchat) Message Send
XC_MOTD (xchat) Motd
XC_MOTDSKIP (xchat) MOTD Skipped
XC_NICKCLASH (xchat) Nick Clash
XC_NICKFAIL (xchat) Nick Failed
XC_NODCC (xchat) No DCC
XC_NOCHILD (xchat) No Running Process
XC_NOTICE (xchat) Notice
XC_NOTICESEND (xchat) Notice Send
XC_NOTIFYEMPTY (xchat) Notify Empty
XC_NOTIFYHEAD (xchat) Notify Header
XC_NOTIFYNUMBER (xchat) Notify Number
XC_NOTIFYOFFLINE (xchat) Notify Offline
XC_NOTIFYONLINE (xchat) Notify Online
XC_PART (xchat) Part
XC_PARTREASON (xchat) Part with Reason
XC_PINGREP (xchat) Ping Reply
XC_PINGTIMEOUT (xchat) Ping Timeout
XC_PRIVMSG (xchat) Private Message
XC_DPRIVMSG (xchat) Private Message to Dialog
XC_ALREADYPROCESS (xchat) Process Already Running
XC_QUIT (xchat) Quit
XC_RAWMODES (xchat) Raw Modes
XC_WALLOPS (xchat) Receive Wallops
XC_RESOLVINGUSER (xchat) Resolving User
XC_SERVERCONNECTED (xchat) Server Connected
XC_SERVERERROR (xchat) Server Error
XC_SERVERLOOKUP (xchat) Server Lookup
XC_SERVNOTICE (xchat) Server Notice
XC_SERVTEXT (xchat) Server Text
XC_STOPCONNECT (xchat) Stop Connection
XC_TOPIC (xchat) Topic
XC_TOPICDATE (xchat) Topic Creation
XC_NEWTOPIC (xchat) Topic Change
XC_UKNHOST (xchat) Unknown Host
XC_USERLIMIT (xchat) User Limit
XC_USERSONCHAN (xchat) Users On Channel
XC_WHOIS5 (xchat) WhoIs Away Line
XC_WHOIS2 (xchat) WhoIs Channel/Oper Line
XC_WHOIS6 (xchat) WhoIs End
XC_WHOIS4 (xchat) WhoIs Idle Line
XC_WHOIS4T (xchat) WhoIs Idle Line with Signon
XC_WHOIS1 (xchat) WhoIs Name Line
XC_WHOIS3 (xchat) WhoIs Server Line
XC_UJOIN (xchat) You Join
XC_UPART (xchat) You Part
XC_UPARTREASON (xchat) You Part with Reason
XC_UKICK (xchat) You Kicked
XC_UINVITE (xchat) Your Invitation
XC_UCHANMSG (xchat) Your Message
XC_UCHANGENICK (xchat) Your Nick Changing

Example:
on PRIVMSG example {
  if { [string match -nocase "*[me]*" $_rest] } {
    play mynick.wav
    complete
  }
}

on !opme example { splitsrc /op $_nick complete }

on XC_TABOPEN example { switch [string index [channel] 0] { "#" - "&" - "(" - "" { return } } play attention.wav print "Now in private conversation with [channel]." complete }

Notes: All events starting with XC_ correspond to the events listed in the Settings->Lists->EventTexts window in XChat. All parameters are appended to $_raw, e.g:

arg1 is [lindex $_raw 1]
arg2 is [lindex $_raw 2]
arg3 is [lindex $_raw 3]
arg4 is [lindex $_raw 4]
See Also: alias, off
Downloads: Download recommended Tcl plugin support scripts.

Name: print - Print text to an xchat window/tab
Synopsis:
print ?server|context? ?channel|nick? text
Description: Prints text to a window. If a channel|nick is included, the text is printed to that channel/nick. You may also include a specific server.
Example:
# print text to the current window
print "Hello, World!"

print text to the channel or nick window

print #channel "Hello, World!"

print text to the channel window

belonging to a specific server.

print irc.blahblah.com #channel "Hello, World!"

See Also: findcontext, getcontext, puts
Downloads: Download recommended Tcl plugin support scripts.

Name: queries - Returns a list of private queries.
Synopsis:
queries ?server|context?
Description: Returns a list of all private queries. If server is omitted, the server belonging to the current server is used by default.
Example:
alias myqueries {
  foreach s [servers] {
    print "Server: $s"
    foreach q [queries $s] {
      print " - Query: $q"
    }
  }
  complete
}
See Also: channels, chats, findcontext, getcontext
Downloads: Download recommended Tcl plugin support scripts.

Name: raw - Send a line directly to the server.
Synopsis:
raw ?server|context? ?channel|nick? text
Description: This command sends text directly to the server without further processing or interpretation by xchat. If server or channel|nick name is omitted, the current ones are used by default.
Example:
raw "PRIVMSG bubba :Howdy Bubba!"
See Also: command, findcontext, getcontext
Downloads: Download recommended Tcl plugin support scripts.

Name: server - Return the current server.
Synopsis:
server ?context?
Description: Returns the current server name (what the server claims to be).
Example:
print "I attempted to connect to [host] on [network]."
print "I am actually connected to [server]."
See Also: findcontext, getcontext, host
Downloads: Download recommended Tcl plugin support scripts.

Name: servers - Returns of list of all servers you are on.
Synopsis:
servers
Description: Returns a list of all servers you are currently connected to.
Example:
alias mychannels {
  foreach s [servers] {
    print "Server: $s"
    foreach c [channels $s] {
      print " - Channel: $c - [topic $s $c]"
    }
  }
  complete
}
See Also: channel, channels, server
Downloads: Download recommended Tcl plugin support scripts.

Name: setcontext - Changes your current context to the one given.
Synopsis:
setcontext context
Description: Changes your current context to the one given. The argument context must have been returned by getcontext or findcontext.
Example:
set context [findcontext #channel]
setcontext $context
Notes: This function is not normally needed with the tclplugin. It is included only to add completeness with the XChat C API.
See Also: findcontext, getcontext
Downloads: Download recommended Tcl plugin support scripts.

Name: timer - Executes tcl command after a certain number of seconds have passed.
Synopsis:
timer ?-repeat? ?-count times? seconds {script | procname ?args?}
Description: Executes a tcl command or script after a certain number of seconds have passed.

If the -repeat flag is included, it will will keep repeating until killed with killtimer. If the -count flag is added, it will repeat the number of times specified after the flag. In all other cases, it is executed only once.
Example:
timer 5 { /say Times up! }
Returns: timer ID code is to identify the timer with for use with other timer commands.
See Also: killtimer, timerexists, timers
Downloads: Download recommended Tcl plugin support scripts.

Name: timerexists - Returns 1 if the specified timer exists.
Synopsis:
timerexists timerID
Description: Determines of the specified timerID exists.
Returns: 1 if the specified timer exists, 0 otherwise
See Also: killtimer, timer, timers
Downloads: Download recommended Tcl plugin support scripts.

Name: timers - Returns a list of timers currently active.
Synopsis:
timers
Description: Returns a list of active timers; each entry in the list contains the timerID, the number of seconds left till activation, the command that will be executed, the number of seconds specified, and the number of times left to be executed.
Example:
timer 5 { print "Important message coming soon!" }
timer 10 { print "It is now 10 seconds later!  Yay!!!!!" }
print "[timers]"
See Also: killtimer, timer, timerexists
Downloads: Download recommended Tcl plugin support scripts.

Name: topic - Returns the topic of a channel.
Synopsis:
topic ?server|context? ?channel?
Description: Returns the channel topic from the current channel or from a specific server and channel.
Example:
alias mychannels {
  foreach s [servers] {
    print "Server: $s"
    foreach c [channels $s] {
      print " - Channel: $c - [topic $s $c]"
    }
  }
  complete
}
See Also: channel, channels, findcontext, getcontext, users
Downloads: Download recommended Tcl plugin support scripts.

Name: users - Returns a list of users in a channel.
Synopsis:
users ?server|context? ?channel?
Description: Returns a list of all the users in a channel. The list consists of 4 elements; nick, hostmask, channel status and selected.
Example:
alias listusers {
  print "- --------------- ----------------------------------------"
  foreach user [users] {
    print "[format "%-1s" [lindex $user 2]] [format "%-15s" [lindex $user 0]] [lindex $user 1]"
  }
}
See Also: channels, findcontext, getcontext, getlist, servers
Downloads: Download recommended Tcl plugin support scripts.

Name: version - Returns XChat version number.
Synopsis:
version
Description: Returns the full XChat version number.
Example:
print "I am using XChat version [version]"
See Also: configdir
Downloads: Download recommended Tcl plugin support scripts.

Name: configdir - Returns the current HexChat config directory.
Synopsis:
configdir
Description: Returns the current xchat config dir within your own user space.
Example:
print "My XChat config directory is [configdir]"
See Also: version
Downloads: Download recommended Tcl plugin support scripts.