Results 1 to 4 of 4

Thread: Bitmap problem

  1. #1
    Join Date
    Oct 2007
    Posts
    15
    Mentioned
    0 Post(s)
    Quoted
    0 Post(s)

    Default Bitmap problem

    I've created this captcha cracker but somehow it keeps given weird errors.
    This is the code ( i made it shorter )
    Code:
    program New;
    {.include SRL/SRL.scar}
    
    var
    login, a, b, c, d, e, nul, een, twee, drie, vier, vijf, zes, zeven, acht, negen, x, y: Integer;
    
    const
    y1= 365;
    y2= 380;
    
    x1a= 940;
    x2a= 955;
    
    x1b= 949;
    x2b= 964;
    
    x1c= 959;
    x2c= 974;
    
    x1d= 967;
    x2d= 982;
    
    x1e= 975;
    x2e= 99;
    
    procedure find;
    begin
      een := BitmapFromString(9, 12, 'beNolj0cOhDAQBF/CgQNRIpic4/' +
           '8/wgWRJBCwbAn6MLI90z1lIeq6TtNUluWmaaIoSpIky7I8z03TdBy' +
           'Hc1EUtm3P8/w8D5OaplHLsgzDUJKk59V5nlVV8R4EgaqqbdvyuK4r' +
           '9bouXdfJIbnrOsMw4jju+36aJrqe54WvXNdlEV3qfd9fCx6GyfzY0' +
           'LIs+77DxpiiKL7vW5YFLfkfCS5o6WIRQnCF5/fqi4KBL7CufIVl2z' +
           'bmYcDYvBqGgfdxHI/j4AAqXn6Bi0VfJYp8EsQfQcmBbQ==');
      een := BitmapFromString(6, 1, 'beNpjYEAHAAASAAE=');
      twee := BitmapFromString(8, 44, 'beNpjYBgFo2AUjALsAAAEIAAB');
      drie := BitmapFromString(8, 10, 'beNoljUcKhUAQBS8jBsyKo5hAZ' +
           'e5/CLduHNAxjr/gb5rqF7ptu65rY8z3fcx1XYFhGNI0BY7jcF13mq' +
           'b/uixLVVWe53Vd1/d9WZZhGGZZhrXvO3eEEIiE8zx/noeD5KMoQuQ' +
           'mCkmlFCtJKWUQBLgUHcfBuq6rbVusoiiSJKHLF0Brfd930zRYKLiW' +
           'ZfGCyvu+8zwD6L7vU4d5NI4jDGzbhnKeJzOOY/sHWr55wA==');
      vier := BitmapFromString(8, 10, 'beNo9jtEKhCAURP+jRx/KyDAoR' +
           'K1EAqH//4a+IBBxXd0dkt37NM4d5x6lGGP7vk/TJKVUSsUYc87zPK' +
           '/rOgzDeZ5N03x+I4TAqus6rTWer2dSStu2LctyHMd936UUxLD13ht' +
           'jOOf1L6UUnVUTQqoYx9FaW/3rupxzKIRGyfuZEEJN4igIcQJhcFYf' +
           'Jhz4fd9Dg+HP2bYtfAAgDwFIsKkv/aeDIA==');
      vijf := BitmapFromString(37, 57, 'beNrtwTEBAAAAwqD1T20ND6AA' +
           'AAAAAAAuDBi3AAE=');
      zes := BitmapFromString(8, 10, 'beNo9TkkOhDAM+01BLCqiULogeu' +
           'iJ/7+DAwKhlq1YE2lychzHNudN0/R9f993SinG+L6vUspam+d5+k1' +
           'Zll3XAVzX5ZwDOI5DSglyGAbvPda6rklcVdU4jm3bFkUxTROs4An+' +
           'L8DgCj6EsCwLrVmWATzPI4QgDdK11sYYNCEGenSDOSJQGOn7vm/bx' +
           'hgjAcrAiuLmecYjNOd50nVdV5jzD5TujDU=');
      zeven := BitmapFromString(8, 10, 'beNoljjkKgDAURO+iaOESjBJj' +
           'BPdWC+/fiq0gCFpIfJgUn/w3k5kodV2Xtfa+b/uf8zzduq6rlLIsy' +
           'yAIsixblmXbNqQ8z+M47rpumqYkSZRS7qEQoqoqJmZjzPM8wDAM+7' +
           '6HpGmK/31fOGpRFFEUITFdddu2vu8TSyl3l0k7dUCSh2E4jmPfd60' +
           '1pXBCxnHERuY8z6zwpmnquvY8DzOSg/I//E19Q5tuAg==');
      negen := BitmapFromString(1, 47, 'beNpjYBhEAAAAjQAB');
    cleardebug;
    
    // ****************** Begin A ***************************
    
      if(FindBitmapToleranceIn(een, x, y, x1a, y1, x2a, y2, 2) )then
       begin
        a := 1
        writeln('IT WORKS')
       end;
    
        end;
    
    begin
      SetupSRL;
      repeat
      find;
      until(false);
    end.
    First it finds the bitmap "een", and it write IT WORKS a couple of times but then it gives me this error:

    Code:
    IT WORKS
    [Runtime Error] : Exception: Can't create compatible DC in line 48 in script C:\Documents and Settings\mypc\Mijn documens\test.scar
    I've checked the bitmap where it gives the error and re captured it. But it still gives me the same error.

  2. #2
    Join Date
    Jun 2007
    Location
    Wednesday
    Posts
    2,446
    Mentioned
    3 Post(s)
    Quoted
    1 Post(s)

    Default

    I'm not 100% sure, but you've given 'een' a bitmap twice, so that will cause some problems. Otherwise, you might need to empty the bitmap first as it tries to overwrite it during runtime, but can't (I'm not a big fan of bitmaps, so not that much help). Otherwise, it may be a different part of the script (especially since DC is used in setting a bitmap as an area to find in a new screen) though it could also be that you have a faulty FindBitmapToleranceIn (try making another script and just have the 1 bitmap and just get it to search for that - leave it running for a bit and if it crashes you may need to reinstall SRL/scar)
    By reading this signature you agree that mixster is superior to you in each and every way except the bad ways but including the really bad ways.

  3. #3
    Join Date
    Oct 2007
    Posts
    15
    Mentioned
    0 Post(s)
    Quoted
    0 Post(s)

    Default

    I runned this script:
    Code:
    program New;
    {.include SRL/SRL.scar}
    
    var
    vier,a, x, y: Integer;
    
    procedure find;
    begin
      vier := BitmapFromString(8, 10, 'beNolj8EORjAQhF+FREhQxUU1O' +
           'LiI938PQQQl9P9+ndNkdndmVsphGOI4zvO8KAqItfY4DiFEWZZN04' +
           'zjKKV8nmffd0Zd12mtsywLw9B+uK7LGBMEASd1XZ/nicgCJxAc2ra' +
           'dpgmODymQ932VUsuywH3fVx/u+yY3iiJElwW2bcPf8aqqPM9LkqTv' +
           '+zRNnYghOgpBFHb6uq70JI5lPmJEsXme/x1+bsSB3A==');
    cleardebug;
    
      if(FindBitmapToleranceIn(vier, x, y, 939, 363, 956, 381, 2) )then
       begin
        a := 4
        writeln('IT WORKS!')
       end;
       end;
    
    begin
      SetupSRL;
      repeat
      find;
      until(false);
    end.
    But got the same problem, it works for a couple of times but then it just me this error: [Runtime Error] : Exception: Can't create compatible DC in line 16 in script ..
    So now it sais the error is on this line "if(FindBitmapToleranceIn(vier, x, y, 939, 363, 956, 381, 2) )then".

    All my other script with the findbitmap function still works so i dont think i need to re instal scar...

  4. #4
    Join Date
    Jun 2007
    Location
    Wednesday
    Posts
    2,446
    Mentioned
    3 Post(s)
    Quoted
    1 Post(s)

    Default

    You need to add a ';' after your writeln (just noticed, but that;'s not causing the error). What is though is that you need to add a wait (it's trying to redraw the bitmap etc. too quickly, thus giving it an error) - I added 25 ms and it worked well past 1000 loops.
    By reading this signature you agree that mixster is superior to you in each and every way except the bad ways but including the really bad ways.

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Similar Threads

  1. Bitmap problem
    By Pauwelke in forum OSR Help
    Replies: 5
    Last Post: 06-08-2008, 04:56 PM
  2. Problem with Bitmap
    By Supersepi in forum OSR Help
    Replies: 15
    Last Post: 10-02-2007, 07:20 PM
  3. Bitmap Problem
    By Kingofptw in forum OSR Help
    Replies: 5
    Last Post: 03-22-2007, 01:43 AM
  4. Multiple Bitmap problem
    By extreme300 in forum OSR Help
    Replies: 3
    Last Post: 02-25-2007, 01:20 AM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •