From e78a8a6361244e10822ff58fc42c0e5d37b2ba06 Mon Sep 17 00:00:00 2001 From: ViVi Date: Sun, 11 May 2025 10:53:24 +0900 Subject: [PATCH] =?UTF-8?q?=E5=9B=9B=E5=89=87=E6=BC=94=E7=AE=97=E3=82=B3?= =?UTF-8?q?=E3=83=9E=E3=83=B3=E3=83=89=E3=81=AB=E3=81=8A=E3=81=84=E3=81=A6?= =?UTF-8?q?=E3=80=81=E7=AD=89=E5=8F=B7=E3=81=AE=E5=89=8D=E3=81=AE=E3=82=B9?= =?UTF-8?q?=E3=83=9A=E3=83=BC=E3=82=B9=E3=82=92=E8=A8=B1=E5=AE=B9=E3=81=99?= =?UTF-8?q?=E3=82=8B=E3=82=88=E3=81=86=E3=81=AB?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- lib/pl/dice.pl | 4 ++-- lib/pl/write.pl | 1 + 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/lib/pl/dice.pl b/lib/pl/dice.pl index d9967809..667a1c6b 100644 --- a/lib/pl/dice.pl +++ b/lib/pl/dice.pl @@ -27,7 +27,7 @@ sub diceCheck { ( \(? \-? [0-9.]+ [\+\-\/*\^] [0-9.\+\-\/*\^()]* [0-9.] \)? ) - [==](?:\s|$) + \s*[==](?:\s|$) /ix){ my $formula = $1; if($formula !~ /[\+\-\/\*\^]/) { return ''; } @@ -37,7 +37,7 @@ sub diceCheck { $formula_perl =~ s#\*\*#\^#g; my $result = eval($formula); if($result eq ''){ return ''; } - return "${formula_perl} = ${result}", 'dice'; + return "${formula_perl} = ${result}", 'dice:calc'; } # SW2 elsif($::in{'game'} eq 'sw2'){ diff --git a/lib/pl/write.pl b/lib/pl/write.pl index ad87c89d..9277a57e 100644 --- a/lib/pl/write.pl +++ b/lib/pl/write.pl @@ -336,6 +336,7 @@ sub diceCodeCheck { ($::in{'info'}, $::in{'system'}) = diceCheck($::in{'comm'}); if($::in{'info'}){ $::in{'comm'} =~ s/^(.*?(?:\s|$))//; + $::in{'comm'} = '' if $::in{'system'} eq 'dice:calc' && $::in{'comm'} =~ /^[==]$/; $::in{'info'} .= '<<'.$1; return $::in{'info'}; }