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