]> git.donarmstrong.com Git - infobot.git/commitdiff
- 'ascii' updates.
authordms <dms@c11ca15a-4712-0410-83d8-924469b57eb5>
Tue, 13 Feb 2001 15:04:00 +0000 (15:04 +0000)
committerdms <dms@c11ca15a-4712-0410-83d8-924469b57eb5>
Tue, 13 Feb 2001 15:04:00 +0000 (15:04 +0000)
- hex now honours "allowConv"
- found by asuffield.
- redir of a redir fixed.

git-svn-id: https://svn.code.sf.net/p/infobot/code/trunk/blootbot@390 c11ca15a-4712-0410-83d8-924469b57eb5

src/UserExtra.pl

index dd5a9e7d1b8f6e8829de3a034a54f4a8327a7ed5..d854effc3189208f641e29c1869922da611a2407 100644 (file)
@@ -409,16 +409,12 @@ sub userCommands {
     if ($message =~ /^(asci*|chr) (\d+)$/) {
        return '' unless (&IsParam("allowConv"));
 
-       $arg = $2;
-       if ($arg < 32) {
-           $arg += 64;
-           $result = "^".chr($arg);
-       } else {
-           $result = chr($2);
-       }
-       $result = "NULL"        if ($arg == 0);
+       $arg    = $2;
+       $result = chr($arg);
+       $result = "NULL"        if ($arg == 0);
 
        &performReply( sprintf("ascii %s is '%s'", $arg, $result) );
+
        return;
     }
 
@@ -442,6 +438,7 @@ sub userCommands {
 
     # hex.
     if ($message =~ /^hex(\s+(.*))?$/i) {
+       return '' unless (&IsParam("allowConv"));
        my $arg = $2;
 
        if (!defined $arg) {
@@ -533,13 +530,19 @@ sub userCommands {
        my @redir;
        &status("Redirect '$factoid' (". ($#list) .")...");
        for (@list) {
+           my $x = $_;
            next if (/^\Q$factoid\E$/i);
 
            &status("  Redirecting '$_'.");
            my $was = &getFactoid($_);
+           if ($was =~ /<REPLY> see/i) {
+               &status("warn: not redirecting a redirection.");
+               next;
+           }
+
            &DEBUG("  was '$was'.");
-           push(@redir,$_);
-           &setFactInfo($_, "factoid_value", "<REPLY> see $factoid");
+           push(@redir,$x);
+           &setFactInfo($x, "factoid_value", "<REPLY> see $factoid");
        }
        &status("Done.");