From c195cbf7cfff0bfa6beeddd3c4bb626e06ecbf13 Mon Sep 17 00:00:00 2001 From: dms Date: Tue, 13 Feb 2001 15:04:00 +0000 Subject: [PATCH] - 'ascii' updates. - 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 | 23 +++++++++++++---------- 1 file changed, 13 insertions(+), 10 deletions(-) diff --git a/src/UserExtra.pl b/src/UserExtra.pl index dd5a9e7..d854eff 100644 --- a/src/UserExtra.pl +++ b/src/UserExtra.pl @@ -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 =~ / see/i) { + &status("warn: not redirecting a redirection."); + next; + } + &DEBUG(" was '$was'."); - push(@redir,$_); - &setFactInfo($_, "factoid_value", " see $factoid"); + push(@redir,$x); + &setFactInfo($x, "factoid_value", " see $factoid"); } &status("Done."); -- 2.39.2