Results 1 to 2 of 2

Thread: What is wrong? (FindBitmapIn- function)

  1. #1
    Join Date
    Aug 2008
    Location
    Finland
    Posts
    2,851
    Mentioned
    3 Post(s)
    Quoted
    2 Post(s)

    Default What is wrong? (FindBitmapIn- function)

    SCAR Code:
    if FindBitmapIn(log, x, y, MIX1, MIY1, MIX2, MIY2) then
      begin
      MouseItem(1, true);
      wait(200+random(200));
      Mouse(x, y, 0, 0, true);
      wait(BurnTime +random(500));
      Inc(WoodBurned);
       if FindText(x, y, 'ou can', SmallChars, 0, 440, 500, 458)then
       begin
        Dec(WoodBurned);
        RunTo(rundir, false);
        wait(1500+random(500));
       end;
       wait(250+random(250));
       end;

    This is a part from my Burn wood procedure (Chop&Burn by maraizzos, an older version can be found in the forum My first script)

    And after chopping wood, the script is supposed to check if there are any logs in the inv, and
    1. if yes, then MouseItem(1, true) which is tinderbox.
    2. if not, then go back to Chop wood procedure
    3. if yes, but burning fails (standing on a campfire) then its supposed to RunTo(rundir, false). Rundir is declared former on the script.

    What does it do now? After logging, it seems to check if there are any logs, and then log out :S That same bitmap has worked before, then i changed the script abit, now it doesnt work.

    PROBLEM SOLVED. THE PROBLEM WAS IN THE BITMAP ^^

  2. #2
    Join Date
    Dec 2006
    Location
    UK!!
    Posts
    910
    Mentioned
    0 Post(s)
    Quoted
    0 Post(s)

    Default

    Whats the failsafe?
    as in:
    SCAR Code:
    if FindBitmapIn(log, x, y, MIX1, MIY1, MIX2, MIY2) then
      begin
      MouseItem(1, true);
      wait(200+random(200));
      Mouse(x, y, 0, 0, true);
      wait(BurnTime +random(500));
      Inc(WoodBurned);
       if FindText(x, y, 'ou can', SmallChars, 0, 440, 500, 458)then
       begin
        Dec(WoodBurned);
        RunTo(rundir, false);
        wait(1500+random(500));
       end;
       wait(250+random(250));
       end;
    if not FindBitmapIn(log, x, y, MIX1, MIY1, MIX2, MIY2) then

    Otherwise it could be a problem in your mainloop?
    since we aren't given then logout command its hard to see how to help (for me anyway)
    but try adding
    SCAR Code:
    if FindBitmapIn(log, x, y, MIX1, MIY1, MIX2, MIY2) then
      writeln('Found the log BMP');
      begin
      MouseItem(1, true);
      writeln('Clicked tinderbox');
      wait(200+random(200));
      Mouse(x, y, 0, 0, true);
      writeln('clicked burn logs');
      wait(BurnTime +random(500));
      Inc(WoodBurned);
       if FindText(x, y, 'ou can', SmallChars, 0, 440, 500, 458)then
       writeln('found text');
       begin
        Dec(WoodBurned);
        RunTo(rundir, false);
        writeln('running away');
        wait(1500+random(500));
       end;
       wait(250+random(250));
       end;

    its a nooby way but it helps a lot, this way you can see where the function fails. Hopefully...

    baring in mind ive been away for some time

    ~Spaz

Thread Information

Users Browsing this Thread

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

Similar Threads

  1. Whats wrong with this function?
    By fabis94 in forum OSR Help
    Replies: 13
    Last Post: 07-30-2008, 04:50 PM
  2. Replies: 2
    Last Post: 02-26-2008, 08:26 PM
  3. What is wrong with this function?
    By mikevskater in forum OSR Help
    Replies: 4
    Last Post: 02-20-2008, 06:57 PM

Posting Permissions

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