Results 1 to 12 of 12

Thread: Good Whirlpool-detection?

  1. #1
    Join Date
    Aug 2007
    Posts
    1,404
    Mentioned
    1 Post(s)
    Quoted
    0 Post(s)

    Default Good Whirlpool-detection?

    I've made a pretty-well working script today. It has good fishing-spot-detection, and a good build. Now, I'm wondering how to get a good Whirlpool-detection and handling, and a good Shark-detection and handling.

    Thanks in advance,

    -Knives

  2. #2
    Join Date
    Sep 2006
    Posts
    6,089
    Mentioned
    77 Post(s)
    Quoted
    43 Post(s)

    Default

    You can detect a whirlpool by Counting the light colors in the water, if there're more than a certain amount: you got a whirlpool.. And you can do the same with the shark, but then with dark colors.
    Hup Holland Hup!

  3. #3
    Join Date
    Aug 2007
    Posts
    1,404
    Mentioned
    1 Post(s)
    Quoted
    0 Post(s)

    Default

    I've never tried that before... Could you make an example?

    Or just answer me if this is correct:
    SCAR Code:
    Function GotWhirlpool;
    var a,b: Integer;
    begin
      if(CountColor(SomeLightColor,Cx1,Cy1,Cx2,Cy2) >= SomeNumber)then
      begin
       Result:= True;
      end;
    end;

    procedure HandleWhirlpool;
    begin
      If(GotWhirlPool)then
      begin
        //Do Some stuff
      end;
    end;

    EDIT: Wouldn't it be better to use CountColorTolerance? Because the whirlpool is, after all, not only 1 color.


    -Knives


    PS: Thanks for the idea. I'll try and do some tests.

  4. #4
    Join Date
    Jun 2007
    Posts
    140
    Mentioned
    0 Post(s)
    Quoted
    0 Post(s)

    Default

    you can use dtms for the sharks, and perhaps for the Whirlpool

  5. #5
    Join Date
    Jun 2007
    Location
    Minnesota
    Posts
    773
    Mentioned
    0 Post(s)
    Quoted
    0 Post(s)

    Default

    Quote Originally Posted by ckeboss View Post
    you can use dtms for the sharks, and perhaps for the Whirlpool
    No you can't don't try.

  6. #6
    Join Date
    Aug 2007
    Posts
    1,404
    Mentioned
    1 Post(s)
    Quoted
    0 Post(s)

    Default

    Too late :P I have tried making a DTM. The script found nothing. So I'm going for Nielsie's idea, which I have already developed a few functions from.

    Here's what I've got so far.
    SCAR Code:
    Function AreaSize(x1,y1,x2,y2: Integer): Integer;
    Var Width, Height: Integer;
    begin
      Width:= Max(X1,X2) - Min(X1,X2);
      Height:= Max(Y1,Y2) - Min(Y1,Y2);
      Result:= Width * Height;
      Writeln(IntToStr(Result))
    end;

    Function FillsMoreThanHalf(Color,x1,y1,x2,y2,Tol: Integer): Boolean;
    begin
      If(CountColorTolerance(Color,x1,y1,x2,y2,Tol) > AreaSize(x1,y1,x2,y2)/2)then
      begin
        Result:= True;
      end;
    end;
    The first function gets how many pixels, cover the area between inserted 2 set of coordinates..

    The seconds returns true, if Color with added Tolerance fills more than a half of the specified
    box (2 set of coords).

    Do you think that would work, if I adjusted them some more?

    -Knives

  7. #7
    Join Date
    Oct 2006
    Location
    finland, helsinki
    Posts
    2,501
    Mentioned
    3 Post(s)
    Quoted
    2 Post(s)

    Default

    Use:
    SCAR Code:
    FindColorsSpiralTolerance(x, y, whirlpool, WHIRLPOOLCOLOR, x-20, y-20, x+20, y+20, 20);
    If(GetArrayLength(WhirlPool)>15)Then
      result:= True;

    Something like that.

    Code:
    • Narcle: I recall Jukka releasing a bunch of scripts like this before... Its how he rolls I think. rofl
    • Solarwind: Dude, you are like... t3h s3x.
    • Hy71194: JuKKa you're a machine! You released 3 scripts in 10 minutes! :O
    • benjaa: woah.... Jukka is the man Guildminer pwns all
    • NaumanAkhlaQ: And JuKKa Is my Her0!

  8. #8
    Join Date
    Aug 2007
    Posts
    1,404
    Mentioned
    1 Post(s)
    Quoted
    0 Post(s)

    Default

    Jukka... I don't really get that function. First you want it to find the whirlpool-color. Then you want to get the arraylength of the color?

    SORRY! My bad. I thought it was FindColorSpiralTolerance. I didn't see the extra "S".
    Now I understand what you want it to do.

    -Knives

  9. #9
    Join Date
    Mar 2007
    Posts
    1,700
    Mentioned
    0 Post(s)
    Quoted
    8 Post(s)

    Default

    Array of colors maybe? Or DDTMs or multiple DTMs.

  10. #10
    Join Date
    Feb 2006
    Location
    New Zealand
    Posts
    1,330
    Mentioned
    0 Post(s)
    Quoted
    0 Post(s)

    Default

    King you can also count how close the pixels are to each other. And make sure to be looking directly at the whirlpool and not be counting from the whole screen.

  11. #11
    Join Date
    Apr 2007
    Location
    DUTCHIESLAND
    Posts
    16
    Mentioned
    0 Post(s)
    Quoted
    0 Post(s)

    Default

    Yea i ve heard also something about picking the right colors i believe..

  12. #12
    Join Date
    Nov 2007
    Location
    Nowhereville
    Posts
    1,155
    Mentioned
    0 Post(s)
    Quoted
    3 Post(s)

    Default

    Please don't gravedig.
    Formerly known as Cut em2 it

Thread Information

Users Browsing this Thread

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

Similar Threads

  1. Help with Whirlpool :D
    By Raskolnikov in forum OSR Help
    Replies: 0
    Last Post: 11-25-2007, 11:51 PM
  2. Whirlpool Image :)
    By Drakan in forum OSR Help
    Replies: 5
    Last Post: 06-13-2007, 05:47 PM
  3. Need Whirlpool DTM
    By Drakan in forum OSR Help
    Replies: 9
    Last Post: 06-11-2007, 08:58 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
  •