Author Topic: Help On scripting ( Still A Noob )  (Read 876 times)

0 Members and 1 Guest are viewing this topic.

johnmann

  • Klass Klown
  • ***
  • Posts: 300
    • View Profile
    • http://www.tkc-community.net
Help On scripting ( Still A Noob )
« on: July 28, 2012, 07:50:10 pm »
Hi i am trying to screen and scan my full monitor ( not just abit of it )

this is what i have so far

      RGBQUAD * pPixels;

      int TimeTakenScreenAndScan;
      while(true)
      {   
            if(!GetAsyncKeyState('X'))
            {
                  TimeTakenScreenAndScan = clock();

            if(!TakeScreenShot(aimthr->GameWindow, bm, hbmap, bmi, hdcShot, hbmapOld, aimthr->AppWnd))
                        break;
                  HBITMAP hbmapNew = CreateCompatibleBitmap(hdcShot, rcWindow.right - rcWindow.left, rcWindow.bottom - rcWindow.top);

                  HDC hdcShotNew= CreateCompatibleDC(hdcShot);
      
                  HBITMAP OldBmp = (HBITMAP) SelectObject(hdcShotNew, hbmapNew);

                  BitBlt(hdcShotNew, 0, 0, rcWindow.right - rcWindow.left, rcWindow.bottom - rcWindow.top, hdcShot, 0, 0, SRCCOPY);

void ScanBMP(ScanContents * scan)
{
      for(int y = (scan->RcWindow.bottom - scan->RcWindow.top)/4;
            y < ((scan->RcWindow.bottom - scan->RcWindow.top) - (scan->RcWindow.bottom - scan->RcWindow.top)/3.5);
            y++)
      {
      
            for(int x = (scan->RcWindow.bottom - scan->RcWindow.top)/4;
                  x < ((scan->RcWindow.bottom - scan->RcWindow.top) - (scan->RcWindow.bottom - scan->RcWindow.top)/4);
                  x++)
            {
               SetCursorPos(x+scan->RcWindow.left, (y+4)+scan->RcWindow.top);

                  if(CompareColour(scan->PPixels, scan->Bm.bmHeight, scan->Bm.bmWidth, x, y))
                  {
                     //SetCursorPos(x+scan->RcWindow.left, (y+4)+scan->RcWindow.top);

                     int z = x;
                     while(z <(int)((scan->RcWindow.right - scan->RcWindow.left)-(scan->RcWindow.right - scan->RcWindow.left)/4))
                     {
                        if(!CompareColour(scan->PPixels, scan->Bm.bmHeight, scan->Bm.bmWidth, z, y))
                        {
                           break;
                        }
                        z++;
                     }


This is just part of my script wondering if any one could help me Turn this into Full screen scanning ? I have tried looking but not alot of answers out there

Thank

Johnmann

Coronel_Niel

  • Insane Joker
  • ****
  • Posts: 846
  • Why can't I pick my own profile picture...
    • View Profile
Re: Help On scripting ( Still A Noob )
« Reply #1 on: July 30, 2012, 05:51:21 pm »
Haven't had the chance to debug the code (Make the cursor set at each point it checks and wait 1 sec, that way you can see where it is checking, then fiddle with it until it gets the whole screen)

If it only scans the bottum 1/4 of your screen then its likely the "(int y = (scan->RcWindow.bottom - scan->RcWindow.top)/4"

But again, haven't had the chance to look over it.
"Now we are going to watch my boys do it" - Joopig