-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathmain.js
42 lines (36 loc) · 1.14 KB
/
main.js
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
import { crossLine } from './modules/crossLine.js';
import { canvasif } from './modules/canvasif.js';
import { fixCab } from './modules/fixCab.js';
import { getElementByXpath } from './tools/getElementByXpath.js';
const launchTemp = () => {
let canvasifCnt = 5;
let fixCabCnt = 5;
const launchFixCab = setInterval(() => {
const upperCanvas = getElementByXpath('/html/body/div[1]/div/div[2]/div[2]/div/div/canvas[2]');
if (upperCanvas) {
fixCab();
clearInterval(launchFixCab);
} else {
fixCabCnt--;
if (fixCabCnt <= 0) {
clearInterval(launchFixCab);
}
}
}, 1000)
const launchCanvasif = setInterval(() => {
const lowerCanvas = getElementByXpath('/html/body/div[1]/div/div[2]/div[2]/div/div/canvas[1]');
if (lowerCanvas) {
canvasif();
clearInterval(launchCanvasif);
} else {
canvasifCnt--;
if (canvasifCnt <= 0) {
clearInterval(launchCanvasif);
}
}
}, 1000)
}
export const main = () => {
crossLine();
launchTemp();
}