Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
behaviors['ARPG.Fixed.OptionsMenu'] = function () {
// check if possible to open menu (eg: if esc menu is not open)
var color = robot.getPixelColor(parseInt(Window.width * 0.1421875), parseInt(Window.height * 0.89351851852));
if (color > "777777") {
Mode.change(OptionsMenu);
}
};
Scanner.scanUntil = function (start, delta, matchColor, inverted, iterLimit) {
var color, current, iterations = 0;
// (CLONE instead of using the real one)
current = Scanner.makeInBounds([start[X], start[Y]]);
if (delta[X] == 0 && delta[Y] == 0) {
return null;
}
while (!Scanner.isOutOfBound(current)) {
// Check current pixel
color = robot.getPixelColor(current[X], current[Y]);
if (!inverted && color.toString() == matchColor) {
return current;
}
if (inverted && color.toString() != matchColor) {
return current;
}
current[X] += delta[X];
current[Y] += delta[Y];
iterations++;
if (iterations > iterLimit) {
return null;
}
timer = setInterval(function()
{
var mouse = robot.getMousePos();
hex = robot.getPixelColor(mouse.x, mouse.y);
$("#color").text(hex);
$("body").css("background-color", "#" + hex);
}, 200);
}
mouseEvent.on('move', (x, y) => {
let posx, posy
if (process.platform === 'win32' && ratio > 1) {
posx = x / ratio
posy = y / ratio
} else {
posx = x
posy = y
}
let color = '#' + robot.getPixelColor(parseInt(x), parseInt(y))
picker.getWindow().setPosition(parseInt(posx) - 100, parseInt(posy) - 50)
picker.getWindow().webContents.send('updatePicker', color)
})
const t=setInterval(() => {
debug(robot.getPixelColor(width/2,height/2));
if(robot.getPixelColor(width/2,height/2)!=="160f0a") {
clearInterval(t);
resolve();
}
},200);
setTimeout(() => {
mouseEvent.on('move', (x, y) => {
let color = '#' + robot.getPixelColor(parseInt(x), parseInt(y))
picker.getWindow().setPosition(parseInt(x) - 50, parseInt(y) - 50)
picker.getWindow().webContents.send('updatePicker', color)
if (realtime) colorpicker.getWindow().webContents.send('previewColor', color)
})
function DetectPixelSignature (SigCollection) {
var sigDetected = false;
var sig = null;
for(var i = 0; i < SigCollection.length && !sigDetected; i++) {
var testSig = SigCollection[i];
var sigMatching = true;
for(var j = 0; j < testSig.x.length && sigMatching; j++) {
var c = testSig.x[j];
var pixelAt = parseInt(robot.getPixelColor(c.x, testSig.y), 16);
if(c.color !== pixelAt) {
sigMatching = false;
}
}
sigDetected = sigMatching;
}
if(sigDetected) {
sig = SigCollection[i - 1];
}
return sig;
}
const t=setInterval(() => {
debug(robot.getPixelColor(width/2,height/2));
if(robot.getPixelColor(width/2,height/2)!=="160f0a") {
clearInterval(t);
resolve();
}
},200);
setTimeout(() => {