Page 3 of 3 FirstFirst 123
Results 51 to 66 of 66

Thread: Ultimate Bitmap Tutorial!

  1. #51
    Join Date
    Jan 2012
    Posts
    40
    Mentioned
    0 Post(s)
    Quoted
    7 Post(s)

    Default

    Thank you very much for this tutorial. Very helpful and you explained everything clearly, except for the memory leak, because I'm not too sure what that is. I can look it up anyways and I don't think its a necessity in your guide, but it wouldn't hurt explaining the concept of memory leaks lightly.

  2. #52
    Join Date
    Mar 2013
    Posts
    11
    Mentioned
    0 Post(s)
    Quoted
    6 Post(s)

    Default

    Error: Exception: Mask is invalid. Width/Height: (9,6). WhiteHi/BlackHi: (-1,53) at line 780
    The following DTMs were not freed: [0, 1, 2, 3, SRL - Lamp bitmap, SRL - Book of Knowledge]
    The following bitmaps were not freed: [SRL - Mod bitmap, SRL - Admin bitmap, SRL - Minimap Mask bitmap]

  3. #53
    Join Date
    Nov 2008
    Location
    Melbourne, Australia
    Posts
    2,240
    Mentioned
    3 Post(s)
    Quoted
    11 Post(s)

    Default

    Your script is all out of wack. I would have done it like this instead.

    program runes;

    Var mind, x, y:Integer;
    begin
    mind := BitmapFromString(20, 19, 'meJx9ks1KQlEUhaGxr1LPUOAgIT' +
    'EiMzHTzMzUNDMVMzUzEyWLkuhnIE2a9DK9QA/TBws2h3srWIPLvft' +
    'ba519br3Rb7dHgeIX6nQm3e4t6l3eof7VPRpcPwxvZmg0ehqP n6fT' +
    't8fZ+8vrx3z+2WwOUKs1FI4PDn+ZaAaJrZ31UL3Rx0Hv8cHBb 6KvO' +
    'CDSwaunXWQOMllYXHL1axOOUC6fo8rJBZKPB5T8TcALhXqp1E Qy0a' +
    'Q5qIyetRb3RPl8DeGANKMabigOfpzoQPXbpAFPDfNRB3c+e1B BucM' +
    'q0ow6GO6yyEA2lt4rZvaPEQ6acU8hB1uCXQe12VUqdfQPrv56 qYuw' +
    'nwE2mcyBuw7+C3L7G84fAos8G3BBpeuT4fpJEomsUUS7/dmelXfNy' +
    'dUdxeMZcKV7ytv+5SCQXN0y+MbmDrjHAdz6G25rt1VHItvgsV ga1s' +
    'XFKt36CycanPRQaD0cjsohurVLAXd76u+yyLa9vLIaDK65DnS wI/i' +
    'Pj4NF/wDVP8hY');
    If FindBitmapIn(mind, X, Y, 0, 0, 400, 400) Then movemouse(X, Y);
    FreeBitmap(mind);
    end.
    Click here to find out how to get full screen without members! | Click here to check out my Ultimate Bitmap Tutorial! Edited to work with Simba! |

  4. #54
    Join Date
    May 2013
    Posts
    46
    Mentioned
    0 Post(s)
    Quoted
    24 Post(s)

    Default

    If (FindBitmap(copper, X, Y)) Then //This will search the screen for the bitmap
    Writeln('Found the copper bitmap') //Tells us it found it
    Else
    Writeln('Could not find copper'); //Tells us we didn't find it
    End;
    [/Simba]
    __________________________________________________ __________________________________________________ _____________________________
    Simba Code:
    FindBitmapIn(copper, X, Y, 0, 0, 100, 100);
    This will search for the bitmap in a defined area of your screen. In this example it will search for the bitmap from 0, 0 to 100, 100
    __________________________________________________ __________________________________________________ ______________________________
    [simba]
    If (FindBitmapToleranceIn(copper, x, y, 0, 0, 100, 100, 25)) Then
    Begin
    Writeln('Found the copper bitmap') //Tells us it found it
    Mouse(X, Y, 5, 5, true); //Clicks the bitmap with a randomness of 5, 5
    FreeBitmap(copper); //This then frees the bitmap
    End
    __________________________________________________ __________________________________________________ ______________________________
    MY SCRIPT

    program sn;

    var
    S, X, Y:Integer;

    begin
    S := BitmapFromString(10, 16, 'meJy9lGtIk1EYx1OzL5VdkS4KXY' +
    'joQxFA==');

    If (FindBitmapIn(S, x, y, 0, 0, 100, 100)) Then
    Writeln('Found the item bitmap') //Tells us it found it
    movemouse(X, Y, 5, 5, true); //Clicks the bitmap with a randomness of 5, 5
    FreeBitmap(S); //This then frees the bitmap
    Else
    Writeln('Could not find item'); //Tells us we didn't find it
    End;

    Error: Operator expected at line 12
    Compiling failed.
    __________________________________________________ __________________________________________________ _______________________________
    heres another way i tried it

    Begin
    S := BitmapFromString(10, 16, 'meJy9lGtIk1EYx1OzL5VdkS4KXY' +
    'joQxFA==');

    If (FindBitmapIn(S, x, y, 0, 0, 100, 100)) Then
    Writeln('Found the copper bitmap'); //Tells us it found it
    movemouse(X, Y, 5, 5); //Clicks the bitmap with a randomness of 5, 5
    FreeBitmap(S); //This then frees the bitmap
    Else
    Writeln('Could not find copper'); //Tells us we didn't find it
    End;

    Error: Found unexpected token "Else", expected "End" at line 16
    Compiling failed.

    __________________________________________________ __________________________________________________ ________________________________
    THIS IS THE ONLY WAY I COULD MAKE IT WORK BUT IT ALWAYS CLICKS (0, 0) PART OF THE BITMAP

    program sn;

    var
    S, X, Y:Integer;

    begin
    S := BitmapFromString(10, 16, 'meJy9lGtIk1EYx1OzL5VdkS4KXY' +
    'joQxFA==');

    If (FindBitmapIn(S, x, y, 0, 0, 100, 100)) Then
    Writeln('Found the item bitmap'); //Tells us it found it
    movemouse(X, Y); //Clicks the bitmap with a randomness of 5, 5
    FreeBitmap(S); //This then frees the bitmap
    End;

    Compiled successfully in 717 ms. <<<<<<BUT I HAD TO REMOVE THE 5, 5 RANDOMNESS AND THE ELSE FOR THE WRITELN (COULD NOT FIND ITEM)
    __________________________________________________ __________________________________________________ ____________________________
    ALL I WANNA DO IS FIND BITMAP IN THE DEFINED AREA WITCH I HAVE AND HAVE A RANDOMNESS OF WHERE THE MOUSE MOVES AND CLICKS ALSO I WOULD LIKE TO HAVE THE WRITE LINE FEATURE SAYING IF IT FOUND THE IMAGE OR IF IT DIDNT AND FREE THE BITMAP

  5. #55
    Join Date
    Jan 2013
    Posts
    146
    Mentioned
    0 Post(s)
    Quoted
    56 Post(s)

    Default

    Quote Originally Posted by maxlvs View Post
    If (FindBitmap(copper, X, Y)) Then //This will search the screen for the bitmap
    Writeln('Found the copper bitmap') //Tells us it found it
    Else
    Writeln('Could not find copper'); //Tells us we didn't find it
    End;
    [/Simba]
    __________________________________________________ __________________________________________________ _____________________________
    Simba Code:
    FindBitmapIn(copper, X, Y, 0, 0, 100, 100);
    This will search for the bitmap in a defined area of your screen. In this example it will search for the bitmap from 0, 0 to 100, 100
    __________________________________________________ __________________________________________________ ______________________________
    [simba]
    If (FindBitmapToleranceIn(copper, x, y, 0, 0, 100, 100, 25)) Then
    Begin
    Writeln('Found the copper bitmap') //Tells us it found it
    Mouse(X, Y, 5, 5, true); //Clicks the bitmap with a randomness of 5, 5
    FreeBitmap(copper); //This then frees the bitmap
    End
    __________________________________________________ __________________________________________________ ______________________________
    MY SCRIPT

    program sn;

    var
    S, X, Y:Integer;

    begin
    S := BitmapFromString(10, 16, 'meJy9lGtIk1EYx1OzL5VdkS4KXY' +
    'joQxFA==');

    If (FindBitmapIn(S, x, y, 0, 0, 100, 100)) Then
    Writeln('Found the item bitmap') //Tells us it found it
    movemouse(X, Y, 5, 5, true); //Clicks the bitmap with a randomness of 5, 5
    FreeBitmap(S); //This then frees the bitmap
    Else
    Writeln('Could not find item'); //Tells us we didn't find it
    End;

    Error: Operator expected at line 12
    Compiling failed.
    __________________________________________________ __________________________________________________ _______________________________
    heres another way i tried it

    Begin
    S := BitmapFromString(10, 16, 'meJy9lGtIk1EYx1OzL5VdkS4KXY' +
    'joQxFA==');

    If (FindBitmapIn(S, x, y, 0, 0, 100, 100)) Then
    Writeln('Found the copper bitmap'); //Tells us it found it
    movemouse(X, Y, 5, 5); //Clicks the bitmap with a randomness of 5, 5
    FreeBitmap(S); //This then frees the bitmap
    Else
    Writeln('Could not find copper'); //Tells us we didn't find it
    End;

    Error: Found unexpected token "Else", expected "End" at line 16
    Compiling failed.

    __________________________________________________ __________________________________________________ ________________________________
    THIS IS THE ONLY WAY I COULD MAKE IT WORK BUT IT ALWAYS CLICKS (0, 0) PART OF THE BITMAP

    program sn;

    var
    S, X, Y:Integer;

    begin
    S := BitmapFromString(10, 16, 'meJy9lGtIk1EYx1OzL5VdkS4KXY' +
    'joQxFA==');

    If (FindBitmapIn(S, x, y, 0, 0, 100, 100)) Then
    Writeln('Found the item bitmap'); //Tells us it found it
    movemouse(X, Y); //Clicks the bitmap with a randomness of 5, 5
    FreeBitmap(S); //This then frees the bitmap
    End;

    Compiled successfully in 717 ms. <<<<<<BUT I HAD TO REMOVE THE 5, 5 RANDOMNESS AND THE ELSE FOR THE WRITELN (COULD NOT FIND ITEM)
    __________________________________________________ __________________________________________________ ____________________________
    ALL I WANNA DO IS FIND BITMAP IN THE DEFINED AREA WITCH I HAVE AND HAVE A RANDOMNESS OF WHERE THE MOUSE MOVES AND CLICKS ALSO I WOULD LIKE TO HAVE THE WRITE LINE FEATURE SAYING IF IT FOUND THE IMAGE OR IF IT DIDNT AND FREE THE BITMAP

    The moveMouse function only takes 2 arguments, thats why it wasnt working for you
    I added 2 lines that add a random amount within 5 to each coordinate.
    (i'm sure there are better ways to do this but, this is the first thing that came to mind for me)

    I also formatted the if else statement a little different.
    (notice the Begin and ends)

    also, put your code in simba tags :P makes it easier to read.

    Simba Code:
    Program blah;
    var
    s, x, y, r: integer;
    Begin
    S := BitmapFromString(10, 16, 'meJy9lGtIk1EYx1OzL5VdkS4KXY' +
            'joQxFA==');

    If (FindBitmapIn(S, x, y, 0, 0, 100, 100)) Then
      begin
        x := x + random(5);
        y := y + random(5);
        Writeln('Found the copper bitmap'); //Tells us it found it
        movemouse(x, y); //Clicks the bitmap with a randomness of 5, 5
        FreeBitmap(S); //This then frees the bitmap
      end
    Else
      Writeln('Could not find copper'); //Tells us we didn't find it
    end;


    Edit: i maybe wrong, didn't realize this was OSR, im not really sure what the differences are

    Im Back... Previously known as Megaleech
    [Herbalife]

  6. #56
    Join Date
    Oct 2015
    Posts
    10
    Mentioned
    0 Post(s)
    Quoted
    2 Post(s)

    Default

    thank you verry much

  7. #57
    Join Date
    May 2013
    Posts
    46
    Mentioned
    0 Post(s)
    Quoted
    24 Post(s)

    Default

    really wow ok ill try the
    x := x + random(5);
    y := y + random(5);

    thing i didnt see any of this in the guides on the website iam some glad to get to know people like yourself i can make ya some scripts if you like also i wonder about making GUI's is that still possible

  8. #58
    Join Date
    May 2013
    Posts
    46
    Mentioned
    0 Post(s)
    Quoted
    24 Post(s)

    Default

    question i see s x and y but what is the r integer there for?

  9. #59
    Join Date
    Feb 2012
    Location
    Norway
    Posts
    995
    Mentioned
    145 Post(s)
    Quoted
    596 Post(s)

    Default

    Quote Originally Posted by maxlvs View Post
    question i see s x and y but what is the r integer there for?
    It's simply just not used.. It was most likely ment to act as a variable for the number `5` but the author (saint) chose to not use it, without removing the declaration, or something like that..
    The code-snippet can do with some cleaning, and making sure the bitmap is always freed, whether we find it or not:

    Simba Code:
    program blah;
    var
      bmp:Integer;
      x,y,w,h: Integer;
    begin
      bmp := BitmapFromString(10, 16, 'meJy9lGtIk1EYx1OzL5VdkS4KXYjoQxFA==');

      if (FindBitmapIn(bmp, x,y, 0, 0, 100,100)) then //find the starting point of the bitmap
      begin
        GetBitmapSize(bmp, W,H); //stores the width and the height of the bitmap in W and H

        x := x + W div 2;        //x is now the horizontal center of where we found the bitmap
        y := y + W div 2;        //y is now the vertical center of where we found the bitmap

        x := x + Random(-5,5);   //x and y is now randomized +/-5 around the bitmaps center.
        y := y + Random(-5,5);

        WriteLn('Found the copper bitmap');
        MoveMouse(x,y);         //Moves the mouse to the center of the bitmap (+/- 5 pixels off)
      end else
        Writeln('Could not find copper');
     
      FreeBitmap(bmp); //This then frees the bitmap
    end;

    A tiny simplification that is the exact same..:
    Simba Code:
    program blah;
    var
      bmp:Integer;
      x,y,w,h: Integer;
    begin
      bmp := BitmapFromString(10, 16, 'meJy9lGtIk1EYx1OzL5VdkS4KXYjoQxFA==');

      if (FindBitmapIn(bmp, x,y, 0, 0, 100,100)) then
      begin
        GetBitmapSize(bmp, W,H);
        x += (W div 2) + Random(-5,5);
        y += (H div 2) + Random(-5,5);
        WriteLn('Found the copper bitmap');
        MoveMouse(x,y);
      end else
        Writeln('Could not find copper');
     
      FreeBitmap(bmp);
    end;
    Last edited by slacky; 10-28-2015 at 04:12 PM.
    !No priv. messages please

  10. #60
    Join Date
    May 2013
    Posts
    46
    Mentioned
    0 Post(s)
    Quoted
    24 Post(s)

    Default

    can you get on chat so you could explain that a bit more

  11. #61
    Join Date
    Feb 2012
    Location
    Norway
    Posts
    995
    Mentioned
    145 Post(s)
    Quoted
    596 Post(s)

    Default

    Quote Originally Posted by maxlvs View Post
    can you get on chat so you could explain that a bit more
    I am _always_ idle in "the chat" (and most of the time available), but I am going out now - for a good while, so can't help you any further.
    !No priv. messages please

  12. #62
    Join Date
    May 2013
    Posts
    46
    Mentioned
    0 Post(s)
    Quoted
    24 Post(s)

    Default

    ok well maybe you have a skype or other IM way to chat if so could you PM me your info it would be great to expand my circle of scripters/programmers we gotta stick together ya know ha i lost 1 bill and 8 skill cape account and i wasnt even botting just loged into RS bot so i could multi-log to accs in same world but anyway thanks

  13. #63
    Join Date
    Dec 2011
    Posts
    2,147
    Mentioned
    221 Post(s)
    Quoted
    1068 Post(s)

    Default

    Quote Originally Posted by maxlvs View Post
    thing i didnt see any of this in the guides on the website iam some glad to get to know people like yourself i can make ya some scripts if you like also i wonder about making GUI's is that still possible
    While there are a number of ways, Obscurity has been working on ezForm which allows you to easily create GUIs for anything in Simba.

  14. #64
    Join Date
    May 2013
    Posts
    46
    Mentioned
    0 Post(s)
    Quoted
    24 Post(s)

    Default

    really is there a way to add someone like that to skype to chat or what not ? and iam talking about a GUI that will have its own cursor and beable to run RuneScape

  15. #65
    Join Date
    May 2013
    Posts
    46
    Mentioned
    0 Post(s)
    Quoted
    24 Post(s)

    Default

    Quote Originally Posted by Saint//+ View Post
    The moveMouse function only takes 2 arguments, thats why it wasnt working for you
    I added 2 lines that add a random amount within 5 to each coordinate.
    (i'm sure there are better ways to do this but, this is the first thing that came to mind for me)

    I also formatted the if else statement a little different.
    (notice the Begin and ends)

    also, put your code in simba tags :P makes it easier to read.

    Simba Code:
    Program blah;
    var
    s, x, y, r: integer;
    Begin
    S := BitmapFromString(10, 16, 'meJy9lGtIk1EYx1OzL5VdkS4KXY' +
            'joQxFA==');

    If (FindBitmapIn(S, x, y, 0, 0, 100, 100)) Then
      begin
        x := x + random(5);
        y := y + random(5);
        Writeln('Found the copper bitmap'); //Tells us it found it
        movemouse(x, y); //Clicks the bitmap with a randomness of 5, 5
        FreeBitmap(S); //This then frees the bitmap
      end
    Else
      Writeln('Could not find copper'); //Tells us we didn't find it
    end;


    Edit: i maybe wrong, didn't realize this was OSR, im not really sure what the differences are
    __________________________________________________ __________________________________________________ ____________________________________________
    i used this and it said The following bitmaps were not freed: [0]

    Program blah;
    var
    c, x, y: integer;
    Begin
    c := BitmapFromString(16, 13, 'meJxjYBg+IGLGPjiyTmvArzhz6Y' +
    'mQiVsgyC6rFYjwKE5bfDx/+cmArrVA5FjYS9AlQPVA0qdlKTHOBro' +
    'kZ9lJYlTC1eOSCp20jUhDgCohKHL2QWLUh0/bA1RJpGIGpLhAEwcA' +
    'ltMz4w==');

    If (FindBitmapIn(c, x, y, 0, 0, 100, 100)) Then
    begin
    x := x + random(5);
    y := y + random(5);
    Writeln('Found the copper bitmap'); //Tells us it found it
    movemouse(x, y); //Clicks the bitmap with a randomness of 5, 5
    FreeBitmap(c); //This then frees the bitmap
    end
    Else
    Writeln('Could not find copper'); //Tells us we didn't find it
    end;

  16. #66
    Join Date
    Jun 2015
    Posts
    30
    Mentioned
    0 Post(s)
    Quoted
    7 Post(s)

    Default

    Thank you very much for explaining the "FindDeformedBitmapToleranceIn" I was looking for something like that for ages

Page 3 of 3 FirstFirst 123

Thread Information

Users Browsing this Thread

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

Posting Permissions

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