private Inventory(Point offset, int width, int height) { this.offset = offset; this.width = width; this.height = height; slots = new Slot[MAX_SLOTS - 1]; for(int i = 0; i < MAX_SLOTS -1; i++) { slots[i] = new Slot(i+1); } }
public Rectangle getBounds(Point slotCoordinate) { //Rectangle window = Configuration.screen; //Point lowerRight = new Point(window.Right, window.Bottom); Point topLeft = new Point(FromBottomRightToFirstSlot.X, FromBottomRightToFirstSlot.Y); return new Rectangle(topLeft.X + slotCoordinate.X * slotSize + slotCoordinate.X * margin.Width, topLeft.Y + slotCoordinate.Y * slotSize + slotCoordinate.Y * margin.Height, slotSize, slotSize); }
public override void start() { Console.WriteLine("Dont mind me just starting a script..."); Point topleft = api.TargetWindow.Location; mouse.Move(0,0); Thread.Sleep(1000); Point bottomRight = new Point(api.TargetWindow.Width, api.TargetWindow.Height) ; mouse.Move(bottomRight); Thread.Sleep(1000); inventory.Open(); Thread.Sleep(1000); Point slot1 = inventory.getBounds(1).Location; mouse.Move(slot1); }
public OptionList(Point mousePos, Option[] options) : base(mousePos, Option.minWidth, getTotalHeight(options.Length)) { this.optionCount = options.Length; foreach (Option o in options) optionWidth = Math.Max(optionWidth, o.getWidth()); this.origin = mousePos; }
public OptionList(Point mousePos, int optionCount) : base(mousePos, Option.minWidth, getTotalHeight(optionCount)) { this.optionCount = optionCount; this.optionWidth = 25; this.origin = mousePos; }
public Slot(Point index, int size = 25) : base(new Point(), size, size) { }
public Point nextPoint(Point slotCoord) { Rectangle bound = getBounds(slotCoord); return new Point( random.Next(bound.X, bound.Right), random.Next(bound.Y, bound.Bottom) ); }
public SquareWidget(Point offset, int width, int height) { draw = true; this.offset = offset; this.width = width; this.height = height; this.random = new Random(DateTime.Now.Millisecond); }
public RoundWidget(Point offset, int radius) { draw = true; this.offset = offset; this.radius = radius; this.random = new Random(DateTime.Now.Millisecond); }
public void paint(Graphics g) { System.Windows.Point[] points = screenRegion.Points.ToArray(); System.Drawing.Point[] po = new System.Drawing.Point[points.Length]; for (int i = 0; i < points.Length; i++) po[i] = new Point((int)points[i].X, (int)points[i].Y); g.DrawPolygon(Pens.Black, po); }
public Point nextPoint() { System.Drawing.Rectangle bound = screenRegion.getBoundingBox(); Random random = new Random(); Point p; do { p = new Point(random.Next(bound.X, bound.Right), random.Next(bound.Y, bound.Bottom)); }while( !screenRegion.doesContain(p) ); return new Point(p.X, p.Y); }