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
.Renvoie: Hook handler
-
hook_server
(name, callback[, userdata, priority])¶ Calls specified callback anytime the specified event happens.
Arguments: - name – IRC numeric or named event
Renvoie: Hook handler
-
hook_command
(name, callback[, userdata, priority])¶ Calls specified callback anytime the specified command is run.
Renvoie: 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
Renvoie: 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.
Renvoie: Hook handler
-
hook_unload
(callback[, userdata])¶ Calls specified callback when the script is unloaded.
Renvoie: 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.
Renvoie: - 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.
Renvoie: 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.
Renvoie: - False: Failure
- True: Success (or never existing),
-
list_pluginpref
()¶ Returns a list of all currently set preferences.