Jump to content
opiumhautopium1

getclolor

Recommended Posts

i got a problem with getcolor it return -1 ?!?

var count,col: integer;
begin
 writeln('kontrollpunkt SETANGCORDI')
 If  ANGCordi=true then
   begin
     inc(count);
     writeln('ANGcordi counter'+inttostr(count));
     wait (2000);
     Movemouse(ANGx,ANGy);
     wait (2000);
     col := GetColor(ANGx, ANGy);
     WriteLn('Color at (' + IntToStr(ANGx) + ', ' + IntToStr(ANGy) + ') is ' + IntToStr(col));
     terminatescript;
   end;
end;

output is

kontrollpunkt SETANGCORDI
ANGcordi counter1
Color at (122, 170) is -1
Stopped execution (71698 ms)

but it is not the color

Color Picked: 1320497 at (122, 170)

 

 

is it a bug or did i something wrong?

please help me :-)

mfg

Link to comment
Share on other sites

hmmm

it work with

begin
 SetDesktopAsClient;
 Wait(500);
 ActivateClient;
 SetOnTop(GetClientWindowHandle, true);
 GetClientDimensions(resolution_x, resolution_y);

but why my code dont work??

begin
if FindWindowTitlePart('seafight.com', true) then
   WriteLn('seafight.com Seite gefunden')
   else
   begin
     WriteLn('Online Spiele Seite NICHT gefunden');
     Terminatescript;
   end;
   Wait(500);
   ActivateClient;
   SetOnTop(GetClientWindowHandle, true);
   GetClientDimensions(resolution_x, resolution_y);
OUTPUT:
Successfully compiled (125 ms)
seafight.com Seite gefunden
Seafightseite: 1775x 1556
MMmap found at 1324 / 619
...
...

the coordinate is inside the seafight page the mouse move on the right point(ANGx,ANGy)

 

but if i setdesktopasclient my script do some things outside the seafightpage......... bad

sorry that i waste your time

and thanks for answer me

Edited by opiumhautopium1
Link to comment
Share on other sites

if there is no way to get the color

i have to switch

like

procedure 1;
begin
 SetDesktopAsClient;
 Wait(500);
 ActivateClient;
 SetOnTop(GetClientWindowHandle, true);
 GetClientDimensions(resolution_x, resolution_y);
end;

procedure 2;
begin
 if FindWindowTitlePart('seafight.com', true) then
 WriteLn('seafight.com Seite gefunden')
 else
 begin
   WriteLn('Online Spiele Seite NICHT gefunden');
   SetDesktopAsClient;
  end;
 Wait(500);
 ActivateClient;
 SetOnTop(GetClientWindowHandle, true);
 GetClientDimensions(resolution_x, resolution_y);
end;

but this dont look ~good~

if somebody have a smarter way please post it :-)

mfg

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...