提交新js腳本 與 修改舊改本的bug (#440)
* 到楓丹鐵匠合成或取得武器強化材料 到楓丹匠合成或領武器強化材料,透過調節器修改自訂配置選擇合成或領取。支持水晶礦、紫晶礦、萃凝晶。 * Update main.js 修改沒有默认值的bug * 战斗脚本:玛薇卡、茜特菈莉、希格雯、恰斯卡
This commit is contained in:
27
repo/combat/瑪希茜恰.txt
Normal file
27
repo/combat/瑪希茜恰.txt
Normal file
@@ -0,0 +1,27 @@
|
||||
// 火神不開Q
|
||||
茜特菈莉 e,click(middle),wait(0.2),q,attack,e,click(middle)
|
||||
希格雯 e(hold),wait(0.2)
|
||||
玛薇卡 e,click(middle)
|
||||
// 2命恰
|
||||
// s(0.4),e,wait(0.2),moveby(0,2400),charge(1.15),wait(0.2),charge(1.15),wait(0.2),charge(1.15),wait(0.2),charge(1.15),wait(0.2),charge(1.15),wait(0.2),charge(1.15),wait(0.2),q,e
|
||||
// 0命恰
|
||||
恰斯卡 s(0.4),e,wait(0.2),moveby(0,2400),charge(2.3),wait(0.2),charge(2.3),wait(0.2),charge(2.3),wait(0.2),q,e
|
||||
|
||||
|
||||
// 火神開Q
|
||||
// 茜特菈莉 e,click(middle),wait(0.2),q,attack,e,click(middle)
|
||||
// 希格雯 e(hold),wait(0.2)
|
||||
// 玛薇卡 q,click(middle),wait(0.3),e,click(middle)
|
||||
// 2命恰
|
||||
// 恰斯卡 e,wait(0.2),s(1.2),w(0.4),moveby(0,2400),charge(1.15),wait(0.2),charge(1.15),wait(0.2),charge(1.15),wait(0.2),charge(1.15),wait(0.2),charge(1.15),wait(0.2),charge(1.15),wait(0.2),q,e
|
||||
// 0命恰
|
||||
// 恰斯卡 e,wait(0.2),s(1.2),w(0.4),moveby(0,2400),charge(2.3),wait(0.2),charge(2.3),wait(0.2),charge(2.3),wait(0.2),q,e
|
||||
|
||||
// 向上升
|
||||
// keydown(VK_SPACE),wait(0.5),keyup(VK_SPACE)
|
||||
// 向下降
|
||||
// keydown(VK_LCONTROL),wait(0.5),keyup(VK_LCONTROL)
|
||||
// 畫面向下移
|
||||
// 恰斯卡 moveby(0,2400)
|
||||
// 1.15 = 三彈, 2.3 = 六彈
|
||||
// 恰斯卡 e,charge(1.15),charge(2.3)
|
||||
57
repo/js/到枫丹打鐵合礦領礦/assets/AutoPath/到枫丹打鐵.json
Normal file
57
repo/js/到枫丹打鐵合礦領礦/assets/AutoPath/到枫丹打鐵.json
Normal file
@@ -0,0 +1,57 @@
|
||||
{
|
||||
"info": {
|
||||
"name": "到枫丹打鐵",
|
||||
"type": "collect",
|
||||
"author": "密柑魚",
|
||||
"version": "1.0",
|
||||
"description": "",
|
||||
"bgiVersion": "0.35.1"
|
||||
},
|
||||
"positions": [
|
||||
{
|
||||
"id": 1,
|
||||
"action": "",
|
||||
"move_mode": "walk",
|
||||
"type": "teleport",
|
||||
"x": 4514.18,
|
||||
"y": 3630.3999999999996,
|
||||
"action_params": ""
|
||||
},
|
||||
{
|
||||
"id": 2,
|
||||
"x": 4520.380859375,
|
||||
"y": 3606.239501953125,
|
||||
"type": "path",
|
||||
"move_mode": "run",
|
||||
"action": "",
|
||||
"action_params": ""
|
||||
},
|
||||
{
|
||||
"id": 3,
|
||||
"x": 4560.19189453125,
|
||||
"y": 3598.05615234375,
|
||||
"type": "path",
|
||||
"move_mode": "run",
|
||||
"action": "",
|
||||
"action_params": ""
|
||||
},
|
||||
{
|
||||
"id": 4,
|
||||
"x": 4581.005859375,
|
||||
"y": 3599.1630859375,
|
||||
"type": "path",
|
||||
"move_mode": "run",
|
||||
"action": "",
|
||||
"action_params": ""
|
||||
},
|
||||
{
|
||||
"id": 5,
|
||||
"x": 4579.80,
|
||||
"y": 3605.452,
|
||||
"type": "path",
|
||||
"move_mode": "walk",
|
||||
"action": "",
|
||||
"action_params": ""
|
||||
}
|
||||
]
|
||||
}
|
||||
94
repo/js/到枫丹打鐵合礦領礦/main.js
Normal file
94
repo/js/到枫丹打鐵合礦領礦/main.js
Normal file
@@ -0,0 +1,94 @@
|
||||
(async function () {
|
||||
|
||||
async function AutoPath(locationName) {
|
||||
try {
|
||||
let filePath = `assets/AutoPath/${locationName}.json`;
|
||||
await pathingScript.runFile(filePath);
|
||||
} catch (error) {
|
||||
log.error(`执行 ${locationName} 路径时发生错误`);
|
||||
log.error(error.message);
|
||||
}
|
||||
await sleep(2000);
|
||||
}
|
||||
|
||||
// 確認使用礦石
|
||||
function determineOre() {
|
||||
if (ore_action == "合成礦石") {
|
||||
if (ore == '水晶块') {
|
||||
log.info("將使用 水晶块 鍛造礦石");
|
||||
} else if (ore == '紫晶块') {
|
||||
log.info("將使用 紫晶块 鍛造礦石");
|
||||
} else if (ore == '萃凝晶') {
|
||||
log.info("將使用 萃凝晶 鍛造礦石");
|
||||
} else {
|
||||
log.info("無指定礦石﹐將使用 水晶块 鍛造礦石");
|
||||
}
|
||||
}
|
||||
}
|
||||
// 读取用户设置
|
||||
let ore = settings.ore != undefined ? settings.ore : '';
|
||||
let ore_action = settings.ore_action != undefined ? settings.ore_action : '';
|
||||
log.info(ore + ":" + ore_action);
|
||||
|
||||
setGameMetrics(1920, 1080, 2);// 设置游戏窗口大小和DPI
|
||||
determineOre();
|
||||
|
||||
|
||||
log.info("前往枫丹鐵匠位置");
|
||||
await AutoPath(`到枫丹打鐵`);
|
||||
log.info("到逹枫丹鐵匠位置");
|
||||
await sleep(2000);
|
||||
log.info("對話進入任鍛造頁面");
|
||||
await sleep(2000);
|
||||
keyPress("F");
|
||||
await sleep(1000);
|
||||
keyPress("F");
|
||||
await sleep(1000);
|
||||
click(1300, 505);
|
||||
await sleep(1000);
|
||||
keyPress("F");
|
||||
await sleep(1000);
|
||||
|
||||
if (ore_action == "合成礦石") {
|
||||
|
||||
log.info("已進入任鍛造頁面,開始鍛造");
|
||||
// 點擊 "配方"
|
||||
click(220, 150);
|
||||
await sleep(1000);
|
||||
// 跟據用戶選擇的礦石進行鍛造
|
||||
if (ore == '水晶块') {
|
||||
click(545, 290);
|
||||
} else if (ore == '紫晶块') {
|
||||
click(685, 290);
|
||||
} else if (ore == '萃凝晶') {
|
||||
click(120, 455);
|
||||
} else {
|
||||
// 無指定礦石﹐將使用 水晶块 鍛造礦石
|
||||
click(545, 290);
|
||||
}
|
||||
await sleep(1000);
|
||||
// 按合成按鈕3次
|
||||
click(1645, 1015);
|
||||
await sleep(4000);
|
||||
click(1645, 1015);
|
||||
await sleep(4000);
|
||||
click(1645, 1015);
|
||||
await sleep(4000);
|
||||
} else {
|
||||
// 點擊 "鍛造隊列"
|
||||
click(600, 150);
|
||||
await sleep(1000);
|
||||
// 點擊 "全部領取"
|
||||
click(160, 1010);
|
||||
await sleep(1000);
|
||||
// 點擊 "確認"
|
||||
click(970, 910);
|
||||
await sleep(1000);
|
||||
}
|
||||
|
||||
log.info("鍛造結束,退出畫面");
|
||||
// 退出鍛造頁面
|
||||
click(1845, 45);
|
||||
await sleep(1000);
|
||||
|
||||
})();
|
||||
13
repo/js/到枫丹打鐵合礦領礦/manifest.json
Normal file
13
repo/js/到枫丹打鐵合礦領礦/manifest.json
Normal file
@@ -0,0 +1,13 @@
|
||||
{
|
||||
"manifest_version": 1,
|
||||
"name": "传送到枫丹鐵匠合礦領礦",
|
||||
"version": "1.0",
|
||||
"description": "传送到枫丹鐵匠合礦領礦,自動化合成武器升級材料。透過修改js腳本自定義配置設定合礦 還是 領礦。(需要每種礦至少能合成一次,使用時請先禁用任何生存位使用技能。)",
|
||||
"authors": [
|
||||
{
|
||||
"name": "蜜柑魚"
|
||||
}
|
||||
],
|
||||
"settings_ui": "settings.json",
|
||||
"main": "main.js"
|
||||
}
|
||||
20
repo/js/到枫丹打鐵合礦領礦/settings.json
Normal file
20
repo/js/到枫丹打鐵合礦領礦/settings.json
Normal file
@@ -0,0 +1,20 @@
|
||||
[
|
||||
{
|
||||
"name": "ore",
|
||||
"type": "select",
|
||||
"label": "合成礦石(默认:水晶礦)",
|
||||
"options": [
|
||||
"水晶礦",
|
||||
"紫晶块",
|
||||
"萃凝晶"
|
||||
]
|
||||
},{
|
||||
"name": "ore_action",
|
||||
"type": "select",
|
||||
"label": "前往 合成礦石 / 領取礦石(默认:領取礦石)",
|
||||
"options": [
|
||||
"合成礦石",
|
||||
"領取礦石"
|
||||
]
|
||||
}
|
||||
]
|
||||
@@ -4,15 +4,17 @@
|
||||
const defaultMinutes = 0;
|
||||
|
||||
function validateAndSetDefaults(specifyHours, specifyMinutes) {
|
||||
if (isNaN(specifyHours) || specifyHours > 23) {
|
||||
if (isNaN(specifyHours) || specifyHours > 23 || specifyHours == '') {
|
||||
if (specifyHours > 23) {
|
||||
log.warn("设置指定时间错误,请使用 0~23 时,将使用默认值:4时");
|
||||
} else {
|
||||
}
|
||||
else {
|
||||
log.warn("你没有设置指定时,将使用默认值:4时");
|
||||
}
|
||||
|
||||
specifyHours = defaultHours;
|
||||
}
|
||||
if (isNaN(specifyMinutes) || specifyMinutes > 59) {
|
||||
if (isNaN(specifyMinutes) || specifyMinutes > 59 || specifyMinutes == '') {
|
||||
if (specifyMinutes > 59) {
|
||||
log.warn("设置指定时间错误,请使用 0~59 分,将使用默认值:0分");
|
||||
} else {
|
||||
@@ -55,7 +57,7 @@
|
||||
|
||||
// 計算相差時間微秒
|
||||
const timeUntilNextTime = getTimeUntilNextTime(validatedHours, validatedMinutes);
|
||||
log.info(`等待 ${Math.floor((timeUntilNextTime / 60000/60))} 小时 ${(timeUntilNextTime / 60000%60).toFixed(0)} 分 ,直到下一个 ${validatedHours} : ${validatedMinutes}`);
|
||||
log.info(`等待 ${Math.floor((timeUntilNextTime / 60000 / 60))} 小时 ${(timeUntilNextTime / 60000 % 60).toFixed(0)} 分 ,直到下一个 ${validatedHours} : ${validatedMinutes}`);
|
||||
// 多等待10秒
|
||||
await sleep(timeUntilNextTime + 10000);
|
||||
log.info(`时间到了!现在是 ${specifyHours}:${specifyMinutes}`);
|
||||
@@ -63,4 +65,4 @@
|
||||
//1秒 = 1000 毫秒
|
||||
//10秒 = 10000 毫秒
|
||||
//1分鐘 = 60000 毫秒
|
||||
})();
|
||||
})();
|
||||
|
||||
Reference in New Issue
Block a user