|
楼主 |
发表于 2023-5-1 10:26:24
|
显示全部楼层
- (function() {
- 'use strict';
- function checkColorAndExecute() {
- const conElement = document.querySelector('con');
- if (conElement) {
- const fontElement = conElement.querySelector('font');
- const color = fontElement && fontElement.getAttribute('color');
- if (color === '008800') {
- const targetLink = conElement.querySelector('a[href="#"]:not([onclick*="helptools"])');
- if (targetLink) {
- targetLink.click();
- }
- }
- }
- var iframes = document.getElementsByTagName('frame');
- if (iframes.length > 0) {
- var iframe = iframes[0]; // 获取第一个iframe
- var frameWindow = iframe.contentWindow; // 获取iframe内的window对象
- }
- frameWindow.useCut(11);
- const ok =document.getElementById('popup_ok');
- if (ok){
- ok.click();
- }
- }
- // 设置每2秒执行一次 checkColorAndExecute 函数
- setInterval(checkColorAndExecute, 6000);
- })();
复制代码
大佬还得麻烦您帮忙修改一下,这个是我后来又添加了一点点东西,但是上面判断颜色那里似乎出了些小问题,
- <con>选择要分解的装备:<br><a href="#" onclick="p.cmd('helptools 73425726');return false;"><img src="/img/arm/armor/ring/rare/lv038/HuoHouZhiJie.gif" border="0" style="margin-right:5px;"><b><font color="0070DD">[火喉巨戒]</font></b></a> <a href="#" onclick="p.cmd('foo fenjie 73425726');return false;">[分解]</a><br><a href="#" onclick="p.cmd('helptools 73425728');return false;"><img src="/img/arm/armor/ring/uncommon/lv042/ZhiLiYinShiZhiHuan.gif" border="0" style="margin-right:5px;"><b><font color="008800">[智力印石指环]</font></b></a> <a href="#" onclick="p.cmd('foo fenjie 73425728');return false;">[分解]</a><br><a href="#" onclick="p.cmd('helptools 73425781');return false;"><img src="/img/arm/armor/hands/plate/uncommon/lv035/GuLangJianDingShouTao.gif" border="0" style="margin-right:5px;"><b><font color="008800">[孤狼坚定手套]</font></b></a> <a href="#" onclick="p.cmd('foo fenjie 73425781');return false;">[分解]</a><br></con>
复制代码
这里如果判断第一个颜色不是008800 就不会判断下面的了,导致下面的没有被判定到,从而一直卡在那里了 |
|