package impsoft.nexus.bots.color.methods; import java.awt.Rectangle; import java.awt.event.KeyEvent; import javax.swing.plaf.basic.BasicSplitPaneUI.KeyboardEndHandler; import impsoft.nexus.botbase.CoreBot; import impsoft.nexus.bots.color.ColorBot; import impsoft.nexus.bots.color.constants.Areas; import impsoft.nexus.bots.color.scriptobjects.DTM; import impsoft.nexus.bots.color.scriptobjects.RGB; import impsoft.nexus.bots.color.scriptobjects.XY; import impsoft.nexus.components.input.InputBot; public abstract class SCAR extends EasyScript { /* * SCAR */ public int Random(int max){ return random(0, max); } public XY FindColor(int color, int xs, int ys, int xe, int ye) { return findXY(getColorArray2d(), new RGB(color), rectangleFromScar(xs, ys, xe, ye)); } public RGB getColor(int x, int y) { return getRGB(x, y); } public XY FindColorTolerance(int color, int xs, int ys, int xe, int ye, int tolerance) { return findXY(getColorArray2d(), new RGB(color), rectangleFromScar(xs, ys, xe, ye), tolerance, tolerance, tolerance); } public XY FindColorSpiral(int color, int xs, int ys, int xe, int ye) { return findXYspiral(getColorArray2d(), new RGB(color), rectangleFromScar(xs, ys, xe, ye)); } public XY FindColorSpiralTolerance(int color, int xs, int ys, int xe, int ye, int tolerance) { return findXYspiral(getColorArray2d(), new RGB(color), rectangleFromScar(xs, ys, xe, ye), tolerance, tolerance, tolerance); } public XY FindBitmap(short[][][] colorMapTofind) { XY[] places = findXYs(getColorArray2d(), 1, colorMapTofind, Areas.ENTIRE); if (places.length == 1) return places[0]; return null; } public XY FindBitmapIn(short[][][] colorMapTofind,int xs, int ys, int xe, int ye) { XY[] places = findXYs(getColorArray2d(), 1, colorMapTofind, rectangleFromScar(xs, ys, xe, ye)); if (places.length == 1) return places[0]; return null; } public XY FindBitmapToleranceIn(short[][][] colorMapTofind, int xs, int ys, int xe, int ye, int tolerance) { XY[] places = findXYs(getColorArray2d(), 1, colorMapTofind, rectangleFromScar(xs, ys, xe, ye), tolerance, tolerance, tolerance); if (places.length == 1) return places[0]; return null; } public XY FindDeformedBitmapToleranceIn(short[][][] colorMapTofind, Rectangle rec, int tolerance, double accuracy) { XY[] places = findXYs(getColorArray2d(), 1, colorMapTofind, rec, accuracy, tolerance, tolerance, tolerance); if (places.length == 1) return places[0]; return null; } public XY FindDeformedBitmapToleranceIn(short[][][] colorMapTofind, int xs, int ys, int xe, int ye, int tolerance, double accuracy) { XY[] places = findXYs(getColorArray2d(), 1, colorMapTofind, rectangleFromScar(xs, ys, xe, ye), accuracy, tolerance, tolerance, tolerance); if (places.length == 1) return places[0]; return null; } public XY FindDeformedBitmapToleranceRotationIn(short[][][] colorMapTofind, int xs, int ys, int xe, int ye, int tolerance, double accuracy, double startAngle, double endAngle, double angleIntervalSize) { for(;startAngle