35 |
|
|
36 |
@title WeeChat - User guide |
@title WeeChat - User guide |
37 |
@subtitle Fast, light and extensible IRC client |
@subtitle Fast, light and extensible IRC client |
38 |
@subtitle Documentation for WeeChat v0.1.6-cvs - October, 24 2005 |
@subtitle Documentation for WeeChat v0.1.6-cvs - October, 25 2005 |
39 |
|
|
40 |
@author FlashCode <@email{flashcode@@flashtux.org, flashcode AT flashtux.org}> |
@author FlashCode <@email{flashcode@@flashtux.org, flashcode AT flashtux.org}> |
41 |
|
|
1557 |
@end itemize |
@end itemize |
1558 |
@item functions for init and end of plugin: |
@item functions for init and end of plugin: |
1559 |
@itemize @minus |
@itemize @minus |
1560 |
@item weechat_plugin_init: function called when plugin is loaded |
@item weechat_plugin_init: function called when plugin is loaded, |
1561 |
@item weechat_plugin_end: function called when plugin is unloaded |
must return 1 if successful, 0 if error |
1562 |
|
@item weechat_plugin_end: function called when plugin is unloaded, |
1563 |
|
must return 1 if successful, 0 if error |
1564 |
@end itemize |
@end itemize |
1565 |
@end itemize |
@end itemize |
1566 |
|
|
2064 |
@* |
@* |
2065 |
@emph{Examples:}@* |
@emph{Examples:}@* |
2066 |
@* |
@* |
2067 |
@code{char *value1 = plugin->get_config (plugin, "look_set_title");}@* |
@code{char *value1 = plugin->get_config (plugin, "look_nicklist");}@* |
2068 |
@code{char *value2 = plugin->get_config (plugin, "freenode.server_autojoin");}@* |
@code{char *value2 = plugin->get_config (plugin, "freenode.server_autojoin");}@* |
2069 |
@* |
@* |
2070 |
|
|
2095 |
*plugin, char *option)}@* |
*plugin, char *option)}@* |
2096 |
@* |
@* |
2097 |
Return value of a plugin option.@* |
Return value of a plugin option.@* |
2098 |
|
Option is read from file ~/.weechat/plugins.rc and is like:@* |
2099 |
|
@code{plugin.option=value}@* |
2100 |
|
Note: plugin name is automatically added.@* |
2101 |
|
|
2102 |
@emph{Arguments:} |
@emph{Arguments:} |
2103 |
@itemize @minus |
@itemize @minus |
2121 |
*plugin, char *option, char *value)}@* |
*plugin, char *option, char *value)}@* |
2122 |
@* |
@* |
2123 |
Update value of a plugin option.@* |
Update value of a plugin option.@* |
2124 |
|
Option is written in file ~/.weechat/plugins.rc and is like:@* |
2125 |
|
@code{plugin.option=value}@* |
2126 |
|
Note: plugin name is automatically added.@* |
2127 |
|
|
2128 |
@emph{Arguments:} |
@emph{Arguments:} |
2129 |
@itemize @minus |
@itemize @minus |
2252 |
@item @option{description}: short description of script. |
@item @option{description}: short description of script. |
2253 |
@end itemize |
@end itemize |
2254 |
@* |
@* |
2255 |
|
@emph{Return value:}@* |
2256 |
|
@* |
2257 |
|
1 if script was registered, 0 if error occured.@* |
2258 |
|
@* |
2259 |
@emph{Example:}@* |
@emph{Example:}@* |
2260 |
@* |
@* |
2261 |
@code{weechat::register ("sample", "1.0", "sample_end", "Sample script!");}@* |
@code{weechat::register ("sample", "1.0", "sample_end", "Sample script!");}@* |
2273 |
@item @option{server}: internal name of server |
@item @option{server}: internal name of server |
2274 |
@end itemize |
@end itemize |
2275 |
@* |
@* |
2276 |
|
@emph{Return value:}@* |
2277 |
|
@* |
2278 |
|
1 if successful, 0 if error occured.@* |
2279 |
|
@* |
2280 |
@emph{Examples:}@* |
@emph{Examples:}@* |
2281 |
@* |
@* |
2282 |
@code{weechat::print ("message");}@* |
@code{weechat::print ("message");}@* |
2296 |
@item @option{message}: message to display |
@item @option{message}: message to display |
2297 |
@end itemize |
@end itemize |
2298 |
@* |
@* |
2299 |
|
@emph{Return value:}@* |
2300 |
|
@* |
2301 |
|
1 if successful, 0 if error occured.@* |
2302 |
|
@* |
2303 |
@emph{Example:}@* |
@emph{Example:}@* |
2304 |
@* |
@* |
2305 |
@code{weechat::print_infobar (5, "message");}@* |
@code{weechat::print_infobar (5, "message");}@* |
2320 |
@item @option{function}: Perl function called when message is received |
@item @option{function}: Perl function called when message is received |
2321 |
@end itemize |
@end itemize |
2322 |
@* |
@* |
2323 |
|
@emph{Return value:}@* |
2324 |
|
@* |
2325 |
|
1 if Perl function was attached, 0 if error occured.@* |
2326 |
|
@* |
2327 |
@emph{Example:}@* |
@emph{Example:}@* |
2328 |
@* |
@* |
2329 |
@code{weechat::add_message_handler ("privmsg", my_function);}@* |
@code{weechat::add_message_handler ("privmsg", my_function);}@* |
2357 |
arguments (displayed by /help command) |
arguments (displayed by /help command) |
2358 |
@end itemize |
@end itemize |
2359 |
@* |
@* |
2360 |
|
@emph{Return value:}@* |
2361 |
|
@* |
2362 |
|
1 if Perl function was attached, 0 if error occured.@* |
2363 |
|
@* |
2364 |
@emph{Example:}@* |
@emph{Example:}@* |
2365 |
@* |
@* |
2366 |
@code{weechat::add_command_handler ("command", my_command);}@* |
@code{weechat::add_command_handler ("command", my_command);}@* |
2372 |
@* |
@* |
2373 |
|
|
2374 |
@item |
@item |
2375 |
|
@command{weechat::remove_handler ( name, function );}@* |
2376 |
|
@* |
2377 |
|
Remove a message or command handler.@* |
2378 |
|
|
2379 |
|
@emph{Arguments:} |
2380 |
|
@itemize @minus |
2381 |
|
@item @option{name}: name of IRC message or command handler |
2382 |
|
@item @option{function}: Perl function |
2383 |
|
@end itemize |
2384 |
|
@* |
2385 |
|
@emph{Return value:}@* |
2386 |
|
@* |
2387 |
|
1 if successful, 0 if error occured.@* |
2388 |
|
@* |
2389 |
|
@emph{Example:}@* |
2390 |
|
@* |
2391 |
|
@code{weechat::remove_handler ("command", my_command);}@* |
2392 |
|
@* |
2393 |
|
|
2394 |
|
@item |
2395 |
@command{weechat::command ( command, [channel, [server]] );}@* |
@command{weechat::command ( command, [channel, [server]] );}@* |
2396 |
@* |
@* |
2397 |
Execute a command or send a message to a channel.@* |
Execute a command or send a message to a channel.@* |
2403 |
@item @option{server}: internal name of server |
@item @option{server}: internal name of server |
2404 |
@end itemize |
@end itemize |
2405 |
@* |
@* |
2406 |
|
@emph{Return value:}@* |
2407 |
|
@* |
2408 |
|
1 if successful, 0 if error occured.@* |
2409 |
|
@* |
2410 |
@emph{Examples:}@* |
@emph{Examples:}@* |
2411 |
@* |
@* |
2412 |
@code{weechat::command ("hello world!");}@* |
@code{weechat::command ("hello world!");}@* |
2437 |
@item @option{channel}: channel name |
@item @option{channel}: channel name |
2438 |
@end itemize |
@end itemize |
2439 |
@* |
@* |
2440 |
|
@emph{Return value:}@* |
2441 |
|
@* |
2442 |
|
Asked info, empty if error occured or info was not found.@* |
2443 |
|
@* |
2444 |
@emph{Examples:}@* |
@emph{Examples:}@* |
2445 |
@* |
@* |
2446 |
@code{$version = weechat::get_info("version");}@* |
@code{$version = weechat::get_info("version");}@* |
2485 |
@item bytes_per_sec: bytes sent/received per second |
@item bytes_per_sec: bytes sent/received per second |
2486 |
@end itemize |
@end itemize |
2487 |
@* |
@* |
2488 |
|
@emph{Return value:}@* |
2489 |
|
@* |
2490 |
|
DCC list, 0 if error occured.@* |
2491 |
|
@* |
2492 |
|
|
2493 |
@item |
@item |
2494 |
@command{weechat::get_config ( name );}@* |
@command{weechat::get_config ( option );}@* |
2495 |
@* |
@* |
2496 |
Get WeeChat config option value.@* |
Get WeeChat config option value.@* |
2497 |
|
|
2498 |
@emph{Arguments:} |
@emph{Arguments:} |
2499 |
@itemize @minus |
@itemize @minus |
2500 |
@item @option{name}: name of option |
@item @option{option}: name of option |
2501 |
@end itemize |
@end itemize |
2502 |
@* |
@* |
2503 |
|
@emph{Return value:}@* |
2504 |
|
@* |
2505 |
|
Value of option, empty if error occured or option was not found.@* |
2506 |
|
@* |
2507 |
@emph{Examples:}@* |
@emph{Examples:}@* |
2508 |
@* |
@* |
2509 |
@code{$value1 = weechat::get_config ("look_set_title");}@* |
@code{$value1 = weechat::get_config ("look_nicklist");}@* |
2510 |
@code{$value2 = weechat::get_config ("freenode.server_autojoin");}@* |
@code{$value2 = weechat::get_config ("freenode.server_autojoin");}@* |
2511 |
@* |
@* |
2512 |
|
|
2513 |
|
@item |
2514 |
|
@command{weechat::set_config ( option, value );}@* |
2515 |
|
@* |
2516 |
|
Get WeeChat config option value.@* |
2517 |
|
|
2518 |
|
@emph{Arguments:} |
2519 |
|
@itemize @minus |
2520 |
|
@item @option{option}: name of option |
2521 |
|
@item @option{value}: new value for option |
2522 |
|
@end itemize |
2523 |
|
@* |
2524 |
|
@emph{Return value:}@* |
2525 |
|
@* |
2526 |
|
1 if successful, 0 if error occured.@* |
2527 |
|
@* |
2528 |
|
@emph{Examples:}@* |
2529 |
|
@* |
2530 |
|
@code{weechat::set_config ("look_nicklist", "off");}@* |
2531 |
|
@code{weechat::set_config ("freenode.server_autojoin"", "#weechat");}@* |
2532 |
|
@* |
2533 |
|
|
2534 |
|
@item |
2535 |
|
@command{weechat::get_plugin_config ( option );}@* |
2536 |
|
@* |
2537 |
|
Return value of a plugin option.@* |
2538 |
|
Option is read from file ~/.weechat/plugins.rc and is like:@* |
2539 |
|
@code{plugin.script.option=value}@* |
2540 |
|
Note: plugin and script names are automatically added.@* |
2541 |
|
|
2542 |
|
@emph{Arguments:} |
2543 |
|
@itemize @minus |
2544 |
|
@item @option{option}: name of option |
2545 |
|
@end itemize |
2546 |
|
@* |
2547 |
|
@emph{Return value:}@* |
2548 |
|
@* |
2549 |
|
Value of option, empty if error occured or option was not found.@* |
2550 |
|
@* |
2551 |
|
@emph{Example:}@* |
2552 |
|
@* |
2553 |
|
@code{$value = weechat::get_plugin_config ("my_var");}@* |
2554 |
|
@* |
2555 |
|
|
2556 |
|
@item |
2557 |
|
@command{weechat::set_plugin_config ( option, value );}@* |
2558 |
|
@* |
2559 |
|
Update value of a plugin option.@* |
2560 |
|
Option is written in file ~/.weechat/plugins.rc and is like:@* |
2561 |
|
@code{plugin.script.option=value}@* |
2562 |
|
Note: plugin and script names are automatically added.@* |
2563 |
|
|
2564 |
|
@emph{Arguments:} |
2565 |
|
@itemize @minus |
2566 |
|
@item @option{option}: name of option |
2567 |
|
@item @option{value}: new value for option |
2568 |
|
@end itemize |
2569 |
|
@* |
2570 |
|
@emph{Return value:}@* |
2571 |
|
@* |
2572 |
|
1 if successful, 0 if error occured.@* |
2573 |
|
@* |
2574 |
|
@emph{Example:}@* |
2575 |
|
@* |
2576 |
|
@code{weechat::set_plugin_config ("my_var", "value");}@* |
2577 |
|
@* |
2578 |
|
|
2579 |
@end itemize |
@end itemize |
2580 |
|
|
2581 |
@subsection Python scripts |
@subsection Python scripts |
2614 |
@item @option{description}: short description of script. |
@item @option{description}: short description of script. |
2615 |
@end itemize |
@end itemize |
2616 |
@* |
@* |
2617 |
|
@emph{Return value:}@* |
2618 |
|
@* |
2619 |
|
1 if script was registered, 0 if error occured.@* |
2620 |
|
@* |
2621 |
@emph{Example:}@* |
@emph{Example:}@* |
2622 |
@* |
@* |
2623 |
@code{weechat.register ("sample", "1.0", "sample_end", "Sample script!")}@* |
@code{weechat.register ("sample", "1.0", "sample_end", "Sample script!")}@* |
2635 |
@item @option{server}: internal name of server |
@item @option{server}: internal name of server |
2636 |
@end itemize |
@end itemize |
2637 |
@* |
@* |
2638 |
|
@emph{Return value:}@* |
2639 |
|
@* |
2640 |
|
1 if successful, 0 if error occured.@* |
2641 |
|
@* |
2642 |
@emph{Examples:}@* |
@emph{Examples:}@* |
2643 |
@* |
@* |
2644 |
@code{weechat.prnt ("message")}@* |
@code{weechat.prnt ("message")}@* |
2658 |
@item @option{message}: message to display |
@item @option{message}: message to display |
2659 |
@end itemize |
@end itemize |
2660 |
@* |
@* |
2661 |
|
@emph{Return value:}@* |
2662 |
|
@* |
2663 |
|
1 if successful, 0 if error occured.@* |
2664 |
|
@* |
2665 |
@emph{Example:}@* |
@emph{Example:}@* |
2666 |
@* |
@* |
2667 |
@code{weechat.print_infobar (5, "message")}@* |
@code{weechat.print_infobar (5, "message")}@* |
2682 |
@item @option{function}: Python function called when message is received |
@item @option{function}: Python function called when message is received |
2683 |
@end itemize |
@end itemize |
2684 |
@* |
@* |
2685 |
|
@emph{Return value:}@* |
2686 |
|
@* |
2687 |
|
1 if Python function was attached, 0 if error occured.@* |
2688 |
|
@* |
2689 |
@emph{Example:}@* |
@emph{Example:}@* |
2690 |
@* |
@* |
2691 |
@code{weechat.add_message_handler ("privmsg", my_function)}@* |
@code{weechat.add_message_handler ("privmsg", my_function)}@* |
2717 |
arguments (displayed by /help command) |
arguments (displayed by /help command) |
2718 |
@end itemize |
@end itemize |
2719 |
@* |
@* |
2720 |
|
@emph{Return value:}@* |
2721 |
|
@* |
2722 |
|
1 if Python function was attached, 0 if error occured.@* |
2723 |
|
@* |
2724 |
@emph{Example:}@* |
@emph{Example:}@* |
2725 |
@* |
@* |
2726 |
@code{weechat.add_command_handler ("command", my_command)}@* |
@code{weechat.add_command_handler ("command", my_command)}@* |
2729 |
@* |
@* |
2730 |
|
|
2731 |
@item |
@item |
2732 |
|
@command{weechat.remove_handler ( name, function );}@* |
2733 |
|
@* |
2734 |
|
Remove a message or command handler.@* |
2735 |
|
|
2736 |
|
@emph{Arguments:} |
2737 |
|
@itemize @minus |
2738 |
|
@item @option{name}: name of IRC message or command handler |
2739 |
|
@item @option{function}: Python function |
2740 |
|
@end itemize |
2741 |
|
@* |
2742 |
|
@emph{Return value:}@* |
2743 |
|
@* |
2744 |
|
1 if successful, 0 if error occured.@* |
2745 |
|
@* |
2746 |
|
@emph{Example:}@* |
2747 |
|
@* |
2748 |
|
@code{weechat.remove_handler ("command", my_command);}@* |
2749 |
|
@* |
2750 |
|
|
2751 |
|
@item |
2752 |
@command{weechat.command ( command, [channel, [server]] )}@* |
@command{weechat.command ( command, [channel, [server]] )}@* |
2753 |
@* |
@* |
2754 |
Execute a command or send a message to a channel.@* |
Execute a command or send a message to a channel.@* |
2760 |
@item @option{server}: internal name of server |
@item @option{server}: internal name of server |
2761 |
@end itemize |
@end itemize |
2762 |
@* |
@* |
2763 |
|
@emph{Return value:}@* |
2764 |
|
@* |
2765 |
|
1 if successful, 0 if error occured.@* |
2766 |
|
@* |
2767 |
@emph{Examples:}@* |
@emph{Examples:}@* |
2768 |
@* |
@* |
2769 |
@code{weechat.command ("hello world!")}@* |
@code{weechat.command ("hello world!")}@* |
2793 |
@item @option{server}: internal name of server |
@item @option{server}: internal name of server |
2794 |
@end itemize |
@end itemize |
2795 |
@* |
@* |
2796 |
|
@emph{Return value:}@* |
2797 |
|
@* |
2798 |
|
Asked info, empty if error occured or info was not found.@* |
2799 |
|
@* |
2800 |
@emph{Examples:}@* |
@emph{Examples:}@* |
2801 |
@* |
@* |
2802 |
@code{$version = weechat.get_info("version")}@* |
@code{$version = weechat.get_info("version")}@* |
2841 |
@item bytes_per_sec: bytes sent/received per second |
@item bytes_per_sec: bytes sent/received per second |
2842 |
@end itemize |
@end itemize |
2843 |
@* |
@* |
2844 |
|
@emph{Return value:}@* |
2845 |
|
@* |
2846 |
|
DCC list, 0 if error occured.@* |
2847 |
|
@* |
2848 |
|
|
2849 |
@item |
@item |
2850 |
@command{weechat.get_config ( name );}@* |
@command{weechat.get_config ( option );}@* |
2851 |
@* |
@* |
2852 |
Get WeeChat config option value.@* |
Get WeeChat config option value.@* |
2853 |
|
|
2854 |
@emph{Arguments:} |
@emph{Arguments:} |
2855 |
@itemize @minus |
@itemize @minus |
2856 |
@item @option{name}: name of option |
@item @option{option}: name of option |
2857 |
@end itemize |
@end itemize |
2858 |
@* |
@* |
2859 |
|
@emph{Return value:}@* |
2860 |
|
@* |
2861 |
|
Value of option, empty if error occured or option was not found.@* |
2862 |
|
@* |
2863 |
@emph{Examples:}@* |
@emph{Examples:}@* |
2864 |
@* |
@* |
2865 |
@code{$value1 = weechat.get_config ("look_set_title");}@* |
@code{$value1 = weechat.get_config ("look_nicklist");}@* |
2866 |
@code{$value2 = weechat.get_config ("freenode.server_autojoin");}@* |
@code{$value2 = weechat.get_config ("freenode.server_autojoin");}@* |
2867 |
@* |
@* |
2868 |
|
|
2869 |
|
@item |
2870 |
|
@command{weechat.set_config ( option, value );}@* |
2871 |
|
@* |
2872 |
|
Get WeeChat config option value.@* |
2873 |
|
|
2874 |
|
@emph{Arguments:} |
2875 |
|
@itemize @minus |
2876 |
|
@item @option{option}: name of option |
2877 |
|
@item @option{value}: new value for option |
2878 |
|
@end itemize |
2879 |
|
@* |
2880 |
|
@emph{Return value:}@* |
2881 |
|
@* |
2882 |
|
1 if successful, 0 if error occured.@* |
2883 |
|
@* |
2884 |
|
@emph{Examples:}@* |
2885 |
|
@* |
2886 |
|
@code{weechat.set_config ("look_nicklist", "off");}@* |
2887 |
|
@code{weechat.set_config ("freenode.server_autojoin"", "#weechat");}@* |
2888 |
|
@* |
2889 |
|
|
2890 |
|
@item |
2891 |
|
@command{weechat.get_plugin_config ( option );}@* |
2892 |
|
@* |
2893 |
|
Return value of a plugin option.@* |
2894 |
|
Option is read from file ~/.weechat/plugins.rc and is like:@* |
2895 |
|
@code{plugin.script.option=value}@* |
2896 |
|
Note: plugin and script names are automatically added.@* |
2897 |
|
|
2898 |
|
@emph{Arguments:} |
2899 |
|
@itemize @minus |
2900 |
|
@item @option{option}: name of option |
2901 |
|
@end itemize |
2902 |
|
@* |
2903 |
|
@emph{Return value:}@* |
2904 |
|
@* |
2905 |
|
Value of option, empty if error occured or option was not found.@* |
2906 |
|
@* |
2907 |
|
@emph{Example:}@* |
2908 |
|
@* |
2909 |
|
@code{$value = weechat.get_plugin_config ("my_var");}@* |
2910 |
|
@* |
2911 |
|
|
2912 |
|
@item |
2913 |
|
@command{weechat.set_plugin_config ( option, value );}@* |
2914 |
|
@* |
2915 |
|
Update value of a plugin option.@* |
2916 |
|
Option is written in file ~/.weechat/plugins.rc and is like:@* |
2917 |
|
@code{plugin.script.option=value}@* |
2918 |
|
Note: plugin and script names are automatically added.@* |
2919 |
|
|
2920 |
|
@emph{Arguments:} |
2921 |
|
@itemize @minus |
2922 |
|
@item @option{option}: name of option |
2923 |
|
@item @option{value}: new value for option |
2924 |
|
@end itemize |
2925 |
|
@* |
2926 |
|
@emph{Return value:}@* |
2927 |
|
@* |
2928 |
|
1 if successful, 0 if error occured.@* |
2929 |
|
@* |
2930 |
|
@emph{Example:}@* |
2931 |
|
@* |
2932 |
|
@code{weechat.set_plugin_config ("my_var", "value");}@* |
2933 |
|
@* |
2934 |
|
|
2935 |
@end itemize |
@end itemize |
2936 |
|
|
2937 |
@subsection Ruby scripts |
@subsection Ruby scripts |