Results 1 to 7 of 7

Thread: "The Bitmap Doesn't exist" Problem

  1. #1
    Join Date
    Jul 2013
    Posts
    6
    Mentioned
    0 Post(s)
    Quoted
    0 Post(s)

    Default "The Bitmap Doesn't exist" Problem

    Every time I run this program it clicks on the box trap but then stops when going to lay the box trap. I'm new to programming in Simba so don't lay it on too thick.



    program new;
    {$DEFINE SMART}
    {$i srl/srl.simba}

    var
    x,y,LayTrapPic: Integer;

    procedure LoadBMPs;

    begin
    LayTrapPic:= BitmapFromString(21, 14, 'meJxzD4l1H1D0Hwwo1M7AwDCctP' +
    '9HAlgDCsLAqh0uCARoWuCK8WhHsx1ZCzHaMW0nTzumArQw+Y8 B8Dg' +
    'eguCuQuYiA6zimIFDXlzDtQMAiJiIQQ==');
    end;

    procedure LayTrap;

    begin
    if (findcolor(x,y,4679031,13,6,331,188)) then
    MoveMouse(x,y);
    ClickMouse(x,y,mouse_right);

    wait(5000);

    if (findbitmap(x,y,LayTrapPic)) then
    MoveMouse(x,y);
    ClickMouse(x,y,mouse_left);
    end;

    begin
    LoadBMPs;
    repeat

    LayTrap;

    until (false);
    Freebitmap(LaytrapPic);
    end.
    Last edited by blitz; 07-02-2013 at 03:32 PM.

  2. #2
    Join Date
    Jan 2007
    Posts
    8,876
    Mentioned
    123 Post(s)
    Quoted
    327 Post(s)

    Default

    Add a wait between
    "ClickMouse(x,y,mouse_right);"
    and
    "if (findbitmap(x,y,LayTrapPic)) then"
    and your script should function.

    There's a lot of room for improvement here though; but the above should fix your current problem

  3. #3
    Join Date
    Jul 2013
    Posts
    6
    Mentioned
    0 Post(s)
    Quoted
    0 Post(s)

    Default

    Quote Originally Posted by Zyt3x View Post
    Add a wait between
    "ClickMouse(x,y,mouse_right);"
    and
    "if (findbitmap(x,y,LayTrapPic)) then"
    and your script should function.
    There's a lot of room for improvement here though; but the above should fix your current problem
    It still doesn't work. I added "wait(5000);" and now it just waits 5 seconds and still gives me the same error.

  4. #4
    Join Date
    Mar 2007
    Posts
    5,125
    Mentioned
    275 Post(s)
    Quoted
    901 Post(s)

    Default

    Try loading/unloading your bitmap outside of your repeat loop.

    Simba Code:
    begin
    LoadBMPs;
    repeat
    LayTrap;
    until (false);
    Freebitmap(LaytrapPic);
    end.

    Forum account issues? Please send me a PM

  5. #5
    Join Date
    Jul 2013
    Posts
    6
    Mentioned
    0 Post(s)
    Quoted
    0 Post(s)

    Default

    I tried adding them outside the main loop and now it doesn't even right click on the trap.

  6. #6
    Join Date
    Jul 2013
    Posts
    6
    Mentioned
    0 Post(s)
    Quoted
    0 Post(s)

    Default

    Every time I run the program it will right click on the trap, then stop and says "Error: Exception: The bitmap[295] does not exist at line 25".

  7. #7
    Join Date
    Jul 2013
    Posts
    6
    Mentioned
    0 Post(s)
    Quoted
    0 Post(s)

    Default

    I'm still having this problem.

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
  •