From 8ba9c7c1f8f17e849922152463c122ee710cba9b Mon Sep 17 00:00:00 2001 From: "cyeh%netscape.com" Date: Thu, 14 Oct 1999 00:44:37 +0000 Subject: [PATCH] move megahal initialization so that if there is a nick collision and we die, we at least don't leave a forked process behind. git-svn-id: svn://10.0.0.236/trunk@50631 18797224-902f-48f8-a5cc-f745e15eee43 --- mozilla/webtools/mozbot/mozbot.pl | 23 +++++++++++------------ 1 file changed, 11 insertions(+), 12 deletions(-) diff --git a/mozilla/webtools/mozbot/mozbot.pl b/mozilla/webtools/mozbot/mozbot.pl index 4a7e93a4a7d..45b987cc7d3 100755 --- a/mozilla/webtools/mozbot/mozbot.pl +++ b/mozilla/webtools/mozbot/mozbot.pl @@ -138,17 +138,6 @@ $::uuid = "./uuidgen/uuidgen"; $::uuid = (-f $::uuid) ? $::uuid : ""; delete $pubcmds{'uuid'} if (! $::uuid); -$::megahal = "./megahal/megahal"; -$::megahal = (-f $::megahal) ? $::megahal : ""; -$::megahal_pid; - -if ($::megahal) { - $::WTR = FileHandle->new; - $::RDR = FileHandle->new; - $::megahal_pid = &init_megahal; - &debug ("Initializing MEGAHAL conversation AI\n"); -} - my $phase; my $last_moon = 0; my $last_uuid = 0; @@ -209,9 +198,19 @@ foreach my $i (keys %rdfcmds) { $pubcmds{$i} = $rdfcmds{$i}; } - &debug ("connecting to $server $port as $nick on $channel"); +$::megahal = "./megahal/megahal"; +$::megahal = (-f $::megahal) ? $::megahal : ""; +$::megahal_pid; + +if ($::megahal) { + $::WTR = FileHandle->new; + $::RDR = FileHandle->new; + $::megahal_pid = &init_megahal; + &debug ("Initializing MEGAHAL conversation AI\n"); +} + # and done.