/[weechat]/weechat/doc/weechat_doc_en.texi
ViewVC logotype

Diff of /weechat/doc/weechat_doc_en.texi

Parent Directory Parent Directory | Revision Log Revision Log | View Patch Patch

revision 1.24 by flashcode, Sat Apr 30 19:21:28 2005 UTC revision 1.25 by flashcode, Sat May 7 22:53:05 2005 UTC
# Line 35  Line 35 
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.2-cvs - April, 30 2005  @subtitle Documentation for WeeChat v0.1.2-cvs - May, 08 2005
39    
40  @image{weechat_image}  @image{weechat_image}
41    
# Line 765  display help about commands@* Line 765  display help about commands@*
765  @*  @*
766  command: name of a WeeChat or IRC command@*  command: name of a WeeChat or IRC command@*
767  @*  @*
768  @item perl  [load filename] | [autoload] | [unload]  @item perl  [load filename] | [autoload] | [reload] | [unload]
769  @*  @*
770  list/load/unload Perl scripts@*  list/load/unload Perl scripts@*
771  @*  @*
772  filename: Perl script (file) to load@*  filename: Perl script (file) to load@*
773  Without argument, /perl command lists all loaded Perl scripts.@*  Without argument, /perl command lists all loaded Perl scripts.@*
774  @*  @*
775    @item python  [load filename] | [autoload] | [reload] | [unload]
776    @*
777    list/load/unload Python scripts@*
778    @*
779    filename: Python script (file) to load@*
780    Without argument, /python command lists all loaded Python scripts.@*
781    @*
782  @item server  [servername] | [servername hostname port [-auto | -noauto] [-pwd password] [-nicks nick1 [nick2 [nick3]]] [-username username] [-realname realname] [-command command] [-autojoin channel[,channel]] ] | [del servername]  @item server  [servername] | [servername hostname port [-auto | -noauto] [-pwd password] [-nicks nick1 [nick2 [nick3]]] [-username username] [-realname realname] [-command command] [-autojoin channel[,channel]] ] | [del servername]
783  @*  @*
784  list, add or remove servers@*  list, add or remove servers@*
# Line 995  list nicknames on channels@* Line 1002  list nicknames on channels@*
1002  @*  @*
1003  channel: channel name@*  channel: channel name@*
1004  @*  @*
1005  @item nick  nickname  @item nick  [-all] nickname
1006  @*  @*
1007  change current nickname@*  change current nickname@*
1008  @*  @*
1009  nickname: new nickname for current IRC server@*  -all: set new nickname for all connected servers@*
1010    nickname: new nickname@*
1011  @*  @*
1012  @item notice  nickname text  @item notice  nickname text
1013  @*  @*
# Line 1266  List all Perl scripts: @kbd{/perl}@* Line 1274  List all Perl scripts: @kbd{/perl}@*
1274    
1275  @itemize @bullet  @itemize @bullet
1276  @item  @item
1277  @command{IRC::register ( name, version, shutdown_function, description );}@*  @command{weechat::register ( name, version, shutdown_function, description );}@*
1278  @*  @*
1279  This is first function to call in Perl script.@*  This is first function to call in Perl script.@*
1280  All Perl scripts for WeeChat should call this function.@*  All Perl scripts for WeeChat should call this function.@*
# Line 1282  unloaded (optional parameter, empty stri Line 1290  unloaded (optional parameter, empty stri
1290  @end itemize  @end itemize
1291  @*  @*
1292  @emph{Example:}@*  @emph{Example:}@*
1293  @code{IRC::register ("sample", "1.0", "sample_end", "Sample script!");}@*  @code{weechat::register ("sample", "1.0", "sample_end", "Sample script!");}@*
 @*  
   
 @item  
 @command{IRC::print ( message );}@*  
 @*  
 Print message in current window (channel or server).@*  
   
 @emph{Arguments:}  
 @itemize @minus  
 @item @option{message}: message to display  
 @end itemize  
 @*  
 @emph{Example:}@*  
 @code{IRC::print ("message");}@*  
1294  @*  @*
1295    
1296  @item  @item
1297  @command{IRC::print_with_channel ( channel, [server,] message );}@*  @command{weechat::print ( message, [channel, [server]] );}@*
1298  @*  @*
1299  Print message in a channel.@*  Print message in a channel.@*
1300    
1301  @emph{Arguments:}  @emph{Arguments:}
1302  @itemize @minus  @itemize @minus
1303    @item @option{message}: message to display
1304  @item @option{channel}: name of channel  @item @option{channel}: name of channel
1305  @item @option{server}: internal name of server  @item @option{server}: internal name of server
 @item @option{message}: message to display  
1306  @end itemize  @end itemize
1307  @*  @*
1308  @emph{Examples:}@*  @emph{Examples:}@*
1309  @code{IRC::print_with_channel ("#weechat", "freenode", "message");}@*  @code{weechat::print ("message");}@*
1310  @code{IRC::print_with_channel ("#weechat", "message");}@*  @code{weechat::print ("message", "#weechat");}@*
1311    @code{weechat::print ("message", "#weechat", "freenode");}@*
1312  @*  @*
1313    
1314  @item  @item
1315  @command{IRC::print_infobar ( delay, message );}@*  @command{weechat::print_infobar ( delay, message );}@*
1316  @*  @*
1317  Print message in infobar.@*  Print message in infobar.@*
1318    
# Line 1329  Print message in infobar.@* Line 1324  Print message in infobar.@*
1324  @end itemize  @end itemize
1325  @*  @*
1326  @emph{Example:}@*  @emph{Example:}@*
1327  @code{IRC::print_infobar (5, "message");}@*  @code{weechat::print_infobar (5, "message");}@*
1328  @*  @*
1329    
1330  @item  @item
1331  @command{IRC::add_message_handler ( name, function );}@*  @command{weechat::add_message_handler ( name, function );}@*
1332  @*  @*
1333  Attach a Perl function to an IRC message.@*  Attach a Perl function to an IRC message.@*
1334  Function will be called each time IRC message will be received.@*  Function will be called each time IRC message will be received.@*
# Line 1348  RFC 2812: @uref{ftp://ftp.rfc-editor.org Line 1343  RFC 2812: @uref{ftp://ftp.rfc-editor.org
1343  @end itemize  @end itemize
1344  @*  @*
1345  @emph{Example:}@*  @emph{Example:}@*
1346  @code{IRC::add_message_handler ("privmsg", my_function);}@*  @code{weechat::add_message_handler ("privmsg", my_function);}@*
1347  @code{sub my_function}@*  @code{sub my_function}@*
1348  @code{@{ }@*  @code{@{ }@*
1349  @code{@ @ @ @ IRC::print ("server=$_[0]\n");}@*  @code{@ @ @ @ weechat::print ("server=$_[0]\n");}@*
1350  @code{@ @ @ @ ($null, $channel, $message) = split ":",$_[1],3;}@*  @code{@ @ @ @ ($null, $channel, $message) = split ":",$_[1],3;}@*
1351  @code{@ @ @ @ ($hostmask, $null, $channel) = split " ", $channel;}@*  @code{@ @ @ @ ($hostmask, $null, $channel) = split " ", $channel;}@*
1352  @code{@ @ @ @ IRC::print ("host=$hostmask, chan=$channel, msg=$message\n");}@*  @code{@ @ @ @ weechat::print ("host=$hostmask, chan=$channel, msg=$message\n");}@*
1353  @code{@} }@*  @code{@} }@*
1354  @*  @*
1355    
1356  @item  @item
1357  @command{IRC::add_command_handler ( name, function );}@*  @command{weechat::add_command_handler ( name, function );}@*
1358  @*  @*
1359  Create new WeeChat command, linked with Perl function.@*  Create new WeeChat command, linked with Perl function.@*
1360  Function will be called when user will launch command with @kbd{/name}.@*  Function will be called when user will launch command with @kbd{/name}.@*
# Line 1374  available until your Perl script will be Line 1369  available until your Perl script will be
1369  @end itemize  @end itemize
1370  @*  @*
1371  @emph{Example:}@*  @emph{Example:}@*
1372  @code{IRC::add_command_handler ("command", my_command);}@*  @code{weechat::add_command_handler ("command", my_command);}@*
1373  @code{sub my_command}@*  @code{sub my_command}@*
1374  @code{@{ }@*  @code{@{ }@*
1375  @code{@ @ @ @ IRC::print("Server: $_[0], arguments: $_[1]\n");}@*  @code{@ @ @ @ weechat::print("Server: $_[0], arguments: $_[1]\n");}@*
1376  @code{@ @ @ @ return 0;}@*  @code{@ @ @ @ return 0;}@*
1377  @code{@} }@*  @code{@} }@*
1378  @*  @*
1379    
1380  @item  @item
1381  @command{IRC::get_info ( [server,] name );}@*  @command{weechat::command ( command, [channel, [server]] );}@*
1382  @*  @*
1383  Get various info about WeeChat, server or user.@*  Execute a command or send a message to a channel.@*
1384    
1385  @emph{Arguments:}  @emph{Arguments:}
1386  @itemize @minus  @itemize @minus
1387    @item @option{command}: command to execute (or message to send in a channel)
1388    @item @option{channel}: name of channel
1389  @item @option{server}: internal name of server  @item @option{server}: internal name of server
1390    @end itemize
1391    @*
1392    @emph{Examples:}@*
1393    @code{weechat::command ("hello world!");}@*
1394    @code{weechat::command ("/kick toto please leave this chan", "#weechat");}@*
1395    @code{weechat::command ("/nick newnick", "", "freenode");}@*
1396    @*
1397    
1398    @item
1399    @command{weechat::get_info ( name, [server] );}@*
1400    @*
1401    Get various info about WeeChat, server or user.@*
1402    
1403    @emph{Arguments:}
1404    @itemize @minus
1405  @item @option{name}: name of info to retrieve:  @item @option{name}: name of info to retrieve:
1406    @item @option{server}: internal name of server
1407  @itemize @minus  @itemize @minus
1408  @item @option{0 or version}: get WeeChat version  @item @option{0 or version}: get WeeChat version
1409  @item @option{1 or nick}: get nickname  @item @option{1 or nick}: get nickname
# Line 1403  Get various info about WeeChat, server o Line 1416  Get various info about WeeChat, server o
1416  @*  @*
1417  @emph{Examples:}@*  @emph{Examples:}@*
1418  @code{$version = get_info("version");}@*  @code{$version = get_info("version");}@*
1419  @code{$nick = get_info("freenode", "nick");}@*  @code{$nick = get_info("nick", "freenode");}@*
1420  @*  @*
1421    
1422  @end itemize  @end itemize
# Line 1411  Get various info about WeeChat, server o Line 1424  Get various info about WeeChat, server o
1424  @node Python scripts, Ruby scripts, Perl scripts, Extensions  @node Python scripts, Ruby scripts, Perl scripts, Extensions
1425  @section Python scripts  @section Python scripts
1426    
1427  Not developed!  @subsection Load/unload Python scripts
1428    
1429    Python scripts are loaded and unloaded with @command{/python} command.
1430    (type @kbd{/help python} within WeeChat to get help about command).@*
1431    
1432    @emph{Examples:}@*
1433    @itemize @bullet
1434    @item
1435    Load a Python script: @kbd{/python load /tmp/sample.py}@*
1436    @item
1437    Unload all Python scripts: @kbd{/python unload}@*
1438    @item
1439    List all Python scripts: @kbd{/python}@*
1440    @end itemize
1441    
1442    @subsection WeeChat / Python API
1443    
1444    @itemize @bullet
1445    @item
1446    @command{weechat.register ( name, version, shutdown_function, description );}@*
1447    @*
1448    This is first function to call in Python script.@*
1449    All Python scripts for WeeChat should call this function.@*
1450    
1451    @emph{Arguments:}
1452    @itemize @minus
1453    @item @option{name}: unique name to identify script (each script must have
1454    unique name)
1455    @item @option{version}: script's version
1456    @item @option{shutdown_function}: Python function called when script is
1457    unloaded (optional parameter, empty string means nothing is called at the end)
1458    @item @option{description}: short description of script.
1459    @end itemize
1460    @*
1461    @emph{Example:}@*
1462    @code{weechat.register ("sample", "1.0", "sample_end", "Sample script!");}@*
1463    @*
1464    
1465    @item
1466    @command{weechat.prnt ( message, [channel, [server]] );}@*
1467    @*
1468    Print message in a channel.@*
1469    
1470    @emph{Arguments:}
1471    @itemize @minus
1472    @item @option{message}: message to display
1473    @item @option{channel}: name of channel
1474    @item @option{server}: internal name of server
1475    @end itemize
1476    @*
1477    @emph{Examples:}@*
1478    @code{weechat.prnt ("message");}@*
1479    @code{weechat.prnt ("message", "#weechat");}@*
1480    @code{weechat.prnt ("message", "#weechat", "freenode");}@*
1481    @*
1482    
1483    @item
1484    @command{weechat.print_infobar ( delay, message );}@*
1485    @*
1486    Print message in infobar.@*
1487    
1488    @emph{Arguments:}
1489    @itemize @minus
1490    @item @option{delay}: after this delay (in seconds), message will be erased
1491    (if 0, message will not be erased).
1492    @item @option{message}: message to display
1493    @end itemize
1494    @*
1495    @emph{Example:}@*
1496    @code{weechat.print_infobar (5, "message");}@*
1497    @*
1498    
1499    @item
1500    @command{weechat.add_message_handler ( name, function );}@*
1501    @*
1502    Attach a Python function to an IRC message.@*
1503    Function will be called each time IRC message will be received.@*
1504    
1505    @emph{Arguments:}
1506    @itemize @minus
1507    @item @option{name}: name of IRC message@*
1508    To know list of IRC messages, please refer to RFC 1459 and/or 2812:@*
1509    RFC 1459: @uref{ftp://ftp.rfc-editor.org/in-notes/rfc1459.txt}@*
1510    RFC 2812: @uref{ftp://ftp.rfc-editor.org/in-notes/rfc2812.txt}
1511    @item @option{function}: Python function called when message is received
1512    @end itemize
1513    @*
1514    @emph{Example:}@*
1515    @code{weechat.add_message_handler ("privmsg", my_function);}@*
1516    @code{sub my_function}@*
1517    @code{@{ }@*
1518    @code{@ @ @ @ weechat.print ("server=$_[0]\n");}@*
1519    @code{@ @ @ @ ($null, $channel, $message) = split ":",$_[1],3;}@*
1520    @code{@ @ @ @ ($hostmask, $null, $channel) = split " ", $channel;}@*
1521    @code{@ @ @ @ weechat.prnt ("host=$hostmask, chan=$channel, msg=$message\n");}@*
1522    @code{@} }@*
1523    @*
1524    
1525    @item
1526    @command{weechat.add_command_handler ( name, function );}@*
1527    @*
1528    Create new WeeChat command, linked with Python function.@*
1529    Function will be called when user will launch command with @kbd{/name}.@*
1530    
1531    @emph{Arguments:}
1532    @itemize @minus
1533    @item @option{name}: name of new command@*
1534    This name may be existing command, so that the command is overrided by
1535    Python function. Be careful when overriding WeeChat commands, they'll not be
1536    available until your Python script will be unloaded.
1537    @item @option{function}: Python function linked with command
1538    @end itemize
1539    @*
1540    @emph{Example:}@*
1541    @code{weechat.add_command_handler ("command", my_command);}@*
1542    @code{sub my_command}@*
1543    @code{@{ }@*
1544    @code{@ @ @ @ weechat.prnt("Server: $_[0], arguments: $_[1]\n");}@*
1545    @code{@ @ @ @ return 0;}@*
1546    @code{@} }@*
1547    @*
1548    
1549    @item
1550    @command{weechat.command ( command, [channel, [server]] );}@*
1551    @*
1552    Execute a command or send a message to a channel.@*
1553    
1554    @emph{Arguments:}
1555    @itemize @minus
1556    @item @option{command}: command to execute (or message to send in a channel)
1557    @item @option{channel}: name of channel
1558    @item @option{server}: internal name of server
1559    @end itemize
1560    @*
1561    @emph{Examples:}@*
1562    @code{weechat.command ("hello world!");}@*
1563    @code{weechat.command ("/kick toto please leave this chan", "#weechat");}@*
1564    @code{weechat.command ("/nick newnick", "", "freenode");}@*
1565    @*
1566    
1567    
1568    @item
1569    @command{weechat.get_info ( name, [server] );}@*
1570    @*
1571    Get various info about WeeChat, server or user.@*
1572    
1573    @emph{Arguments:}
1574    @itemize @minus
1575    @item @option{name}: name of info to retrieve:
1576    @item @option{server}: internal name of server
1577    @itemize @minus
1578    @item @option{0 or version}: get WeeChat version
1579    @item @option{1 or nick}: get nickname
1580    @item @option{2 or channel}: get channel name
1581    @item @option{3 or server}: get server name
1582    @item @option{4 or weechatdir}: get WeeChat home directory
1583    @item @option{5 or away}: get away flag for server
1584    @end itemize
1585    @end itemize
1586    @*
1587    @emph{Examples:}@*
1588    @code{$version = weechat.get_info("version");}@*
1589    @code{$nick = weechat.get_info("nick", "freenode");}@*
1590    @*
1591    
1592    @end itemize
1593    
1594  @node Ruby scripts, , Python scripts, Extensions  @node Ruby scripts, , Python scripts, Extensions
1595  @section Ruby scripts  @section Ruby scripts

Legend:
Removed from v.1.24  
changed lines
  Added in v.1.25

savannah-hackers-public@gnu.org
ViewVC Help
Powered by ViewVC 1.1.26