Jump to content
Net4Hack

Color Help

Recommended Posts

Picture please. There are too many variations such as:

- Is the green all in one spot? Or groups of green and we need to find largest?

- Does the color vary or is always exactly the same color each time?

- Same questions for yellow.

 

And so on. If you are going to ask for help at least give us something to go on.

Link to comment
Share on other sites

There are all kinds of ways to do this. Here is one. You will likely need to adjust the colors. I believe SeaFight is notorious for varying colors???

 

I have not tested this, but it should work.

 

const
 YellowDot = 62207;   // Color of yellow dots.
 YellowDotTol = 5;    // Color tolerance for yellow dots.
 GreenDot = 5026082;  // Color of green dots.
 GreenDotTol = 5;     // Color tolerance for green dots.

function FindYellowDotNearestGreen(const SearchArea: TBox; out Position: TPoint): Boolean;
var
 YellowPts: TPointArray;  // Locations of yellow dots.
 GreenPos: TPoint;        // Location of green dot.
begin
 Result := False;
 Position := Point(0, 0);

 // Find yellow dots (if any).
 with SearchArea do
   if not FindColorTolEx(YellowPts, YellowDot, X1, Y1, X2, Y2, YellowDotTol) then
   begin
     Writeln('No yellow dots found.');
     Exit;
   end;
 Writeln('Found ' + IntToStr(Length(YellowPts)) + ' pixels matching yellow.');

 // Find green dot.
 with SearchArea, GreenPos do
   if not FindColorTol(X, Y, GreenDot, X1, Y1, X2, Y2, GreenDotTol) then
   begin
     Writeln('Failed to find green dot.');
     SetLength(YellowPts, 0);
     Exit;
   end;
 Writeln(Format('Found green dot at (%d,%d).', [GreenPos.X, GreenPos.Y]));

 // Sort yellow by distance from green and return nearest point.
 SortTPAEx(YellowPts, GreenPos);
 Position := YellowPts[0];
 SetLength(YellowPts, 0);
 Result := True;
 Writeln(Format('Found yellow dot at (%d,%d).', [Position.X, Position.Y]));
end;

Edited by Bixby Sayz
Link to comment
Share on other sites

const
 YellowColor = 62207;  // Yellow decimal color
 GreenColor = 5026082; // Green decimal color
 X1 = 0;               // Left bounds
 Y1 = 0;               // Top bounds
 X2 = 700;             // Right bounds
 Y2 =  700;            // Bottom bounds
 Tol = 1;             // Color Tolerance for both green and yellow color finding

function YellowPointClosestToGreen(var P: TPoint): Boolean; // P outputted yellow point, Result true if there is one found
var                         
 gTPA, yTPA: TPointArray;  // gTPA list of green points, yTPA list of yellow points
 gH, yH, I, II: Integer;   // gL highest array index of gTPA, yL highest array index of yTPA, I loop 1 index, II loop 2 index
                           // note that arrays go from 0 to length minus 1. 0 length = -1 high. 5 length = 4 high
 D, cD: Extended;          // D distance, cD closest distance
begin                                                     
 Result := False;                                        // Initate Result
 FindColorTolEx(yTPA, YellowColor, X1, Y1, X2, Y2, Tol); // Acquire yTPA 
 FindColorTolEx(gTPA, GreenColor, X1, Y1, X2, Y2, Tol);  // Acquire gTPA 
 yH := High(yTPA);                                       // Acquire yH
 gH := High(gTPA);                                       // Acquire gH
 if ((yH < 0) or (gH < 0)) then                           // If high for either is less than 0 than did not find at least 1
   Exit;                                                 // Leave with Result false
 Result := True;                                         // Result must be true at this point if we're still here
 cD := 9999999;                                          // Initiate cD with an arbitrarily large number (less than MaxInteger 2 Billion)
 for I := 0 to yH do                                     // Loop through yTPA with Loop 1 with I Index
   for II := 0 to gH do                                  // Loop each yTPA[i] through gTPA with Loop 2 with II Index
   begin
     D := Distance(yTPA[i].X, yTPA[i].Y, gTPA[iI].X, gTPA[iI].Y); // Acquire distance between [every] green and yellow point 
     if (D < cD) then                                             // Check to see if it's the shortest one recorded yet 
     begin
       cD := D;                                                   // Since it is record it to cD [closest distance]
       P := yTPA[i];                                              // Update this point
     end;                                                         // by here we should have the smallest cD recorded and Point output as P        
   end;
end;

var
 P: TPoint;                                              // Declare TPoint to be used with funciton

begin
 if (YellowPointClosestToGreen(P)) then                  // Result is True, P recorded
   WriteLn('Found');                                     // ^
 ClickMouse(P.X, P.Y, True);                             // Use P to click. May consider using OSI etc. for more human like antiban.
end.

 

Assuming there is only

 

1 green and multiple yellows

 

or

 

1 yellow and multiple greens

 

Do something as simple as FindColorSpiral http://wiki.scar-divi.com/FindColorSpiral

 

const
 YellowColor = 62207;  // Yellow decimal color
 GreenColor = 5026082; // Green decimal color
 X1 = 0;               // Left bounds
 Y1 = 0;               // Top bounds
 X2 = 700;             // Right bounds
 Y2 =  700;            // Bottom bounds
 Tol = 1;             // Color Tolerance for both green and yellow color finding

var
 P: TPoint;

begin
 if (FindColorTol(P.X, P.Y, GreenColor, X1, Y1, X2, Y2, Tol)) then
   FindColorSpiral(P.X, P.Y, P.X, P.Y, YellowColor, X1, Y1, X2, Y2);
     ClickMouse(P.X, P.Y, True);
end.

Edited by Wanted
Link to comment
Share on other sites

オンライン カジノは、プレイヤーが自宅にいながらにしてポーカー、ルーレット、ブラックジャック、スロットなどのギャンブル ゲームを楽しむ機会を提供する仮想プラットフォームです。 オンラインカジノは、アクセスのしやすさ、ゲームの種類の多さ、そして大金を獲得する機会があるため、年々人気が高まっています。

オンラインカジノの主な利点は、利便性とアクセスしやすさです。 プレイヤーは、通常のカジノの営業時間に制限されず、いつでもゲームを楽しむことができます。 必要なのは、インターネットにアクセスできるデバイスと、カジノのウェブサイトにアクセスできることだけです。 これにより、プレイヤーは従来のカジノによくありがちなストレスや緊張を感じることなく、快適な環境でプレイすることができます。

オンラインカジノのもう1つの利点は、ゲームの選択肢が豊富なことです。 ユーザーは、それぞれ独自のルールと勝利の機会を提供する何百もの異なるゲームから選択できます。 技術革新のおかげで、オンライン ゲームのグラフィックとサウンドは高品質になり、プレイヤーは興奮と情熱の雰囲気に浸ることができます。

さまざまなゲームに加えて、オンライン カジノはプレーヤーにさまざまなボーナスやプロモーションも提供します。 これらは、スロットのフリースピン、プレイのための追加のお金、または貴重な賞品が得られる特別なトーナメントなどです。 このようなボーナスにより、勝利の可能性が高まり、ゲームがさらに楽しくなります。

もちろん、オンラインカジノでのプレイにはリスクがあります。 ギャンブルには依存性がある可能性があるため、自分の感情を監視し、支出をコントロールすることが重要であることを覚えておくことが重要です。 カジノはまた、責任あるゲーミングをサポートし、自己排除や賭け金制限の機会を提供します pornhub down

全体として、オンライン カジノはギャンブル愛好家にとって便利でエキサイティングなエンターテイメントを提供します。 幅広いゲーム、ボーナスの選択肢があり、いつでもプレイできるため、世界中のプレイヤーの間で人気が高まっています。 ただし、責任あるゲームと、ゲームが単なる楽しみと娯楽の源であるように自分の行動を制御する能力について覚えておくことが重要です。
Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.



×
  • Create New...