HexChat Javascript Interface¶
Information¶
The javascript plugin does not come with HexChat, more information on it can be found Here
This page is simply for hosting its API docs and is a work in progress.
Functions¶
Generic Fuctions¶
- print(object)¶
Prints text to the current context.
- Arguments:
object – Object to be converted to a string
- command(string)¶
Runs a command in the current context.
Hook Functions¶
- hook_print(name, callback[, userdata, priority])¶
Calls specified callback anytime the specified event happens. The Print Events can be found in
.- Returns:
Hook handler
- hook_server(name, callback[, userdata, priority])¶
Calls specified callback anytime the specified event happens.
- Arguments:
name – IRC numeric or named event
- Returns:
Hook handler
- hook_command(name, callback[, userdata, priority])¶
Calls specified callback anytime the specified command is run.
- Returns:
Hook handler
- hook_special(name, callback[, userdata, priority])¶
Calls specified callback anytime the specified special event happens.
Special Events:
Open Context
Close Context
Focus Tab
Focus Window
DCC Chat Text
Key Press
- Returns:
Hook handler
- hook_timer(timeout, callback[, userdata])¶
Calls specified callback in your specified interval (in milliseconds).
If you return true the callback will continue to be called, otherwise it is removed.
- Returns:
Hook handler
- hook_unload(callback[, userdata])¶
Calls specified callback when the script is unloaded.
- Returns:
Hook handler
- unhook(handler)¶
Removes any hook registered above.
Plugin Preferences¶
You can use pluginpref to easily store and retrieve settings.
- set_pluginpref(name, value)¶
Stores settings in addon_*SCRIPT_NAME*.conf in the config dir.
- Returns:
False: Failure
True: Success
- get_pluginpref(name)¶
This will return the value of the variable of that name. If there is none by this name it will return undefined.
- Returns:
String or Integer of stored setting or None if it does not exist.
Note
Strings of numbers are always returned as Integers.
- del_pluginpref(name)¶
Deletes the specified variable.
- Returns:
False: Failure
True: Success (or never existing),
- list_pluginpref()¶
Returns a list of all currently set preferences.