diff --git a/repo.json b/repo.json index 6ad28b45c..1f063e21a 100644 --- a/repo.json +++ b/repo.json @@ -1,5 +1,5 @@ { - "time": "20241125212331", + "time": "20241125212123", "url": "https://github.com/babalae/bettergi-scripts-list/archive/refs/heads/main.zip", "file": "repo.json", "indexes": [ @@ -8538,6 +8538,15 @@ "description": "自动伐木~|~前往并自动伐木", "tags": [] }, + { + "name": "Autopermission", + "type": "directory", + "hash": "b12820598212771beec9265ae499102c680a9d16", + "version": "1.0", + "author": "½", + "description": "自动设置权限~|~设置进入世界的权限,默认锁门", + "tags": [] + }, { "name": "Back", "type": "directory", diff --git a/repo/js/Autopermission/main.js b/repo/js/Autopermission/main.js new file mode 100644 index 000000000..924955e6a --- /dev/null +++ b/repo/js/Autopermission/main.js @@ -0,0 +1,31 @@ +(async function () { + + setGameMetrics(1920, 1080, 1.5) + + log.info("请确保执行脚本时处于主界面"); + + keyPress("VK_F2") + await sleep(500); + click(330,1010) //点击世界权限 + await sleep(500); + let domainName = settings.domainName; + + switch (domainName) { + case "直接加入": + click(330, 910); + log.info("权限设置为【直接加入】"); + break; + case "不允许加入": + click(330, 850); // 不允许 + log.info("权限设置为【不允许加入】"); + break; + case "确认后可加入": + click(330, 960); // 确认后 + log.info("权限设置为【确认后可加入】"); + break; + default: + click(330, 850); // 不允许 + log.info("锁门"); + break; +} +})(); \ No newline at end of file diff --git a/repo/js/Autopermission/manifest.json b/repo/js/Autopermission/manifest.json new file mode 100644 index 000000000..fe9c0ebb4 --- /dev/null +++ b/repo/js/Autopermission/manifest.json @@ -0,0 +1,13 @@ +{ + "manifest_version": 1, + "name": "自动设置权限", + "version": "1.0", + "description": "设置进入世界的权限,默认锁门", + "authors": [ + { + "name": "½" + } + ], + "settings_ui": "settings.json", + "main": "main.js" +} \ No newline at end of file diff --git a/repo/js/Autopermission/settings.json b/repo/js/Autopermission/settings.json new file mode 100644 index 000000000..2f0317519 --- /dev/null +++ b/repo/js/Autopermission/settings.json @@ -0,0 +1,12 @@ +[ + { + "name": "domainName", + "type": "select", + "label": "设置权限", + "options": [ + "直接加入", + "确认后可加入", + "不允许加入" + ] + } + ] \ No newline at end of file