|
完整的机器就不发布了。
只要在原来的红豆机器中加两行代码:
$question = %string(%1)
$j = 0
添加的位置是在多行触发“^红豆说道:准备好了吗?我开始出题了哦。$”中,state 1触发语句中"^(*%x*)"
原来的代码是:
#WHILE ($i < $matchNum) {
$findWord = 0
$match = %left($key, 1)
#add $i 1
$key = %right(%key, $i)
#WHILE ($j < $lenQuestion) {
#if ($match == %left($question, 1)) {
$findWord = 1
#break
}
#add $j 1
$question = %right(%string(%1), $j)
}
在$key = %right(%key, $i)后面。
现在的代码是:
#WHILE ($i < $matchNum) {
$findWord = 0
$match = %left($key, 1)
#add $i 1
$key = %right(%key, $i)
$question = %string(%1)
$j = 0
#WHILE ($j < $lenQuestion) {
#if ($match == %left($question, 1)) {
$findWord = 1
#break
}
#add $j 1
$question = %right(%string(%1), $j)
} |
|