2
2
:author: Sébastien Helleu
3
3
:email: flashcode@flashtux.org
10
// TRANSLATION MISSING
13
* Marco Paolone <marcopaolone@gmail.com>, 2010-2013
9
16
Questo manuale documenta il client di chat WeeChat, ed è parte
163
175
(weechat:print "" "Hello, from scheme script!")
182
weechat.register("test_js", "FlashCode", "1.0", "GPL3", "Test script", "", "");
183
weechat.print("", "Hello, from javascript script!");
167
187
=== Caricare uno script
175
195
/script load script.lua
176
196
/script load script.tcl
177
197
/script load script.scm
198
/script load script.js
180
201
Ogni linguaggio ha anche il suo comando specifico:
183
/python load python/script.py
184
/perl load perl/script.pl
185
/ruby load ruby/script.rb
186
/lua load lua/script.lua
187
/tcl load tcl/script.tcl
188
/guile load guile/script.scm
204
/python load script.py
209
/guile load script.scm
210
/javascript load script.js
191
213
È possibile creare un link nella directory 'linguaggio/autoload' per caricare
350
372
(weechat:hook_timer 1000 0 1 "timer_cb" "test")
379
function timer_cb(data, remaining_calls) {
380
weechat.print("", "timer! data=" + data);
381
return weechat.WEECHAT_RC_OK;
384
weechat.hook_timer(1000, 0, 1, "timer_cb", "test");
372
406
charset_set, iconv_to_internal, iconv_from_internal, gettext, ngettext, +
373
407
strlen_screen, string_match, string_has_highlight, string_has_highlight_regex,
374
408
string_mask_to_regex, string_remove_color, string_is_command_char,
375
string_input_for_buffer, string_eval_expression
409
string_input_for_buffer, string_eval_expression, string_eval_path_home
377
411
mkdir_home, mkdir, mkdir_parents
378
412
| liste ordinate |
803
838
weechat.hook_config("plugins.var.python." + SCRIPT_NAME + ".*", "config_cb", "")
804
# for other languages, change "python" with your language ("perl", "ruby", "lua" or "tcl")
839
# for other languages, change "python" with your language (perl/ruby/lua/tcl/guile/javascript)
807
842
[[config_options_weechat]]
892
927
È possibile verificare un messaggio irc con una info_hashtable chiamata
893
928
"irc_message_parse".
930
// TRANSLATION MISSING
931
The result is a hashtable with following keys
932
(the example values are built with this message:
933
`@time=2015-06-27T16:40:35.000Z :nick!user@host PRIVMSG #weechat :hello!`):
935
[width="100%",cols="1,^2,10,8",options="header"]
937
| Key | WeeChat version | Description | Example
940
The tags in message (can be empty) |
941
`time=2015-06-27T16:40:35.000Z`
943
| message_without_tags | ≥ 0.4.0 |
944
The message without the tags (the same as message if there are no tags) |
945
`:nick!user@host PRIVMSG #weechat :hello!`
952
The origin host (includes the nick) |
955
| command | ≥ 0.3.4 |
956
The command ('PRIVMSG', 'NOTICE', ...) |
959
| channel | ≥ 0.3.4 |
963
| arguments | ≥ 0.3.4 |
964
The command arguments (includes the channel) |
968
The text (for example user message) |
971
| pos_command | ≥ 1.3 |
972
The index of 'command' in message ("-1" if 'command' was not found) |
975
| pos_arguments | ≥ 1.3 |
976
The index of 'arguments' in message ("-1" if 'arguments' was not found) |
979
| pos_channel | ≥ 1.3 |
980
The index of 'channel' in message ("-1" if 'channel' was not found) |
984
The index of 'text' in message ("-1" if 'text' was not found) |
897
dict = weechat.info_get_hashtable("irc_message_parse",
898
{"message": ":nick!user@host PRIVMSG #weechat :message here"})
899
weechat.prnt("", "dict: %s" % dict)
990
dict = weechat.info_get_hashtable(
992
{"message": "@time=2015-06-27T16:40:35.000Z :nick!user@host PRIVMSG #weechat :hello!"})
902
# dict: {'nick': 'nick', 'host': 'nick!user@host', 'command': 'PRIVMSG', 'arguments': '#weechat :message here', 'channel': '#weechat'}
995
# "tags": "time=2015-06-27T16:40:35.000Z",
996
# "message_without_tags": ":nick!user@host PRIVMSG #weechat :hello!",
998
# "host": "nick!user@host",
999
# "command": "PRIVMSG",
1000
# "channel": "#weechat",
1001
# "arguments": "#weechat :hello!",
1003
# "pos_command": "47",
1004
# "pos_arguments": "55",
1005
# "pos_channel": "55",