Results 1 to 6 of 6

Thread: No More Dead Bunnies >:O

  1. #1
    Join Date
    Jul 2008
    Posts
    79
    Mentioned
    0 Post(s)
    Quoted
    0 Post(s)

    Default No More Dead Bunnies >:O

    Ok, so here is what I believe is quite a big question. It seems like it's going to be difficult. If you've read my other posts about this, I've decided that it's much more time efficient if I just find the color of the monsters instead of looking for several images. But here is my problem, I find colors of not only the Bunnies but the dead bunnies and scenery as well. And while they are lying there for 5-10 seconds before they disappear , I'm clicking on them (or I'm stuck on a piece of scenery). And eventually die because of it. So here is my question-


    Pink Bunny // Boss Bunny

    Using FindBitmapMaskTolerance (or if any other you think would work better, let me know) could I check the color and, before clicking, check to see if it's one of the two masked images specified. This way I'm not clicking any of the dead bunnies. My code right now looks like this-

    SCAR Code:
    program Goonzu_AutoHunt;
    const
         PinkBunny = 11907831;
         BossBunny = 12430334;
    var
         x, y:integer;
         attacks:integer;
    begin
         GetClientDimensions(x, y);
         FindWindowTitlePart('GoonZu', true);
         ActivateClient;
         attacks:= 0;
      repeat
        FindColorSpiralTolerance(x, y, PinkBunny, 300, 200, 800, 500, 10)
        ClickMouse(x, y, true);
        attacks := attacks + 1;
        writeln('Pink Bunny found!' + IntToStr(attacks));
        Wait(2000);
                   FindColorSpiralTolerance(x, y, BossBunny, 300, 200, 800, 500, 10)
                   ClickMouse(x + 10, y + 10, true);
                   attacks:= attacks + 1;
                   writeln('Boss Bunny found!' + IntToStr(attacks))
                   Wait(2000);
        until false
    end.

    This works, I've tested it.

    Ok, just to let you guys know. I don't want to come across as just asking for help and copying and pasting the answers. I'm not asking for freebies or handouts like an immature 12 year old who doesn't want to learn anything. The sources I use (mainly the SCAR help page with all the references; Toolbar -> Help -> Help) gives me quite a lot of information, but it doesn't teach you how to use it. Just shows you syntax basically.

    All help is appreciated. Thanks for your help and future help
    Also, if any of you smart guys can think of a better way of doing this I'm all ears ^^

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

    Default

    If you search for all the dead bunnies first, you can then use FindColorSkipBoxes (or something similar, check the colour finding section of the Scar manual) to search for the colours except in areas specified by the TBox array you input, meaning you can search for the bitmap, then if it finds it, it adds the 4 co-ordinates needed for a TBox to a new TBox and then continues until it runs out and it can then search for the colour minus the TBox'es. This is quite difficult to grasp stuff, so if you need, I can write a short script for setting up a single TBox and you can see if you can get the hang of it from there.
    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
    Jul 2008
    Posts
    79
    Mentioned
    0 Post(s)
    Quoted
    0 Post(s)

    Default

    Well, I understand what you are saying but I'm worried this might slow down the script immensely like the bitmap finding. As in, new dead bunnies will be emerging and old ones will be disappearing constantly. So I would have to search before every click. Will this be a problem?

    I'm going to try it out anyway.

  4. #4
    Join Date
    Jul 2008
    Posts
    79
    Mentioned
    0 Post(s)
    Quoted
    0 Post(s)

    Default

    Truly sorry about the double post, I know it just welcomes flaming but I didn't want to edit my last post because I'm past that currently. And the topic title doesn't bold and move to the top when you edit your last post ^^

    Anyway, I'm trying what you recommended mixster. But I don't know if this is right, it's certainly a lot harder then I expected. Though I am familiar with arrays because I'm experience with PHP. Here is my script-

    SCAR Code:
    program Goonzu_AutoHunt;
    const
         PinkBunny = 11907831;
         BossBunny = 12430334;
    var
       x, y, w, h, i: Integer;
       DeadBunnyArray: array [1..20] of Integer;
       DeadBunny: integer;
       DeadBossBunny: integer;
    begin
         GetClientDimensions(w, h);
         DeadBunny := LoadBitmap(ScriptPath + 'DeadBunny.bmp');
         DeadBossBunny := LoadBitmap(ScriptPath + 'DeadBossBunny.bmp');
    Repeat
         DeadBunnyArray := FindBitmapMaskTolerance(); //Got stuck here
         
    end.

    I think I'm going about this right. I'm going to start with my mind set from begin. Everything previous to that is just setting up the variables, but you can look over those too if you wish.

    First: I Load the images to variables DeadBunny and DeadBossBunny

    Second:
    I have DeadBunnyArray to take on the values of the found locations of the images (though I'm confused on the difference between 'Tolerance' and 'ContourTolerance' )

    to come >>
    Third: Use DeadBunnyArray in FindColorSkipBox to get the locations of colors excluding the Dead Bunnies.

    3 steps I can think of at the moment. I think that's complete. But that's my game plan. Will that work?

    Also, in the second step. I know what ContourTolerance means. But I don't know why there is both Tolerance and ContourTolerance. When I try and put a value in for tolerance it says-

    Type mismatch in script
    Can anyone show me how to set the FindBitmapMaskTolerance? Because this-

    FindBitmapMaskTolerance(mask: Integer; var x, y: Integer; x1, y1, x2, y2: Integer; Tolerance, ContourTolerance: Integer): Boolean;
    from the SCAR manual doesn't help much o.O

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

    Default

    DeadBunnies should be an array of TBox (no set length as you never know how man you will find).
    Past that, everything is looking good.
    You get the type mismatch, because none of the finding functions return an integer - they either return a boolean or nothing.
    It should be something like:
    SCAR Code:
    if FindBitmapMaskTolerance(DeadBunny, x, y, 0, 0, w, h, toleranceHere, tolereanceHere) then
      begin
        SetArrayLength(DeadBunnyArray, High(DeadBunnyArray) + 2);
        DeadBunnyArray[High(DeadBunnyArray)].x1 := x - z;
        DeadBunnyArray[High(DeadBunnyArray)].y1 := y - z;
        DeadBunnyArray[High(DeadBunnyArray)].x2 := x + z;
        DeadBunnyArray[High(DeadBunnyArray)].y2 := y + z;
      end;
    What that will do is search for the dead bunny and if it finds it, then adds a new TBox to the array, which holds the area that the dead bunny takes. a TBox is made of 2 TPoint's, x1,y1 and x2,y2, which can be used to make 4 points that encompass the box (x1,y1 for top left, x2,y1 for top right, x2,y2 for bottom right and x1,y2 for bottom left). To fill in those properly, you want to minus half the size of the bitmaps height from y and half the width from x1 then do the opposite for x2 and y2 (replace z with half the width/height).

    For FindColorSkipBox, it's very similar to FindColor or FindColorSpiral as it takes in all of their variables and you then just have to put in the TBox DeadBunnyArray where it should go.

    This shouldn't be to slow if done properly - the biggest problem will probably be finding the DeadBunny's as it will continually find the first dead bunny, but there may also be a FindBitmapSkipBox and if there is then you can just put in DeadBunnyArray where appropriate until it doesn't find it (you can use an else Break; after the block after if FindBitmapMaskTolerance to get out of the repeat loop).
    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.

  6. #6
    Join Date
    Feb 2007
    Location
    @ SRL
    Posts
    402
    Mentioned
    0 Post(s)
    Quoted
    0 Post(s)

    Default

    wow mixster, massive overkill there

    @ groog
    Do the pictures of these bunnys change shape at all?
    Because if they dont, a you could use DTMs to click the alive bunnys and it wont worry about the dead ones.

    If you need any help, send me a picture of an alive bunny that your meant to click on, and a boss bunny. And I'll make it for you, and send it back..
    Then you can read it and learn from it, I'm just a PM away if you need me
    The game has an unexplainable attraction that convinces the player they are having fun, despite the fact that all they are doing is performing repetitive tasks to increase their statistics. "The game is actually a graphical nightmare and its gameplay is simple at best. Yet something, perhaps by subliminal means, forces the player - against his will - to play the game, and to believe that they are having fun".

Thread Information

Users Browsing this Thread

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

Similar Threads

  1. Bobarkinator is not dead.
    By Jason2gs in forum News and General
    Replies: 15
    Last Post: 07-07-2008, 05:57 PM
  2. SRL Dead?
    By danman1212 in forum RuneScape News and General
    Replies: 5
    Last Post: 05-19-2008, 12:58 PM
  3. My Dead script =0
    By tomdavies in forum OSR Help
    Replies: 9
    Last Post: 10-29-2007, 10:08 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
  •