From 24ab4881a290e75f4db904055d0e9a7069061e03 Mon Sep 17 00:00:00 2001 From: dms Date: Sun, 20 Aug 2000 13:25:53 +0000 Subject: [PATCH] added randnick git-svn-id: https://svn.code.sf.net/p/infobot/code/trunk/blootbot@50 c11ca15a-4712-0410-83d8-924469b57eb5 --- src/Factoids/Reply.pl | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/src/Factoids/Reply.pl b/src/Factoids/Reply.pl index 01d9e81..19fe09a 100644 --- a/src/Factoids/Reply.pl +++ b/src/Factoids/Reply.pl @@ -200,7 +200,14 @@ sub getReply { if ($reply =~ /\$rand/) { my $rand = rand(); my $randp = int($rand*100); - $reply =~ s/\$randpercentage/$randp/g; + $reply =~ s/\$randpercentage/$randp/g; # ??? + # randnick. + if ($reply =~ /\$randnick/) { + my @nicks = keys %{$channels{$chan}{''}}; + my $randnick = $nicks[$rand*$#nicks]; + s/\$randnick/$randnick/; + } + ### TODO: number of digits. 'x.y' if ($reply =~ /\$rand(\d+)/) { # will this work as it does in C? -- 2.39.2