Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
async close() {
if ( arguments[0] ) console.warn( arguments[0] );
try {
this._target.Quit();
release( this._target );
} catch (error) { console.warn( error ); }
this.emit('close');
}
findPic(x1, y1, x2, y2, picName, deltaColor, sim, dir) {
let x = new winax.Variant(-1, 'byref');
let y = new winax.Variant(-1, 'byref');
const index = dm.FindPic(x1, y1, x2, y2, picName, deltaColor, sim, dir, x, y);
if (index !== -1) {
return {
x: Number(x),
y: Number(y),
index
};
}
},
findPicEx(x1, y1, x2, y2, picName, deltaColor, sim, dir) {
findStr(x1, y1, x2, y2, str, colorFormat, sim) {
let x = new winax.Variant(-1, 'byref');
let y = new winax.Variant(-1, 'byref');
const index = dm.FindStr(x1, y1, x2, y2, str, colorFormat, sim, x, y);
if (index !== -1) {
return {
index,
x: Number(x),
y: Number(y)
};
}
},
ocr(x1, y1, x2, y2, colorFormat, sim) {
findColor(x1, y1, x2, y2, color, sim, dir) {
let x = new winax.Variant(-1, 'byref');
let y = new winax.Variant(-1, 'byref');
const ret = dm.FindColor(x1, y1, x2, y2, color, sim, dir, x, y);
if (ret) {
return {
x: Number(x),
y: Number(y)
};
}
},
getNowDict() {
getCursorPos() {
let x = new winax.Variant(-1, 'byref');
let y = new winax.Variant(-1, 'byref');
dm.GetCursorPos(x, y);
return { x: Number(x), y: Number(y) };
},
getKeyState(keyCode) {
findPic(x1, y1, x2, y2, picName, deltaColor, sim, dir) {
let x = new winax.Variant(-1, 'byref');
let y = new winax.Variant(-1, 'byref');
const index = dm.FindPic(x1, y1, x2, y2, picName, deltaColor, sim, dir, x, y);
if (index !== -1) {
return {
x: Number(x),
y: Number(y),
index
};
}
},
findPicEx(x1, y1, x2, y2, picName, deltaColor, sim, dir) {
findStr(x1, y1, x2, y2, str, colorFormat, sim) {
let x = new winax.Variant(-1, 'byref');
let y = new winax.Variant(-1, 'byref');
const index = dm.FindStr(x1, y1, x2, y2, str, colorFormat, sim, x, y);
if (index !== -1) {
return {
index,
x: Number(x),
y: Number(y)
};
}
},
ocr(x1, y1, x2, y2, colorFormat, sim) {
findColor(x1, y1, x2, y2, color, sim, dir) {
let x = new winax.Variant(-1, 'byref');
let y = new winax.Variant(-1, 'byref');
const ret = dm.FindColor(x1, y1, x2, y2, color, sim, dir, x, y);
if (ret) {
return {
x: Number(x),
y: Number(y)
};
}
},
getNowDict() {
getClientSize(hWnd) {
let width = new winax.Variant(-1, 'byref');
let height = new winax.Variant(-1, 'byref');
const ret = dm.GetClientSize(hWnd, width, height);
if (ret) {
return {
width: Number(width),
height: Number(height)
};
}
},
moveWindow(hWnd, x, y) {
getClientSize(hWnd) {
let width = new winax.Variant(-1, 'byref');
let height = new winax.Variant(-1, 'byref');
const ret = dm.GetClientSize(hWnd, width, height);
if (ret) {
return {
width: Number(width),
height: Number(height)
};
}
},
moveWindow(hWnd, x, y) {