Skip to content

Commit

Permalink
feat&docs: 商店购买好感券
Browse files Browse the repository at this point in the history
  • Loading branch information
Zebartin committed May 27, 2023
1 parent fd8e64b commit 27367f9
Show file tree
Hide file tree
Showing 5 changed files with 30 additions and 12 deletions.
10 changes: 6 additions & 4 deletions NIKKE/CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,11 +1,13 @@
修复以下问题:

- 进入游戏时被月卡卡死
- 进入付费商店后无法继续。
- 指挥官升级时会跳过第二次基地收菜
- 细节上的识别问题;

新增功能和内容:

- 联网获取最新咨询文本;
- 【桃乐丝】【莱伊】【尼希利斯塔】的咨询文本。
- 没什么卵用的新UI;
- 更换github反代域名;
- 通用商店购买好感券;
- 【布兰儿】【诺亚尔】的咨询文本。

具体使用方式详见[README](https://github.com/Zebartin/autoxjs-scripts/blob/master/NIKKE/README.md)
23 changes: 18 additions & 5 deletions NIKKE/NIKKE日常.js
Original file line number Diff line number Diff line change
Expand Up @@ -217,15 +217,28 @@ function 商店() {
buyGood(freeGood);
} else
toastLog('免费商品已售');
if (NIKKEstorage.get('buyCoreDust', false)) {
let coreDusts = ocrUntilFound(res => {
let ret = res.toArray(3).toArray().filter(e => e.text.match(/芯尘盒/) != null);
let otherItemNames = [];
if (NIKKEstorage.get('buyCoreDust', false))
otherItemNames.push('芯尘盒');
if (NIKKEstorage.get('buyBondItem', false)) {
otherItemNames.push('券');
otherItemNames.push('米.*卡$');
}
if (otherItemNames.length > 0) {
let pattern = null;
if (otherItemNames.length == 1)
pattern = otherItemNames[0]
else
pattern = '(' + otherItemNames.join('|') + ')';
pattern = new RegExp(pattern);
let otherItems = ocrUntilFound(res => {
let ret = res.toArray(3).toArray().filter(e => e.text.match(pattern) != null);
if (ret.length == 0)
return null;
return ret;
}, 4, 300) || [];
for (let coreDust of coreDusts) {
buyGood(coreDust);
for (let item of otherItems) {
buyGood(item);
ocrUntilFound(res => res.text.match(/(距离|更新|还有)/) != null, 20, 600);
}
}
Expand Down
5 changes: 4 additions & 1 deletion NIKKE/NIKKE设置.js
Original file line number Diff line number Diff line change
Expand Up @@ -80,6 +80,7 @@ ui.layout(
<vertical id="shopping" margin="0 20">
<Switch id="checkCashShopFree" margin="0 4" textColor="#222222" text="领取付费商店免费礼包" textSize="16sp" />
<Switch id="buyCoreDust" margin="0 4" textColor="#222222" text="使用信用点购买芯尘盒" textSize="16sp" />
<Switch id="buyBondItem" margin="0 4" textColor="#222222" text="使用信用点购买好感券" textSize="16sp" />
<horizontal margin="0 4">
<text id="buyCodeManualText" textSize="16sp" textColor="#222222" w="0" layout_weight="4" >不购买代码手册</text>
<seekbar id="buyCodeManual" w="0" layout_weight="6" layout_gravity="center" />
Expand Down Expand Up @@ -108,7 +109,7 @@ ui.layout(
<text textSize="16sp" textColor="#222222">出战队伍</text>
<text textSize="12sp">格式:一,二,三,四,五(按照顺序)</text>
<text textSize="12sp">须确保队伍练度足够通关</text>
<text textSize="12sp">留空表示不自动编队,此时只会尝试一次高难</text>
<text textSize="12sp">留空表示不自动编队,此时只会尝试3次高难</text>
<input textSize="14sp" id="simTeam" />
</vertical>
<horizontal margin="0 4">
Expand Down Expand Up @@ -267,6 +268,7 @@ ui.buyCodeManual.setOnSeekBarChangeListener({
});
ui.checkCashShopFree.setChecked(NIKKEstorage.get('checkCashShopFree', false));
ui.buyCoreDust.setChecked(NIKKEstorage.get('buyCoreDust', false));
ui.buyBondItem.setChecked(NIKKEstorage.get('buyBondItem', false));
ui.buyCodeManual.setProgress(NIKKEstorage.get('buyCodeManual', 3));

ui.rookieArenaTarget.setMin(0);
Expand Down Expand Up @@ -424,6 +426,7 @@ ui.save.on("click", function () {

NIKKEstorage.put('checkCashShopFree', ui.checkCashShopFree.isChecked());
NIKKEstorage.put('buyCoreDust', ui.buyCoreDust.isChecked());
NIKKEstorage.put('buyBondItem', ui.buyBondItem.isChecked());
NIKKEstorage.put('buyCodeManual', ui.buyCodeManual.getProgress());
NIKKEstorage.put('rookieArenaTarget', ui.rookieArenaTarget.getProgress());

Expand Down
2 changes: 1 addition & 1 deletion NIKKE/模拟室.js
Original file line number Diff line number Diff line change
Expand Up @@ -130,7 +130,7 @@ function 模拟室(fromIndex) {
status.mode = '尽力而为';
toastLog(`尝试${diffAreaName}`);
log('已有BUFF:', Object.keys(status.loaded));
let maxRetry = team.length > 0 ? 15 : 1;
let maxRetry = team.length > 0 ? 15 : 3;
for (let retry = 0; retry < maxRetry; ++retry) {
status.earlyStop = false;
status.team = team;
Expand Down
2 changes: 1 addition & 1 deletion utils.js
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ function getOcrRes() {
function getDisplaySize(doNotForcePortrait) {
let { width, height } = device;
if (width == 0) {
console.warn('AutoX.js获取到的设备尺寸为0,可能会影响正常运行,可以尝试重启设备');
// console.warn('AutoX.js获取到的设备尺寸为0,可能会影响正常运行,可以尝试重启设备');
let metrics = context.getResources().getDisplayMetrics();
width = metrics.widthPixels;
height = metrics.heightPixels;
Expand Down

0 comments on commit 27367f9

Please sign in to comment.