Results 1 to 3 of 3

Thread: Bitmap help

  1. #1
    Join Date
    Dec 2011
    Posts
    5
    Mentioned
    0 Post(s)
    Quoted
    0 Post(s)

    Default Bitmap help

    i am making a simple script for a private server to bot prayer, i am having trouble with bitmaps, im finding the altar using a bitmap (not the best option but i just wanted to learn how to use the bitmap functions) however the script finds the altar but im just wondering how do i move my mouse to the altar.

    code

    Simba Code:
    program pwnprayer;

    Var
     altar, X, Y:Integer;


    procedure findaltar1;



    begin

     altar:= BitmapFromString(23, 20, 'meJyllEEKgzAQRc8gFIQe34WIYi' +
            'WiKKK0tHgOF72GxQ4MfH6nxhYiD3GTN9/JJOv6WsPYtk3ecXwenJu' +
            'nCVzbFgxVxfRlCbqiYMk8jj5uXQfGugYilIUseQwD2FV9ZHNOOZAc' +
          'CtMPnNOWLJJUmApALfpc1JZImvVpvnoE5TgCosCUElUXQKIfBCM5d' +
            'b+PMGoXiy0Q==');

     If (FindBitmap(altar, X, Y)) Then
    Writeln('Found the altar bitmap')


    Else
    Writeln('Could not find altar');


    End;


    procedure findbones1;


    begin

    MoveMouse(577,224);
    wait (50);
    ClickMouse(577,224,Mouse_right);
    wait (500);
    MoveMouse(577,262);
    wait (300);
    ClickMouse(577,262,Mouse_left);
    SetTargetBitmap(altar);

    end;




    begin
    findaltar1;
    findbones1;
    end.





    so how would i move the mouse to the position of the bitmap.

    first ever attempt at making something using simba or scar.

  2. #2
    Join Date
    Sep 2008
    Location
    Not here.
    Posts
    5,422
    Mentioned
    13 Post(s)
    Quoted
    242 Post(s)

    Default

    FindBitmap returns the coordinates of the bitmap in X and Y. Just change your if then statement into an if-then begin end else statement and then add a movemouse and clickmouse inside the new begin-end section.

    You will also probably want to use better waits inbetween mouse movements. I don't know if the private server has a banning system, but its good practice to add Random(numberhere) to your waits.
    Simba Code:
    if FindBitmap(altar, X, Y) then
    begin
      WriteLn('Found altar, clicking it');
      MoveMouse(X, Y);
      Wait(50 + Random(25));
      ClickMouse(X, Y, mouse_Left);
      Wait(50 + Random(25));
    end else
      WriteLn('Altar not found');

    Also, remove SetTargetBitmap(altar) as that will change what simba is targeting with its input and output functions(and you can't target a bitmap loaded in the memory with the mouse or keyboard very well ).

    You will probably want to loop the altar and bone clicking so throw a repeat-until in there.

    Simba Code:
    begin
      repeat
        findaltar1;
        findbones1;
      until False;
    end.

    Finally you will want to only load the bitmap once and then free it at the end of the script, so that you do not create a memory leak.
    Simba Code:
    begin
      altar := BitmapFromString(23, 20, 'meJyllEEKgzAQRc8gFIQe34WIYi' +
            'WiKKK0tHgOF72GxQ4MfH6nxhYiD3GTN9/JJOv6WsPYtk3ecXwenJu' +
            'nCVzbFgxVxfRlCbqiYMk8jj5uXQfGugYilIUseQwD2FV9ZHNOOZAc' +
          'CtMPnNOWLJJUmApALfpc1JZImvVpvnoE5TgCosCUElUXQKIfBCM5d' +
            'b+PMGoXiy0Q==');
      repeat
        findaltar1;
        findbones1;
      until False;
      FreeBitmap(altar);
    end.

  3. #3
    Join Date
    Dec 2011
    Posts
    5
    Mentioned
    0 Post(s)
    Quoted
    0 Post(s)

    Default Thank you

    i managed to make the bone altar script and added banking, found out half way throught that a bitmap was not the best way to find the altar so had to change it to another method, my first working script. couldn't of done it without you

    i used the bitmap function to find the bones instead which worked out awesome.

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
  •