Scripts should be placed to ~/.irssi/scripts/ or
/usr/local/lib/irssi/scripts/ (or depending on where irssi was
installed) directories. After that /RUN script_name should work, you
-don't need to add the .pl prefix.
+don't need to add the .pl suffix.
Irssi's signals
settings_get_str(key)
settings_get_int(key)
settings_get_bool(key)
+settings_get_time(key)
+settings_get_level(key)
+settings_get_size(key)
Return value for setting.
+settings_set_str(key, value)
+settings_set_int(key, value)
+settings_set_bool(key, value)
+settings_set_time(key, value)
+settings_set_level(key, value)
+settings_set_size(key, value)
+ Set value for setting.
+ If you change the settings of another module/script with one of these, you
+ must emit a "setup changed" signal afterwards.
+
settings_add_str(section, key, def)
settings_add_int(section, key, def)
settings_add_bool(section, key, def)
+settings_add_time(section, key, def)
+settings_add_level(section, key, def)
+settings_add_size(section, key, def)
Create new setting.
settings_remove(key)
signal_emit(signal, ...)
Send signal `signal'. You can give 6 parameters at maximum.
+signal_continue(...)
+ Continue currently emitted signal with different parameters.
+
signal_add(signal, func)
Bind `signal' to function `func'.
signal_stop_by_name(signal)
Stop the signal with name `signal' that's currently being emitted.
+signal_register(hash)
+ Register parameter types for one or more signals.
+ `hash' must map one or more signal names to references to arrays
+ containing 0 to 6 type names. Some recognized type names include
+ int for integers, intptr for references to integers and string for
+ strings. For all standard signals see src/perl/perl-signals-list.h
+ in the source code (this is generated by src/perl/get-signals.pl).
+
+ Any signals that were already registered are unaffected.
- *** timeouts / IO listener
+ Registration is required to get any parameters to signals written in
+ Perl and to emit and continue signals from Perl.
+
+ *** timeouts / IO listener / pidwait
timeout_add(msecs, func, data)
Call `func' every `msecs' milliseconds (1000 = 1 second) with
parameter `data'. Returns tag which can be used to stop the timeout.
+timeout_add_once(msecs, func, data);
+ Call `func' once after `msecs' milliseconds (1000 = 1 second)
+ with parameter `data'. Returns tag which can be used to stop the timeout.
+
timeout_remove(tag)
Remove timeout with tag.
input_remove(tag)
Remove listener with tag.
+pidwait_add(pid)
+ Adds `pid' to the list of processes to wait for. The pid must identify
+ a child process of the irssi process. When the process terminates, a
+ "pidwait" signal will be sent with the pid and the status from
+ waitpid(). This is useful to avoid zombies if your script forks.
+
+pidwait_remove(pid)
+ Removes `pid' from the list of processes to wait for. Terminated
+ processes are removed automatically, so it is usually not necessary
+ to call this function.
*** Message levels
Bind command `cmd' to call function `func'. `category' is the
category where the command is displayed in /HELP.
-command_runsub(cms, data, server, item)
+command_runsub(cmd, data, server, item)
Run subcommands for `cmd'. First word in `data' is parsed as
subcommand. `server' is Irssi::Server rec for current
Irssi::Windowitem `item'.
with command_bind("`cmd' `subcmd'", subcmdfunc[, category]);
command_unbind(cmd, func)
- Unbind command `cmd' from function 'func.
+ Unbind command `cmd' from function `func'.
+
+command_set_options(cmd, data)
+ Set options for command `cmd' to `data'. `data' is a string of
+ space separated words which specify the options. Each word can be
+ optionally prefixed with one of the following character:
+
+ '-': optional argument
+ '+': argument required
+ '@': optional numeric argument
+
+command_parse_options(cmd, data)
+ Parse options for command `cmd' in `data'. It returns a reference to
+ an hash table with the options and a string with the remaining part
+ of `data'. On error it returns the undefined value.
*** Windows
Channel::nick_find_mask(mask)
Find nick mask from nicklist, wildcards allowed.
-Channel::nicks(channel)
+Channel::nicks()
Return a list of all nicks in channel.
Server::nicks_get_same(nick)
Return 1 if ignoring matched.
+ *** /EXEC processes
+
+Process->{}
+ id - ID for the process
+ name - Name for the process (if given)
+ args - The command that is being executed
+
+ pid - PID for the executed command
+ target - send text with /msg <target> ...
+ target_win - print text to this window
+
+ shell - start the program via /bin/sh
+ notice - send text with /notice, not /msg if target is set
+ silent - don't print "process exited with level xx"
+
+
***
*** IRC specific functions. All objects below this are prefixed with Irc::
***
is the full raw command to be sent to server, like
"NOTICE nick :\001VERSION irssi\001"
+Server::isupport(name)
+ Returns the value of the named item in the ISUPPORT (005) numeric to the
+ script. If the item is not present returns undef, if the item has no value
+ then "" is returned use defined $server->isupport("name") if you need to
+ check whether a property is present.
+ See http://tools.ietf.org/id/draft-brocklesby-irc-isupport-03.txt
+ for more information on the ISUPPORT numeric.
*** IRC channels
Notifylist::ircnets_match(ircnet)
Returns 1 if notify is checked in `ircnet'.
-
- *** /EXEC processes
-
-Process->{}
- id - ID for the process
- name - Name for the process (if given)
- args - The command that is being executed
-
- pid - PID for the executed command
- target - send text with /msg <target> ...
- target_win - print text to this window
-
- shell - start the program via /bin/sh
- notice - send text with /notice, not /msg if target is set
- silent - don't print "process exited with level xx"
+ *** Proxy clients
+
+Client->{}
+ nick - nick of the client
+ host - host of the client
+ proxy_address - address of the proxy server
+ server - Irc::Server for which we proxy to this client
+ pass_sent - whether the client already send a PASS command
+ user_sent - whether the client already send a USER command
+ connected - whether the client is connected and ready
+ want_ctcp - whether the client wants to receive CTCPs
+ ircnet - network tag of the network we proxy