This commit is contained in:
Liwanyi 2022-11-15 20:17:40 +08:00
parent 4220ce577c
commit ffc5013cae
7 changed files with 44 additions and 31 deletions

View File

@ -4,6 +4,15 @@
# CHANGE
## 0.7.1
2022年11月15日
### 修改
- 调整寻找木桩页面逻辑
- 修复光速刷新
## 0.7.0
2022年11月10日

View File

@ -1,6 +1,6 @@
{
"name": "wuhu-torn-helper",
"version": "0.7.0",
"version": "0.7.1",
"description": "芜湖助手",
"dependencies": {},
"scripts": {

File diff suppressed because one or more lines are too long

View File

@ -48,7 +48,17 @@ export default class UrlPattern extends WuhuBase {
if (href.includes('gym.php')) StackHelper.getInstance();
// 寻找木桩
if (href.includes('item.php?temp=4#xunzhaomuzhuang')) XZMZ.getInstance();
if (href.includes('item.php?temp=4')) {
let hasInit: boolean = false;
let handle = () => {
if (!hasInit && window.location.hash === '#xunzhaomuzhuang') {
XZMZ.getInstance().init();
hasInit = true;
}
}
window.addEventListener('hashchange', handle);
handle();
}
// 啤酒店
if (href.includes('shops.php?step=bitsnbobs')) {
@ -244,23 +254,6 @@ export default class UrlPattern extends WuhuBase {
rw_raider().then();
}
// 特定
// if (InfoUtils.getInstance().getPlayerInfo().userID === 2687093 && CommonUtils.getDeviceType() === Device.PC) {
// InfoUtils.getInstance().getSidebarData().then(data => {
// let item = document.getElementById('nav-items');
// if (item) {
// let copy = item.cloneNode(true);
// (<HTMLElement>copy.firstChild).style.backgroundColor = '#678c00';
// let a = copy.firstChild.firstChild as HTMLAnchorElement;
// a.href = '/item.php?temp=1';
// let span = a.lastChild as HTMLElement;
// span.innerHTML = '物品';
// span.style.color = 'white';
// item.after(copy);
// }
// });
// }
// 彩票助手
if (href.includes('loader.php?sid=lottery')) LotteryHelper.getInstance().init();

View File

@ -354,7 +354,9 @@ export default class ZhongIcon extends WuhuBase {
domType: 'button',
domId: '',
domText: '🌲 寻找木桩',
clickFunc: () => window.location.href = 'https://www.torn.com/item.php?temp=4#xunzhaomuzhuang'
clickFunc() {
window.location.replace('https://www.torn.com/item.php?temp=4#xunzhaomuzhuang')
}
});
// 更新历史
list.push({

View File

@ -92,10 +92,16 @@ export default class AttackHelper extends WuhuBase {
Log.error('光速刷新失败未找到React对象');
return;
}
if (!document.querySelector('#react-root').querySelector('#attacker')) return;
if (!document.querySelector('#react-root #attacker')) {
Log.error('dom元素未找到selector: [#react-root #attacker]');
return;
}
let script = document.querySelector('script[src*="/builds/attack/"]');
let url = script.src;
if (!url.contains('app.js')) return;
if (!url.contains(/runtime\..+\.js/)) {
Log.error('脚本源[' + url + '] 不匹配规则');
return;
}
window.ReactDOM.unmountComponentAtNode(document.querySelector('#react-root'));
script.remove();
let node = document.createElement('script');

View File

@ -13,16 +13,19 @@ import FetchUtils from "../utils/FetchUtils";
*/
export default class XZMZ extends WuhuBase {
className = 'XZMZ';
private readonly mainRoleContainer: HTMLElement;
private readonly IDList: number[];
private readonly btn: HTMLButtonElement;
private readonly stopBtn: HTMLButtonElement;
private mainRoleContainer: HTMLElement;
private IDList: number[];
private btn: HTMLButtonElement;
private stopBtn: HTMLButtonElement;
private stopSignal: boolean = false;
private readonly tips: HTMLElement;
private tips: HTMLElement;
private counter: number;
public constructor() {
super();
}
public init() {
CommonUtils.addStyle(XUNZHAOMUZHUANG_CSS);
document.title = document.title.replace('Items', '寻找木桩');
this.mainRoleContainer = document.querySelector('div[role="main"]');