my $channel_msg_format = Xchat::get_info( "event_text Channel Message" ); -
diff --git a/share/doc/perl.html b/share/doc/perl.html deleted file mode 100644 index 6092047e..00000000 --- a/share/doc/perl.html +++ /dev/null @@ -1,1207 +0,0 @@ - - - -
-- X-Chat 2 Perl Interface - |
Xchat::register( $name, $version, [$description,[$callback]] )
Xchat::hook_server( $message, $callback, [\%options] )
Xchat::hook_command( $command, $callback, [\%options] )
Xchat::hook_print( $event,$callback, [\%options] )
Xchat::hook_timer( $timeout,$callback, [\%options | $data] )
Xchat::hook_fd( $handle, $callback, [ \%options ] )
Xchat::unhook( $hook )
Xchat::print( $text | \@lines, [$channel,[$server]] )
Xchat::printf( $format, LIST )
Xchat::command( $command | \@commands, [$channel,[$server]] )
Xchat::commandf( $format, LIST )
Xchat::find_context( [$channel, [$server]] )
Xchat::get_context()
Xchat::set_context( $context | $channel,[$server] )
Xchat::get_info( $id )
Xchat::get_prefs( $name )
Xchat::emit_print( $event, LIST )
Xchat::send_modes( $target | \@targets, $sign, $mode, [ $modes_per_line ] )
Xchat::nickcmp( $nick1, $nick2 )
Xchat::get_list( $name )
Xchat::user_info( [$nick] )
Xchat::context_info( [$context] )
Xchat::strip_code( $string )
-
--
-This is the new Perl interface for X-Chat 2. However, due to changes in -xchat's plugin code you will need xchat 2.0.8 or above to load this. Scripts -written using the old interface will continue to work. If there are any -problems, questions, comments or suggestions please email them to the address -on the bottom of this page.
--
--
-Xchat::PRI_HIGHEST
-Xchat::PRI_HIGH
-Xchat::PRI_NORM
-Xchat::PRI_LOW
-Xchat::PRI_LOWEST
--
-Xchat::EAT_NONE
- pass the event along
-Xchat::EAT_XCHAT
- don't let xchat see this event
-Xchat::EAT_PLUGIN
- don't let other scripts and plugins see this event but xchat will still see it
-Xchat::EAT_ALL
- don't let anything else see this event
--
-Xchat::KEEP
- keep the timer going or hook watching the handle
-Xchat::REMOVE
- remove the timer or hook watching the handle
--
-Xchat::FD_READ
- invoke the callback when the handle is ready for reading
-Xchat::FD_WRITE
- invoke the callback when the handle is ready for writing
-Xchat::FD_EXCEPTION
- invoke the callback if an exception occurs
-Xchat::FD_NOTSOCKET
- indicate that the handle being hooked is not a socket
--
--
-Xchat::register( $name, $version, [$description,[$callback]] )
$name
- The name of this script
-$version
- This script's version
-$description
- A description for this script
-$callback
- This is a function that will be called when the is script
- unloaded. This can be either a reference to a
- function or an anonymous sub reference.
-This is the first thing to call in every script.
--
-Xchat::hook_server( $message, $callback, [\%options] )
-
-Xchat::hook_command( $command, $callback, [\%options] )
-
-Xchat::hook_print( $event,$callback, [\%options] )
-
-Xchat::hook_timer( $timeout,$callback, [\%options | $data] )
-
-Xchat::hook_fd( $handle, $callback, [ \%options ] )
These functions can be to intercept various events. -hook_server can be used to intercept any incoming message from the IRC server. -hook_command can be used to intercept any command, if the command doesn't currently exist then a new one is created. -hook_print can be used to intercept any of the events listed in Setttings->Advanced->Text Events -hook_timer can be used to create a new timer
-$message
- server message to hook such as PRIVMSG
-$command
- command to intercept, without the leading /
-$event
- one of the events listed in Settings->Advanced->Text Events
-$timeout
- timeout in milliseconds
-$handle
- the I/O handle you want to monitor with hook_fd. This must be something that has a fileno. See perldoc -f fileno or fileno
-$callback
- callback function, this is called whenever
- the hooked event is trigged, the following are
- the conditions that will trigger the different hooks.
- This can be either a reference to a
- function or an anonymous sub reference.
-Valid keys for \%options:
-data | Additional data that is to be associated with the - hook. For timer hooks this value can be provided either as - Xchat::hook_timer( $timeout, $cb,{data=>$data}) - or Xchat::hook_timer( $timeout, $cb, $data ) .- However, this means that hook_timer cannot be provided - with a hash reference containing data as a key. example: - my $options = { data => [@arrayOfStuff] }; - Xchat::hook_timer( $timeout, $cb, $options ); - - In this example, the timer's data will be - [@arrayOfStuff] and not { data => [@arrayOfStuff] } - - This key is valid for all of the hook functions. - - Default is undef. - |
-
priority | Sets the priority for the hook. - It can be set to one of the - Xchat::PRI_* constants.- - This key only applies to server, command - and print hooks. - - Default is Xchat::PRI_NORM .
- |
help_text | Text displayed for /help $command. - - This key only applies to command hooks. - - Default is "". - |
-
flags | Specify the flags for a fd hook. - - See hook fd flags section for valid values. - - On Windows if the handle is a pipe you specify - Xchat::FD_NOTSOCKET in addition to any other flags you might be using. - - This key only applies to fd hooks. - Default is Xchat::FD_READ - |
-
-
-Each of the hooks will be triggered at different times depending on the type -of hook.
-Hook Type | When the callback will be invoked | -
server hooks | a $message message is
- received from the server
- |
-
command hooks | the $command command is
- executed, either by the user or from a script
- |
-
print hooks | X-Chat is about to print the message for the
- $event event
- |
-
timer hooks | called every $timeout milliseconds
- (1000 millisecond is 1 second)- the callback will be executed in the same context where - the hook_timer was called, if the context no longer exists - then it will execute in a random context - |
-
fd hooks | depends on the flags that were passed to hook_fd - See hook_fd flags section. - |
-
The value return from these hook functions can be passed to Xchat::unhook
-to remove the hook.
-
-All callback functions will receive their arguments in @_
like every
-other Perl subroutine.
-Server and command callbacks
-
-$_[0]
- array reference containing the IRC message or command and
-arguments broken into words
-example:
-/command arg1 arg2 arg3
-$_[0][0]
- command
-$_[0][1]
- arg1
-$_[0][2]
- arg2
-$_[0][3]
- arg3
-
-$_[1]
- array reference containing the Nth word to the last word
-example:
-/command arg1 arg2 arg3
-$_[1][0]
- command arg1 arg2 arg3
-$_[1][1]
- arg1 arg2 arg3
-$_[1][2]
- arg2 arg3
-$_[1][3]
- arg3
-
-$_[2]
- the data that was passed to the hook function
-
-Print callbacks
-
-$_[0]
- array reference containing the values for the
- text event see Settings->Advanced->Text Events
-$_[1]
- the data that was passed to the hook function
-
-Timer callbacks
-
-$_[0]
- the data that was passed to the hook function
-
fd callbacks
-
-$_[0]
- the handle that was passed to hook_fd
-$_[1]
- flags indicating why the callback was called
-$_[2]
- the data that was passed to the hook function
-
-
-All server, command and print callbacks should return one of
-the Xchat::EAT_*
constants.
-Timer callbacks can return Xchat::REMOVE to remove
-the timer or Xchat::KEEP to keep it going
-
-For server hooks, if $message
is "RAW LINE" then $cb
will be called for
-every IRC message than X-Chat receives.
For command hooks if $command
is "" then $cb
will be called for
-messages entered by the user that is not a command.
For print hooks besides those events listed in -Settings->Advanced->Text Events, these additional events can be used.
-Event | Description | -
"Open Context" | a new context is created | -
"Close Context" | a context has been close | -
"Focus Tab" | when a tab is brought to the front | -
"Focus Window" | when a top level window is focused or the - main tab window is focused by the window manager - | -
"DCC Chat Text" | when text from a DCC Chat arrives.
- $_[0] will have these values- - $_[0][0] - Address- $_[0][1] - Port- $_[0][2] - Nick- $_[0][3] - Message- |
-
"Key Press" | used for intercepting key presses - $_[0][0] - key value - $_[0][1] - state bitfield, 1 - shift, 4 - control, 8 - alt - $_[0][2] - string version of the key which might be empty for unprintable keys - $_[0][3] - length of the string in $_[0][2] - |
-
-
-Xchat::unhook( $hook )
$hook
- the hook that was previously returned by one of the Xchat::hook_*
functions
-This function is used to removed a hook previously added with one of
-the Xchat::hook_*
functions
It returns the data that was passed to the Xchat::hook_*
function when
-the hook was added
-
-Xchat::print( $text | \@lines, [$channel,[$server]] )
$text
- the text to print
-\@lines
- array reference containing lines of text to be printed
- all the elements will be joined together before printing
-$channel
- channel or tab with the given name where $text
- will be printed
-$server
- specifies that the text will be printed in a channel or tab
- that is associated with $server
-The first argument can either be a string or an array reference of strings.
-Either or both of $channel
and $server
can be undef.
If called as Xchat::print( $text )
, it will always return true.
-If called with either the channel or the channel and the server
-specified then it will return true if a context is found and
-false otherwise. The text will not be printed if the context
-is not found. The meaning of setting $channel
or $server
to
-undef is the same as
-find_context.
-
-Xchat::printf( $format, LIST )
$format
- a format string, see "perldoc -f sprintf" for further detail
--
-Xchat::command( $command | \@commands, [$channel,[$server]] )
$command
- the command to execute, without the leading /
-\@commands
- array reference containing a list of commands to execute
-$channel
- channel or tab with the given name where $command
will be executed
-$server
- specifies that the command will be executed in a channel or tab that is associated with $server
-The first argument can either be a string or an array reference of strings.
-Either or both of $channel
and $server
can be undef.
If called as Xchat::command( $command )
, it will always return true.
-If called with either the channel or the channel and the server
-specified then it will return true if a context is found and false
-otherwise. The command will not be executed if the context is not found.
-The meaning of setting $channel
or $server
to undef is the same
-as find_context.
-
-Xchat::commandf( $format, LIST )
$format
- a format string, see "perldoc -f sprintf" for further detail
--
-Xchat::find_context( [$channel, [$server]] )
$channel
- name of a channel
-$server
- name of a server
-Either or both of $channel
and $server can be undef. Calling
-Xchat::find_context()
is the same as calling
-Xchat::find_context( undef, undef)
and
-Xchat::find_context( $channel )
is
-the same as Xchat::find_context( $channel, undef )
.
If $server
is undef, find any channel named $channel.
-If $channel
is undef, find the front most window
-or tab named $server
.If both $channel and
-$server
are undef, find the currently focused tab or window.
Return the context found for one of the above situations or undef if such -a context cannot be found.
--
-Xchat::get_context()
Returns the current context.
--
-Xchat::set_context( $context | $channel,[$server] )
$context
- context value as returned from get_context,find_context or one
- of the fields in the list of hashrefs returned by list_get
-$channel
- name of a channel you want to switch context to
-$server
- name of a server you want to switch context to
-See find_context for more details on $channel
and $server
.
Returns true on success, false on failure
--
-Xchat::get_info( $id )
$id
- one of the following case sensitive values
-ID | -Return value | -Associated Command(s) | -
away | -away reason or undef if you are not away | -AWAY, BACK | -
channel | -current channel name | -SETTAB | -
charset | -character-set used in the current context | -CHARSET | -
event_text <Event Name> | text event format string for <Event name> - Example: -
-
-1
-my $channel_msg_format = Xchat::get_info( "event_text Channel Message" ); - |
- - |
host | -real hostname of the current server | -- |
id | -connection id | -- |
inputbox | -contents of the inputbox | -SETTEXT | -
libdirfs | -the system wide directory where xchat will look for plugins. - this string is in the same encoding as the local file system | -- |
modes | -the current channels modes or undef if not known | -MODE | -
network | -current network name or undef, this value is taken from the Network List | -- |
nick | -current nick | -NICK | -
nickserv | -nickserv password for this network or undef, this value is taken from the Network List | -- |
server | current server name - (what the server claims to be) undef if not connected - |
- - |
state_cursor | -current inputbox cursor position in characters | -SETCURSOR | -
topic | -current channel topic | -TOPIC | -
version | -xchat version number | -- |
win_status | -status of the xchat window, possible values are "active", "hidden" - and "normal" | -GUI | -
win_ptr | native window pointer, GtkWindow * on Unix, HWND on Win32. - On Unix if you have the Glib module installed you can use my $window = Glib::Object->new_from_pointer( Xchat::get_info( "win_ptr" ) ); to get a Gtk2::Window object. - Additionally when you have detached tabs, each of the windows will return a different win_ptr for the different Gtk2::Window objects. - See char_count.pl for a longer example of a script that uses this to show how many characters you currently have in your input box. - |
- - |
gtkwin_ptr | -similar to win_ptr except it will always be a GtkWindow * | -- |
xchatdir | xchat config directory encoded in UTF-8 - examples: - /home/user/.xchat2 - C:\Documents and Settings\user\Application Data\X-Chat 2 - |
- - |
xchatdirfs | same as xchatdir except encoded in the locale file system encoding | -- |
This function is used to retrieve certain information about the current -context. If there is an associated command then that command can be used to change the value for a particular ID.
-
-Xchat::get_prefs( $name )
$name
- name of a X-Chat setting (available through the /set command)
-This function provides a way to retrieve X-Chat's setting information.
-Returns undef
if there is no setting called called $name
.
-
-Xchat::emit_print( $event, LIST )
$event
- name from the Event column in Settings->Advanced->Text Events
-This functions is used to generate one of the events listed under -Settings->Advanced->Text Events
-Note: when using this function you MUST return Xchat::EAT_ALL otherwise you will end up with duplicate events. -One is the original and the second is the one you emit.
-Returns true on success, false on failure
--
-Xchat::send_modes( $target | \@targets, $sign, $mode, [ $modes_per_line ] )
$target
- a single nick to set the mode on
-\@targets
- an array reference of the nicks to set the mode on
-$sign
- the mode sign, either '+' or '-'
-$mode
- the mode character such as 'o' and 'v', this can only be one character long
-$modes_per_line
- an optional argument maximum number of modes to send per at once, pass 0 use the current server's maximum (default)
-Send multiple mode changes for the current channel. It may send multiple MODE lines if the request doesn't fit on one.
-Example:
-use strict; -use warning; -use Xchat qw(:all); - -hook_command( "MODES", sub { - my (undef, $who, $sign, $mode) = @{$_[0]}; - my @targets = split /,/, $who; - if( @targets > 1 ) { - send_modes( \@targets, $sign, $mode, 1 ); - } else { - send_modes( $who, $sign, $mode ); - } - return EAT_XCHAT; -}); -
-
-Xchat::nickcmp( $nick1, $nick2 )
$nick1, $nick2
- the two nicks or channel names that are to be compared
-The comparsion is based on the current server. Either a RFC1459 compliant -string compare or plain ascii will be using depending on the server. The -comparison is case insensitive.
-Returns a number less than, equal to or greater than zero if
-$nick1
is
-found respectively, to be less than, to match, or be greater than
-$nick2
.
-
-Xchat::get_list( $name )
$name
- name of the list, one of the following:
-"channels", "dcc", "ignore", "notify", "users"
-This function will return a list of hash references. The hash references -will have different keys depend on the list. An empty list is returned -if there is no such list.
-"channels" - list of channels, querys and their server
Key | Description | -
channel | tab name | -
chantypes | -channel types supported by the server, typically "#&" | -
context | can be used with set_context | -
flags | Server Bits: - 0 - Connected - 1 - Connecting - 2 - Away - 3 - EndOfMotd(Login complete) - 4 - Has WHOX - 5 - Has IDMSG (FreeNode) - - The following correspond to the /chanopt command - 6 - Hide Join/Part Message (text_hidejoinpart)- 7 - unused (was for color paste) - 8 - Beep on message (alert_beep) - 9 - Blink Tray (alert_tray) - 10 - Blink Task Bar (alert_taskbar) - Example of checking if the current context has Hide Join/Part messages set: -
-
-1
-2
-3
-if( Xchat::context_info->{flags} & (1 << 6) ) { - Xchat::print( "Hide Join/Part messages is enabled" ); -} - |
-
id | Unique server ID | -
lag | -lag in milliseconds | -
maxmodes | Maximum modes per line | -
network | network name to which this channel belongs | -
nickprefixes | Nickname prefixes e.g. "+@" | -
nickmodes | Nickname mode chars e.g. "vo" | -
queue | -number of bytes in the send queue | -
server | server name to which this channel belongs | -
type | the type of this context - 1 - server - 2 - channel - 3 - dialog - 4 - notices - 5 - server notices - |
-
users | Number of users in this channel | -
"dcc" - list of DCC file transfers
-Key | Value | -
address32 | address of the remote user(ipv4 address) | -
cps | bytes per second(speed) | -
destfile | destination full pathname | -
file | file name | -
nick | -nick of the person this DCC connection is connected to | -
port | TCP port number | -
pos | bytes sent/received | -
poshigh | bytes sent/received, high order 32 bits | -
resume | point at which this file was resumed - (zero if it was not resumed) - |
-
resumehigh | point at which this file was resumed, high order 32 bits - |
-
size | file size in bytes low order 32 bits | -
sizehigh | file size in bytes, high order 32 bits (when the files is > 4GB) | -
status | DCC Status: - 0 - queued - 1 - active - 2 - failed - 3 - done - 4 - connecting - 5 - aborted - |
-
type | DCC Type: - 0 - send - 1 - receive - 2 - chatrecv - 3 - chatsend - |
-
"ignore" - current ignore list
-Key | Value | -
mask | ignore mask. e.g: *!*@*.aol.com | -
flags | Bit field of flags. - 0 - private - 1 - notice - 2 - channel - 3 - ctcp - 4 - invite - 5 - unignore - 6 - nosave - 7 - dcc - |
-
"notify" - list of people on notify
-Key | Value | -
networks | -comma separated list of networks where you will be notfified about this user's online/offline status or undef if you will be notificed on every network you are connected to | -
nick | nickname | -
flags | 0 = is online | -
on | time when user came online | -
off | time when user went offline | -
seen | time when user was last verified still online | -
the values indexed by on, off and seen can be passed to localtime -and gmtime, see perldoc -f localtime and perldoc -f gmtime for more -detail
"users" - list of users in the current channel
-Key | Value | -
away | away status(boolean) | -
lasttalk | -last time a user was seen talking, this is the an epoch time(number of seconds since a certain date, that date depends on the OS) | -
nick | nick name | -
host | -host name in the form: user@host or undef if not known | -
prefix | prefix character, .e.g: @ or + | -
realname | -Real name or undef | -
selected | -selected status in the user list, only works when retrieving the user list of the focused tab. You can use the /USELECT command to select the nicks | -
"networks" - list of networks and the associated settings from network list
-Key | Value | -||||||||||||||||
autojoins | An object with the following methods: -
|
- ||||||||||||||||
connect_commands | An array reference containing the connect commands for a network. An empty array if there aren't any | -||||||||||||||||
encoding | the encoding for the network | -||||||||||||||||
flags | -
- a hash reference corresponding to the checkboxes in the network edit window
-
|
- ||||||||||||||||
irc_nick1 | -Corresponds with the "Nick name" field in the network edit window | -||||||||||||||||
irc_nick2 | -Corresponds with the "Second choice" field in the network edit window | -||||||||||||||||
irc_real_name | -Corresponds with the "Real name" field in the network edit window | -||||||||||||||||
irc_user_name | -Corresponds with the "User name" field in the network edit window | -||||||||||||||||
network | -Name of the network | -||||||||||||||||
nickserv_password | -Corresponds with the "Nickserv password" field in the network edit window | -||||||||||||||||
selected | -Index into the list of servers in the "servers" key, this is used if the "cycle" flag is false | -||||||||||||||||
server_password | -Corresponds with the "Server password" field in the network edit window | -||||||||||||||||
servers | -An array reference of hash references with a "host" and "port" key. If a port is not specified then 6667 will be used. | -
-
-Xchat::user_info( [$nick] )
$nick
- the nick to look for, if this is not given your own nick will be
- used as default
-This function is mainly intended to be used as a shortcut for when you need
-to retrieve some information about only one user in a channel. Otherwise it
-is better to use get_list.
-If $nick
is found a hash reference containing the same keys as those in the
-"users" list of get_list is returned otherwise undef is returned.
-Since it relies on get_list this function can only be used in a
-channel context.
-
-Xchat::context_info( [$context] )
$context
- context returned from get_context, find_context and get_list, this is the context that you want infomation about. If this is omitted, it will default to current context.
-This function will return the information normally retrieved with get_info, except this is for the context that is passed in. The information will be returned in the form of a hash. The keys of the hash are the $id
you would normally supply to get_info as well as all the keys that are valid for the items in the "channels" list from get_list. Use of this function is more efficient than calling get_list( "channels" ) and searching through the result.
Example:
-use strict; -use warnings; -use Xchat qw(:all); # imports all the functions documented on this page - -register( "User Count", "0.1", - "Print out the number of users on the current channel" ); -hook_command( "UCOUNT", \&display_count ); -sub display_count { - prnt "There are " . context_info()->{users} . " users in this channel."; - return EAT_XCHAT; -} -
-
-Xchat::strip_code( $string )
$string
- string to remove codes from
-This function will remove bold, color, beep, reset, reverse and underline codes from $string
. It will also remove ANSI escape codes which might get used by certain terminal based clients. If it is called in void context $string
will be modified otherwise a modified copy of $string
is returned.
-
--
-use strict; -use warnings; -use Xchat qw(:all); -use Net::DNS; - -hook_command( "BGDNS", sub { - my $host = $_[0][1]; - my $resolver = Net::DNS::Resolver->new; - my $sock = $resolver->bgsend( $host ); - - hook_fd( $sock, sub { - my $ready_sock = $_[0]; - my $packet = $resolver->bgread( $ready_sock ); - - if( $packet->authority && (my @answers = $packet->answer ) ) { - - if( @answers ) { - prnt "$host:"; - my $padding = " " x (length( $host ) + 2); - for my $answer ( @answers ) { - prnt $padding . $answer->rdatastr . ' ' . $answer->type; - } - } - } else { - prnt "Unable to resolve $host"; - } - - return REMOVE; - }, - { - flags => FD_READ, - }); - - return EAT_XCHAT; -}); -
-
-Contact Lian Wan Situ at <atmcmnky [at] yahoo.com> for questions, comments and -corrections about this page or the Perl plugin itself. You can also find me -in #xchat on FreeNode under the nick Khisanth.
-- X-Chat 2 Perl Interface - |
This file includes names, descriptions and examples of added commands and TCL language extensions for XChat IRC Client. - -
Tcl Plugin XChat Commands:
-/reload, /source, /tcl
-
Tcl Plugin TCL Commands:
-alias,
-away,
-channel,
-channels,
-chats,
-command,
-complete,
-dcclist,
-findcontext,
-getcontext,
-getinfo,
-getlist,
-host,
-ignores,
-killtimer,
-me,
-network,
-nickcmp,
-off,
-on,
-print,
-queries,
-raw,
-server,
-servers,
-setcontext,
-timer,
-timerexists,
-timers,
-topic,
-users,
-version,
-xchatdir
-
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 xchatdir |
-
Downloads: | -Download recommended Tcl plugin support scripts. | -
- -
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: - - - -
- - -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.
- - - -
- |
-||||||||
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: - - - -
- |
-||||||||||||||||||||
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: - - - -
- |
-||||||||||||||||||
Example: | -print "I am using XChat [getinfo version]" |
-||||||||||||||||||
See Also: | -away, channel, host, me, network, server, topic, version, xchatdir | -||||||||||||||||||
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: - - - -
- - -You may further use splitsrc command to create the additional variables: - - - -
- - -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: - - - -
- |
-||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
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: | -xchatdir | -
Downloads: | -Download recommended Tcl plugin support scripts. | -
Name: | -xchatdir - Returns the current xchat config directory. | -
Synopsis: | -xchatdir |
-
Description: | -Returns the current xchat config dir within your own user space. | -
Example: | -print "My XChat config directory is [xchatdir]" |
-
See Also: | -version | -
Downloads: | -Download recommended Tcl plugin support scripts. | -
- - - -