Mercurial > pidgin
annotate plugins/gaim.pl @ 3551:cd938f18f3f8
[gaim-migrate @ 3626]
In the interest of continued progress, I pulled what's usable out of my
development tree and am committing it.
Here, we have gotten rid of the plugins dialog and perl menu under Tools and
put them both in preferences. Perl scripts now work like plugins--you have
to load them explicitly (it will probe $prefix/lib/gaim and $HOME/.gaim for
them) and you can unload them (although right now, this is entirely unreliable)
Oh, and I broke all your perl scripts. Sorry about that. Don't try fixing
them yet, though--I'm gonna make unloading single scripts more reliable
tommorow.
I should also finish Phase Two tommorow as well.
committer: Tailor Script <tailor@pidgin.im>
| author | Sean Egan <seanegan@gmail.com> |
|---|---|
| date | Thu, 26 Sep 2002 07:37:52 +0000 |
| parents | a83b4a5ffcd6 |
| children | e120097bbd72 |
| rev | line source |
|---|---|
| 3551 | 1 GAIM::register("Example", "1.0", "goodbye", ""); |
| 806 | 2 |
|
1526
190cef255530
[gaim-migrate @ 1536]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
806
diff
changeset
|
3 $ver = GAIM::get_info(0); |
|
2355
571971659533
[gaim-migrate @ 2368]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1526
diff
changeset
|
4 @ids = GAIM::get_info(1); |
| 806 | 5 |
|
2355
571971659533
[gaim-migrate @ 2368]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1526
diff
changeset
|
6 $msg = "Gaim $ver:"; |
|
571971659533
[gaim-migrate @ 2368]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1526
diff
changeset
|
7 foreach $id (@ids) { |
|
571971659533
[gaim-migrate @ 2368]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1526
diff
changeset
|
8 $pro = GAIM::get_info(7, $id); |
|
571971659533
[gaim-migrate @ 2368]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1526
diff
changeset
|
9 $nam = GAIM::get_info(3, $id); |
|
571971659533
[gaim-migrate @ 2368]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1526
diff
changeset
|
10 $msg .= "\n$nam using $pro"; |
|
571971659533
[gaim-migrate @ 2368]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1526
diff
changeset
|
11 } |
| 806 | 12 |
|
2355
571971659533
[gaim-migrate @ 2368]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1526
diff
changeset
|
13 GAIM::print("Perl Says", $msg); |
|
571971659533
[gaim-migrate @ 2368]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1526
diff
changeset
|
14 |
|
571971659533
[gaim-migrate @ 2368]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1526
diff
changeset
|
15 GAIM::command("idle", 6000); |
|
571971659533
[gaim-migrate @ 2368]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1526
diff
changeset
|
16 |
|
571971659533
[gaim-migrate @ 2368]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1526
diff
changeset
|
17 GAIM::add_event_handler("event_buddy_signon", "echo_reply"); |
|
571971659533
[gaim-migrate @ 2368]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1526
diff
changeset
|
18 GAIM::add_timeout_handler(60, "notify"); |
| 806 | 19 |
| 20 sub echo_reply { | |
|
2511
a83b4a5ffcd6
[gaim-migrate @ 2524]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2355
diff
changeset
|
21 $index = $_[0]; |
|
a83b4a5ffcd6
[gaim-migrate @ 2524]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2355
diff
changeset
|
22 $who = $_[1]; |
|
a83b4a5ffcd6
[gaim-migrate @ 2524]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
2355
diff
changeset
|
23 GAIM::print_to_conv($index, $who, "Hello", 0); |
| 806 | 24 } |
| 25 | |
| 26 sub notify { | |
|
2355
571971659533
[gaim-migrate @ 2368]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
1526
diff
changeset
|
27 GAIM::print("1 minute", "gaim test has been loaded for 1 minute"); |
| 806 | 28 } |
| 29 | |
| 30 sub goodbye { | |
|
1526
190cef255530
[gaim-migrate @ 1536]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
806
diff
changeset
|
31 GAIM::print("You Bastard!", "You killed Kenny!"); |
| 806 | 32 } |
| 3551 | 33 |
| 34 sub description { | |
| 35 my($a, $b, $c, $d, $e, $f) = @_; | |
| 36 ("Example", "1.0", "An example Gaim perl script that does nothing particularly useful:\n\t-Show a dialog on load\n\t-Set user idle for 6,000 seconds\n\t-Greets people signing on with \"Hello\"\n\t-Informs you when script has been loaded for one minute.", "Eric Warmenhoven <eric\@warmenhoven.org>", "http://gaim.sf.net", "/dev/null"); | |
| 37 } | |
| 38 |
