]> git.donarmstrong.com Git - infobot.git/commitdiff
move cliloop to CLI ;-)
authortimriker <timriker@c11ca15a-4712-0410-83d8-924469b57eb5>
Thu, 4 Sep 2003 17:14:01 +0000 (17:14 +0000)
committertimriker <timriker@c11ca15a-4712-0410-83d8-924469b57eb5>
Thu, 4 Sep 2003 17:14:01 +0000 (17:14 +0000)
git-svn-id: https://svn.code.sf.net/p/infobot/code/trunk@824 c11ca15a-4712-0410-83d8-924469b57eb5

blootbot/src/CLI/Support.pl
blootbot/src/interface.pl

index 42df6df6749a5c6cc504bd3ff788d4a1eac77b1e..6b2de5b1e972dbdba5a92ce13620b7423f36e4a4 100644 (file)
@@ -5,6 +5,34 @@
 #        Created: 20021028
 #
 
+sub cliloop {
+    &status("Using CLI...");
+    &status("Now type what you want.");
+
+    $nuh = "local!local\@local";
+    $uh  = "local\@local";
+    $who = "local";
+    $orig{who} = "local";
+    $ident = $param{'ircNick'};
+    $chan = $talkchannel = "_local";
+    $addressed = 1;
+    $msgType = 'public';
+
+    # install libterm-readline-gnu-perl to get history support
+    use Term::ReadLine;
+    $term = new Term::ReadLine 'blootbot';
+    $prompt = "$who> ";
+    #$OUT = $term->OUT || STDOUT;
+    while ( defined ($_ = $term->readline($prompt)) ) {
+       $orig{message} = $_;
+       $message = $_;
+       chomp $message;
+       last if ($message =~ m/^quit$/);
+       $_ = &process() if $message;
+    }
+    &doExit();
+}
+
 sub msg {
     my ($nick, $msg) = @_;
     if (!defined $nick) {
index c786b8379ac2c41dd5a708d9ca06fa883803c102..1a225991fddbb6081fe4fed3cd8371d5474053f2 100644 (file)
@@ -13,32 +13,4 @@ sub whatInterface {
     }
 }
 
-sub cliloop {
-    &status("Using CLI...");
-    &status("Now type what you want.");
-
-    $nuh = "local!local\@local";
-    $uh  = "local\@local";
-    $who = "local";
-    $orig{who} = "local";
-    $ident = $param{'ircNick'};
-    $chan = $talkchannel = "_local";
-    $addressed = 1;
-    $msgType = 'public';
-
-    # install libterm-readline-gnu-perl to get history support
-    use Term::ReadLine;
-    $term = new Term::ReadLine 'blootbot';
-    $prompt = "$who> ";
-    #$OUT = $term->OUT || STDOUT;
-    while ( defined ($_ = $term->readline($prompt)) ) {
-       $orig{message} = $_;
-       $message = $_;
-       chomp $message;
-       last if ($message =~ m/^quit$/);
-       $_ = &process() if $message;
-    }
-    &doExit();
-}
-
 1;