链接失效?点击上报!
游戏地址
- 开始游戏开始游戏
- 开始游戏油猴汉化脚本
- 开始游戏油猴汉化通用教程
- 推广
- 开始游戏武侠大反派,战斗养成挂机页游
- 开始游戏传灯,经典文字冒险养成RPG
- 开始游戏离线挂机系统,国人自制暗黑修仙挂机游戏
- 开始游戏轮回小镇,国产牛牛来袭!邀请码填: JsEBxe 领奖励!
- 开始游戏无尽洪荒,文字MUD修仙游戏
- 开始游戏放置传奇,是兄弟就来砍我
- 开始游戏梦幻阁 - 修仙文字放置摸鱼游戏
- 开始游戏迷你梦幻,经典怀旧,锅巴在11区等你
提示:
1、强烈建议使用Chrome或者Firefox浏览器进行游戏。
2、如果游戏白屏、卡住,可尝试然后按Ctrl + F5 强制刷新游戏页面。
3、玩此类型游戏时,请大家记得定期保存、导出存档。以免存档丢失,失去继续玩的动力。
4、备份存档可以放到网盘、邮箱里面去,推荐大家使用:有道笔记
5、如果你遇到不懂的地方,欢迎加入QQ群询问:
1、强烈建议使用Chrome或者Firefox浏览器进行游戏。
2、如果游戏白屏、卡住,可尝试然后按Ctrl + F5 强制刷新游戏页面。
3、玩此类型游戏时,请大家记得定期保存、导出存档。以免存档丢失,失去继续玩的动力。
4、备份存档可以放到网盘、邮箱里面去,推荐大家使用:有道笔记
5、如果你遇到不懂的地方,欢迎加入QQ群询问:
相关游戏
文章评论
1833152... 6天前
给大家一个脚本吧,也是聊胜于无,按F12打开开发者工具,在控制台输入我写的脚本,页面右侧会有自动化点击的开关,但是有个问题,因为tab的切换会导致页面的按钮发生变化,所以只能自动话点击当前场景的按钮。
(() => {
// 防止重复注入
if (window.__darkCaveAutoClick) {
console.log('自动点击脚本已在运行');
return;
}
window.__darkCaveAutoClick = true;
// 全局状态
const state = {
tasks: {}, // 存储每个按钮的任务状态 { [actionId]: { enabled, checkTimer, name } }
panelContainer: null,
updateTimer: null,
observer: null,
};
// ========== 1. 创建右侧控制面板 ==========
function createPanel() {
const panel = document.createElement('div');
panel.id = 'auto-click-control-panel';
panel.style.cssText = `
position: fixed;
right: 0;
top: 50%;
transform: translateY(-50%);
width: 175px;
background: rgba(18, 18, 18, 0.96);
border: 1px solid #2a2a2a;
border-right: none;
border-radius: 6px 0 0 6px;
padding: 10px 12px;
z-index: 99999;
color: #cccccc;
font-size: 12px;
font-family: system-ui, -apple-system, sans-serif;
box-shadow: -3px 0 12px rgba(0, 0, 0, 0.6);
user-select: none;
`;
// 标题
const title = document.createElement('div');
title.textContent = '自动点击控制台';
title.style.cssText = `
font-weight: 600;
margin-bottom: 8px;
padding-bottom: 6px;
border-bottom: 1px solid #2a2a2a;
color: #e0e0e0;
font-size: 13px;
`;
panel.appendChild(title);
// 开关列表容器
const list = document.createElement('div');
list.id = 'auto-click-list';
list.style.cssText = `
display: flex;
flex-direction: column;
gap: 6px;
max-height: 70vh;
overflow-y: auto;
padding-right: 4px;
`;
// 滚动条样式
const style = document.createElement('style');
style.textContent = `
#auto-click-list::-webkit-scrollbar { width: 4px; }
#auto-click-list::-webkit-scrollbar-thumb { background: #444; border-radius: 2px; }
`;
document.head.appendChild(style);
panel.appendChild(list);
document.body.appendChild(panel);
state.panelContainer = list;
}
// ========== 2. 工具函数 ==========
// 检查按钮是否可用(未禁用 + 可见)
function isButtonUsable(btn) {
if (!btn) return false;
if (btn.disabled) return false;
if (btn.getAttribute('aria-disabled') === 'true') return false;
if (btn.offsetParent === null) return false; // 元素隐藏时跳过
return true;
}
// 扫描当前页面所有可见的游戏按钮(按 actionid 识别)
function scanVisibleButtons() {
const buttons = document.querySelectorAll('button[actionid]');
const result = [];
buttons.forEach(btn => {
if (btn.offsetParent === null) return; // 只保留当前可见的按钮
const actionId = btn.getAttribute('actionid');
const name = btn.textContent.trim() || actionId;
result.push({ actionId, name });
});
return result;
}
// ========== 3. 自动点击核心逻辑 ==========
// 轮询等待按钮恢复可用
function startPolling(actionId) {
const task = state.tasks[actionId];
if (!task || !task.enabled) return;
if (task.checkTimer) clearInterval(task.checkTimer);
task.checkTimer = setInterval(() => {
// 任务已关闭则清理
if (!state.tasks[actionId] || !state.tasks[actionId].enabled) {
clearInterval(task.checkTimer);
task.checkTimer = null;
return;
}
const btn = document.querySelector(`button[actionid="${actionId}"]`);
// 按钮恢复可用后,等待300ms再执行下一次点击
if (isButtonUsable(btn)) {
clearInterval(task.checkTimer);
task.checkTimer = null;
setTimeout(() => runAutoClick(actionId), 300);
}
}, 50); // 每50ms检测一次冷却状态
}
// 执行单次点击并启动下一轮等待
function runAutoClick(actionId) {
const task = state.tasks[actionId];
if (!task || !task.enabled) return;
const btn = document.querySelector(`button[actionid="${actionId}"]`);
if (isButtonUsable(btn)) {
btn.click();
// 点击后等待100ms让游戏设置冷却状态,避免重复触发
setTimeout(() => startPolling(actionId), 100);
} else {
startPolling(actionId);
}
}
// 切换任务开关状态
function toggleTask(actionId, enabled) {
if (!state.tasks[actionId]) {
state.tasks[actionId] = { enabled: false, checkTimer: null, name: '' };
}
const task = state.tasks[actionId];
task.enabled = enabled;
if (enabled) {
runAutoClick(actionId);
} else {
if (task.checkTimer) {
clearInterval(task.checkTimer);
task.checkTimer = null;
}
}
}
// ========== 4. 更新控制面板 ==========
function updatePanel() {
const buttons = scanVisibleButtons();
const container = state.panelContainer;
if (!container) return;
const visibleActionIds = new Set(buttons.map(b => b.actionId));
// 移除不可见按钮对应的开关项
Array.from(container.children).forEach(item => {
const actionId = item.dataset.actionid;
if (!visibleActionIds.has(actionId)) {
item.remove();
// 暂停任务但保留开启状态,切回tab时自动恢复
if (state.tasks[actionId]?.checkTimer) {
clearInterval(state.tasks[actionId].checkTimer);
state.tasks[actionId].checkTimer = null;
}
}
});
// 新增可见按钮的开关项
buttons.forEach(({ actionId, name }) => {
// 初始化任务状态
if (!state.tasks[actionId]) {
state.tasks[actionId] = { enabled: false, checkTimer: null, name };
}
state.tasks[actionId].name = name;
// 已存在则跳过
if (container.querySelector(`[data-actionid="${actionId}"]`)) return;
// 创建开关行
const row = document.createElement('label');
row.dataset.actionid = actionId;
row.style.cssText = `
display: flex;
align-items: center;
justify-content: space-between;
gap: 8px;
cursor: pointer;
padding: 2px 0;
`;
const nameSpan = document.createElement('span');
nameSpan.textContent = name;
nameSpan.style.cssText = `
flex: 1;
overflow: hidden;
text-overflow: ellipsis;
white-space: nowrap;
`;
const checkbox = document.createElement('input');
checkbox.type = 'checkbox';
checkbox.checked = state.tasks[actionId].enabled;
checkbox.style.cssText = 'cursor: pointer; accent-color: #ef4444;';
checkbox.addEventListener('change', e => {
toggleTask(actionId, e.target.checked);
});
row.appendChild(nameSpan);
row.appendChild(checkbox);
container.appendChild(row);
// 如果之前是开启状态,切回tab后自动恢复运行
if (state.tasks[actionId].enabled) {
runAutoClick(actionId);
}
});
}
// ========== 5. 监听页面变化(Tab切换/按钮状态变化) ==========
function setupObserver() {
const target = document.querySelector('main') || document.body;
// 监听节点增减、属性变化、子树变化,覆盖Tab切换和按钮冷却状态变化
const config = { childList: true, subtree: true, attributes: true };
const observer = new MutationObserver(() => {
// 防抖:200ms内多次变化只更新一次
if (state.updateTimer) clearTimeout(state.updateTimer);
state.updateTimer = setTimeout(updatePanel, 200);
});
observer.observe(target, config);
state.observer = observer;
}
// ========== 初始化 ==========
function init() {
createPanel();
updatePanel();
setupObserver();
console.log('✅ A Dark Cave 自动点击脚本加载成功');
console.log('ℹ️ 右侧面板勾选对应按钮即可启动自动点击,间隔为冷却时间+300ms');
console.log('ℹ️ 切换洞穴/村庄/森林等Tab时按钮列表会自动更新');
}
init();
})();
0 次
0 次
9348 ℃







微信打赏支持
支付宝打赏支持