diff plugins/gaim.pl @ 3563:e120097bbd72

[gaim-migrate @ 3658] I made my perl script unloading not suck (as much). Now you may port your perl scripts--use gaim.pl and PERL-HOWTO as references. committer: Tailor Script <tailor@pidgin.im>
author Sean Egan <seanegan@gmail.com>
date Sat, 28 Sep 2002 08:08:14 +0000
parents cd938f18f3f8
children
line wrap: on
line diff
--- a/plugins/gaim.pl	Sat Sep 28 03:48:28 2002 +0000
+++ b/plugins/gaim.pl	Sat Sep 28 08:08:14 2002 +0000
@@ -1,5 +1,12 @@
-GAIM::register("Example", "1.0", "goodbye", "");
+sub description {
+        my($a, $b, $c, $d, $e, $f) = @_;
+        ("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 &lt;eric\@warmenhoven.org>", "http://gaim.sf.net", "/dev/null");
+}
 
+$handle = GAIM::register("Example", "1.0", "goodbye", "");
+
+GAIM::print("Perl Says", "Handle $handle");
+		
 $ver = GAIM::get_info(0);
 @ids = GAIM::get_info(1);
 
@@ -10,12 +17,11 @@
 	$msg .= "\n$nam using $pro";
 }
 
-GAIM::print("Perl Says", $msg);
 
 GAIM::command("idle", 6000);
 
-GAIM::add_event_handler("event_buddy_signon", "echo_reply");
-GAIM::add_timeout_handler(60, "notify");
+GAIM::add_event_handler($handle, "event_buddy_signon", "echo_reply");
+GAIM::add_timeout_handler($handle, 60, "notify");
 
 sub echo_reply {
 	$index = $_[0];
@@ -31,8 +37,3 @@
 	GAIM::print("You Bastard!", "You killed Kenny!");
 }
 
-sub description {
-	my($a, $b, $c, $d, $e, $f) = @_;
-		("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 &lt;eric\@warmenhoven.org>", "http://gaim.sf.net", "/dev/null");
-		}
-