diff options
author | Alexander NeonXP Kiryukhin <frei@neonxp.info> | 2016-05-27 16:46:02 +0300 |
---|---|---|
committer | Alexander NeonXP Kiryukhin <frei@neonxp.info> | 2016-05-27 16:46:02 +0300 |
commit | 8c355d994794f908a66dd4abb893e6f2fa4728b2 (patch) | |
tree | a90113e63565b37d0f810e293b825bacd6abb202 | |
parent | 27d073de43597c6b164c12ec7cb8ad79c99a0227 (diff) |
Added DB search 9
-rw-r--r-- | src/NeonXP/BotScript.php | 11 |
1 files changed, 6 insertions, 5 deletions
diff --git a/src/NeonXP/BotScript.php b/src/NeonXP/BotScript.php index 695d26a..9886819 100644 --- a/src/NeonXP/BotScript.php +++ b/src/NeonXP/BotScript.php @@ -103,20 +103,21 @@ class BotScript } else { for ($i = 0; $i < mb_strlen($text, 'utf8'); $i++) { $char = mb_substr($text, $i, 1, 'utf8'); + $result = ''; foreach ($db as $key => $value) { if (mb_strtolower($value[0], 'utf8') == mb_strtolower($char)) { if ($key < 10) { - $result = "0$key | $value[0] | $value[1] | $value[2] | $value[3] | $value[4] | $value[5]" . PHP_EOL; + $result .= "0$key | $value[0] | $value[1] | $value[2] | $value[3] | $value[4] | $value[5]" . PHP_EOL; } else { - $result = "$key | $value[0] | $value[1] | $value[2] | $value[3] | $value[4] | $value[5]" . PHP_EOL; + $result .= "$key | $value[0] | $value[1] | $value[2] | $value[3] | $value[4] | $value[5]" . PHP_EOL; } } if (strtolower($value[2]) == strtolower($char)) { if ($key < 10) { - $result = "0$key | $value[0] | $value[1] | $value[2] | $value[3] | $value[4] | $value[5]" . PHP_EOL; + $result .= "0$key | $value[0] | $value[1] | $value[2] | $value[3] | $value[4] | $value[5]" . PHP_EOL; } else { - $result = "$key | $value[0] | $value[1] | $value[2] | $value[3] | $value[4] | $value[5]" . PHP_EOL; + $result .= "$key | $value[0] | $value[1] | $value[2] | $value[3] | $value[4] | $value[5]" . PHP_EOL; } } } @@ -148,7 +149,7 @@ class BotScript 'STATE_PAUSE' ])-> action(new isMatch('/^\!.+?$/i'), $sendCode)-> - action(new isMatch('/^\$.+?$/i'), $getDb)-> + action(new isMatch('/^\?.+?$/i'), $getDb)-> action(new isAnyText(), $goBack)-> end()-> state('STATE_SET_LINK')-> |