author | Myhailo Danylenko <isbear@ukrpost.net> |
Fri, 15 Jan 2010 11:03:59 +0200 | |
changeset 88 | 9b5c2357fad7 |
parent 86 | 9b98ea6c73f6 |
child 121 | 75a7d595817c |
permissions | -rw-r--r-- |
85 | 1 |
|
2 |
How to use these scrpits (and how they are organized): |
|
3 |
||
4 |
Scripts are generally separated into two classes - library |
|
5 |
(those in lm subdirectory), that deal mainly with lm and xmpp |
|
6 |
stuff, and mcabber, that provide mcabber interface for library |
|
7 |
scripts - mcabber commands, mcabber message handlers, etc. |
|
8 |
||
9 |
Most of mcabber scripts expect to be require'd from |
|
10 |
mcabberrc.lua, that will provide common hook and help |
|
11 |
infrastructure. For 'require' to find scripts, you need to |
|
12 |
properly set package.path, and in mcabberrc.lua there is |
|
13 |
example of this on the beginning. Some of this functionality |
|
14 |
is already implemented in C (and implemented better), so, |
|
15 |
first look at Modules wiki page. |
|
16 |
||
17 |
However, seems like forms interface is better to be left as |
|
18 |
it is implemented now - it will be too complex, when implemented |
|
19 |
in C, to be really convenient and easy to add other form types. |
|
20 |
So, I have no plans on converting forms and all functionality, |
|
21 |
that depends on it to binary C modules. This includes remote |
|
22 |
commands, registration to jabber entities, muc room administration |
|
23 |
and some more. |
|
24 |
||
25 |
So, first you need to get development version of mcabber, compiled |
|
26 |
with --modules-enable. Then you need to build this module. For |
|
27 |
that see README in top-level dir. |
|
28 |
||
29 |
Then you need to set modules_dir in your mcabberrc to point to |
|
30 |
directory, where your modules will reside. Now you can issue |
|
31 |
'/load lua' command and get module working. It will provide one |
|
32 |
command - '/lua' (and also some lua functions to allow lua to |
|
33 |
manipulate mcabber to some extent), that evaluates specified |
|
34 |
lua expression. |
|
35 |
||
36 |
Lua module allows to automatically run specified lua file at |
|
37 |
module loading. The name of this file is determined from variable |
|
38 |
lua_init_filename. To use these scripts it should point to |
|
39 |
your edited version of mcabberrc.lua. Also there are some other |
|
40 |
variables, that need to be set up for proper scripts functioning, |
|
41 |
you can find these values in lua.rc. Note, though, that some |
|
42 |
scripts are now unused by me and generally are considered only |
|
43 |
as example - eg jobs, marking etc. In mcabberrc.lua you should |
|
44 |
edit (if necessary) pacakage.path on beginning and set of |
|
45 |
require'd scripts in the end. Rigth now I am using transports, |
|
46 |
room_priv, forms, privacy, muc, vcard, oob, register, remote and |
|
47 |
attention scripts. |
|
48 |
||
49 |
Amongst these muc, vcard, register and remote depend on forms, |
|
50 |
and thus have no hope to be implemented in C in near future. |
|
51 |
||
86
9b98ea6c73f6
Note about external modules
Myhailo Danylenko <isbear@ukrpost.net>
parents:
85
diff
changeset
|
52 |
Ah, and almost forgot to mention - for some of the scripts you |
9b98ea6c73f6
Note about external modules
Myhailo Danylenko <isbear@ukrpost.net>
parents:
85
diff
changeset
|
53 |
need some external lua modules. First, it is lua-lm - lua |
9b98ea6c73f6
Note about external modules
Myhailo Danylenko <isbear@ukrpost.net>
parents:
85
diff
changeset
|
54 |
interface to loudmouth. It is written by me, and thus can be |
9b98ea6c73f6
Note about external modules
Myhailo Danylenko <isbear@ukrpost.net>
parents:
85
diff
changeset
|
55 |
fond at the same place, where you find a lua mcabber module. |
9b98ea6c73f6
Note about external modules
Myhailo Danylenko <isbear@ukrpost.net>
parents:
85
diff
changeset
|
56 |
Others are posix, base64, socket, sha1 and md5. First three were |
9b98ea6c73f6
Note about external modules
Myhailo Danylenko <isbear@ukrpost.net>
parents:
85
diff
changeset
|
57 |
until recent time in Debian repository. Latter two are built from |
9b98ea6c73f6
Note about external modules
Myhailo Danylenko <isbear@ukrpost.net>
parents:
85
diff
changeset
|
58 |
one source at http://www.inf.puc-rio.br/~roberto/md5/md5-5/md5.html. |
9b98ea6c73f6
Note about external modules
Myhailo Danylenko <isbear@ukrpost.net>
parents:
85
diff
changeset
|
59 |
You can find out, which modules require your scripts by looking at |
9b98ea6c73f6
Note about external modules
Myhailo Danylenko <isbear@ukrpost.net>
parents:
85
diff
changeset
|
60 |
'require' lines at the beginning (do not forget to look at scripts, |
9b98ea6c73f6
Note about external modules
Myhailo Danylenko <isbear@ukrpost.net>
parents:
85
diff
changeset
|
61 |
that are require'd by this script). |
9b98ea6c73f6
Note about external modules
Myhailo Danylenko <isbear@ukrpost.net>
parents:
85
diff
changeset
|
62 |
|
85 | 63 |
-- Myhailo Danylenko <isbear@ukrpost.net> |
64 |