Cheat Engine Forum Index Cheat Engine
The Official Site of Cheat Engine
 
 FAQFAQ   SearchSearch   MemberlistMemberlist   UsergroupsUsergroups   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 


[Delphi]Help - Drawing/Redrawing on Flash? + More

 
Post new topic   Reply to topic    Cheat Engine Forum Index -> General programming
View previous topic :: View next topic  
Author Message
MiLkz
Newbie cheater
Reputation: 0

Joined: 22 Feb 2009
Posts: 20

PostPosted: Mon Mar 16, 2009 8:45 pm    Post subject: [Delphi]Help - Drawing/Redrawing on Flash? + More Reply with quote

i made a silent mouse using Send/Post Message and i would like to show the mouse's trail but the problem is drawing on the flash game causes it to draw many red lines Very Happy, i need a way to refresh the flash game at the pixels that were drawn

i tried RedrawWindow/UpdateWindow

Code:
for x := -2 to 2 do
   for y := -2 to 2 do
     SetPixel(SilentDC, Sx + X, Sy + Y, 255);


a simple draw function..then i need it to redraw

ALSO could someone smart look over this function?
Code:
procedure HumanMouse(xs, ys, xe, ye, gravity, wind, minWait, maxWait, maxStep, targetArea: extended);
var
  veloX, veloY, windX, windY, veloMag, dist, randomDist, lastDist, step: extended;
  lastX, lastY: integer;
  sqrt2, sqrt3, sqrt5: extended;
begin
try
  sqrt2:= sqrt(2);
  sqrt3:= sqrt(3);
  sqrt5:= sqrt(5);
  while hypot(xs - xe, ys - ye) > 1 do
  begin
    dist:= hypot(xs - xe, ys - ye);
    wind:= minE(wind, dist);
    if (dist >= targetArea) then
    begin
      windX:= windX / sqrt3 + (random(round(wind) * 2 + 1) - wind) / sqrt5;
      windY:= windY / sqrt3 + (random(round(wind) * 2 + 1) - wind) / sqrt5;
    end else
    begin
      windX:= windX / sqrt2;
      windY:= windY / sqrt2;
      if (maxStep < 3) then
      begin
        maxStep:= random(3) + 3.0;
      end else
      begin
        maxStep:= maxStep / sqrt5;
      end;
    end;
    veloX:= veloX + windX;
    veloY:= veloY + windY;
    veloX:= veloX + gravity * (xe - xs) / dist;
    veloY:= veloY + gravity * (ye - ys) / dist;
    if hypot(veloX, veloY) > maxStep then
    begin
      randomDist:= (maxStep / 2.0) + (random(round(maxStep / 2));
      veloMag:= sqrt(veloX * veloX + veloY * veloY);
      veloX:= (veloX / veloMag) * randomDist;
      veloY:= (veloY / veloMag) * randomDist;
    end;
    lastX:= Round(xs);
    lastY:= Round(ys);
    xs:= xs + veloX;
    ys:= ys + veloY;
    if (lastX <> Round(xs)) or (lastY <> Round(ys)) then
      SendMouseMoveSilent(Round(xs), Round(ys));
    step:= hypot(xs - lastX, ys - lastY);
    sleep(round((maxWait - minWait) * (step / maxStep) + minWait));
    lastdist:= dist;
  end;
  if (Round(xe) <> Round(xs)) or (Round(ye) <> Round(ys)) then
    SendMouseMoveSilent(Round(xs), Round(ys));
  finally
  end;
end;

procedure SilentMoveMouse(x, y, rx, ry: integer);
var
  cpos: tpoint;
  randSpeed: extended;
begin
try
  randSpeed:= (random(10) / 2.0 + 10) / 10.0;
  if randSpeed = 0.0 then
    randSpeed := 0.1;
  getCursorPos(cpos);
  X := x + random(rx);
  Y := y + random(ry);
  HumanMouse(cpos.x,cpos.y,x,y,9.0,3.0,10.0/randSpeed,15.0/randSpeed,10.0*randSpeed,10.0*randSpeed);
  finally
  end;
end;


im getting wierd errors with it, this line randomDist:= (maxStep / 2.0) + (random(round(maxStep / 2));, check over it and make it compile Sad

Please and thank you
Back to top
View user's profile Send private message
Display posts from previous:   
Post new topic   Reply to topic    Cheat Engine Forum Index -> General programming All times are GMT - 6 Hours
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum
You cannot attach files in this forum
You can download files in this forum


Powered by phpBB © 2001, 2005 phpBB Group

CE Wiki   IRC (#CEF)   Twitter
Third party websites