public CClickMouse(CRuneScape _runescape, ClickButton _button, Point _location, uint rand_diam) : base(_runescape) { this.btnToClick = _button; this.ptLocationToClick = _location; this.uiRandomDiam = rand_diam; }
private str_ScanResult BasicScan(CRuneScape runeScape) { str_ScanResult scan; scan.bmpResult = null; scan.ptWindow = Point.Empty; scan.ptCompensate = Point.Empty; KeyValuePair<Point, Size> kpDimensions = GetWindowDimensions(runeScape); if (kpDimensions.Value.Width == 0 || kpDimensions.Value.Height == 0) { return scan; } KeyValuePair<Point, Size> kpTrimming = new KeyValuePair<Point, Size>(Point.Empty, Size.Empty); Bitmap bmpScanned = PerformScan(runeScape, kpDimensions.Key, kpDimensions.Value); Bitmap bmpScanned_Cropped = CropAdvertAndBlackSpace(bmpScanned, kpDimensions, out kpTrimming); scan.bmpResult = ((bmpScanned_Cropped == null) ? bmpScanned : bmpScanned_Cropped); scan.ptWindow = kpDimensions.Key; if (bmpScanned_Cropped == null || kpTrimming.Key != Point.Empty) { scan.ptCompensate = new Point(kpTrimming.Key.X, kpTrimming.Key.Y); } return scan; }
public str_ScanResult Scan(CRuneScape runeScape, EScanType scanType) { switch (scanType) { case EScanType.Basic: return BasicScan(runeScape); } str_ScanResult scan; scan.bmpResult = null; scan.ptWindow = new Point(0, 0); scan.ptCompensate = new Point(0, 0); return scan; }
public CGameSnapshot(CRuneScape _osrs, CRuneScapeOCR _ocr, CScanner _scanner, CInteraction _interaction, CVirtualCanvas _canvas, bool _scribe) { this.runeScape = _osrs; this.opticalCharRecognition = _ocr; this.windowScanner = _scanner; this.windowInteraction = _interaction; this.virtualCanvas = _canvas; this.bShouldScribe = _scribe; this.char_LastScan = new List<str_Char>(); this.word_LastScan = new List<CWord>(); }
private Bitmap PerformScan(CRuneScape runeScape, Point ptBegin, Size szDimensions) { IntPtr hdcSource = CWinAPI.GetDC(runeScape.WindowHandle), hdcDestination = CWinAPI.CreateCompatibleDC(hdcSource), hBitmap = CWinAPI.CreateCompatibleBitmap(hdcSource, szDimensions.Width, szDimensions.Height), hOld = CWinAPI.SelectObject(hdcDestination, hBitmap); CWinAPI.SetForegroundWindow(runeScape.WindowHandle); CWinAPI.BitBlt(hdcDestination, 0, 0, szDimensions.Width, szDimensions.Height, hdcSource, 0, 0, 0x00CC0020); CWinAPI.SelectObject(hdcDestination, hOld); Bitmap bmpResult = new Bitmap(Image.FromHbitmap(hBitmap)); CWinAPI.DeleteDC(hdcDestination); CWinAPI.ReleaseDC(runeScape.WindowHandle, hdcSource); CWinAPI.DeleteObject(hBitmap); return bmpResult; }
private KeyValuePair<Point, Size> GetWindowDimensions(CRuneScape runeScape) { WinAPI.Rectangle result = new WinAPI.Rectangle(); CWinAPI.GetWindowRect(runeScape.WindowHandle, ref result); int iWidth = result.Right - result.Left; int iHeight = result.Bottom - result.Top; return new KeyValuePair<Point, Size>(new Point(result.Left, result.Top), new Size(iWidth, iHeight)); }
public CClickMouse(CRuneScape _runescape, ClickButton _button) : base(_runescape) { this.btnToClick = _button; }
public CClickMouse(CRuneScape _runescape, ClickButton _button, Point _location) : base(_runescape) { this.btnToClick = _button; this.ptLocationToClick = _location; }
public CTypeString(CRuneScape _runescape, string _msg, int _pause, int _rand) : base(_runescape) { this.sMessage = _msg; this.iPauseTime = _pause; this.iPauseTimeRandom = _rand; }
public CTypeString(CRuneScape _runescape, string _msg) : base(_runescape) { this.sMessage = _msg; }
public CKeyPress(CRuneScape _runescape, Keys _key) : base(_runescape) { this.cKey = _key; }
public CInteraction(CRuneScape _runescape) { this.runeScape = _runescape; this.qCommands = new Queue<CCommand>(); }
public CCommand(CRuneScape _runescape) { this.runeScape = _runescape; }