Results 1 to 7 of 7

Thread: Paint Mouse On SMART (FLIGHT)

  1. #1
    Join Date
    Feb 2006
    Location
    Tracy/Davis, California
    Posts
    12,631
    Mentioned
    135 Post(s)
    Quoted
    418 Post(s)

    Default Paint Mouse On SMART (FLIGHT)

    How do you paint mouse onto SMART like this:
    (Scroll down on there to see pictures)
    http://villavu.com/forum/showthread.php?t=68701

  2. #2
    Join Date
    Aug 2007
    Location
    Colorado
    Posts
    7,421
    Mentioned
    268 Post(s)
    Quoted
    1442 Post(s)

    Default

    I simply painted a dot on smart for every mouse 'jump' in Benland's WindMouse procedure:
    Simba Code:
    procedure WindMouse2(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
        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) div 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
            MoveMouse(Round(xs), Round(ys));
          step:= hypot(xs - lastX, ys - lastY);
          wait(round((maxWait - minWait) * (step / maxStep) + minWait));
          lastdist:= dist;
          SMART_DrawDotsEx(False, [Point(lastX, lastY)], 65280);  //Here
        end;
        if (Round(xe) <> Round(xs)) or (Round(ye) <> Round(ys)) then
          MoveMouse(Round(xe), Round(ye));

      end;

    Edit:
    I believe there'd be a more appropriate way to do it, but this is how I did it.

    Current projects:
    [ AeroGuardians (GotR minigame), Motherlode Miner, Blast furnace ]

    "I won't fall in your gravity. Open your eyes,
    you're the Earth and I'm the sky..."


  3. #3
    Join Date
    Feb 2006
    Location
    Tracy/Davis, California
    Posts
    12,631
    Mentioned
    135 Post(s)
    Quoted
    418 Post(s)

    Default

    So do you just copy/pate that into top of script, and still use MMouse/Mouse (like this WindMouse overwrites the SRL one?)

    Or do you use the WindMouse2 instead of Mouse/MMouse?

    Why WindMouse2 and not like a Mouse2/MMouse2?

  4. #4
    Join Date
    Aug 2007
    Location
    Colorado
    Posts
    7,421
    Mentioned
    268 Post(s)
    Quoted
    1442 Post(s)

    Default

    Because I used this directly in my HumanMMouse procedure. Like MMouse, it calls on WindMouse directly. So if you wanted, just make your own "MMouse" procedure and use WindMouse2 (or whatever you call the moving + painting procedure).

    Current projects:
    [ AeroGuardians (GotR minigame), Motherlode Miner, Blast furnace ]

    "I won't fall in your gravity. Open your eyes,
    you're the Earth and I'm the sky..."


  5. #5
    Join Date
    Feb 2011
    Location
    The Future.
    Posts
    5,600
    Mentioned
    396 Post(s)
    Quoted
    1598 Post(s)

    Default

    Prob not what you want.. I actually tried to draw thick lines but failed.
    Simba Code:
    MMouse(MCCX, MCCY, 0, 0);   /Just for testing.
      GetMousePos(M.x, M.y);
      P1:= Point(M.x - 5, M.Y - 5);
      P2:= Point(M.X + 5, M.Y + 5);
      Smart_DrawLine(True, P1, P2, CLRed);
      P1:= Point(M.x + 5, M.Y - 5);
      P2:= Point(M.X - 5, M.Y + 5);
      Smart_DrawLine(False, P1, P2, CLRed);
    I am Ggzz..
    Hackintosher

  6. #6
    Join Date
    Aug 2007
    Location
    Colorado
    Posts
    7,421
    Mentioned
    268 Post(s)
    Quoted
    1442 Post(s)

    Default

    Were you wanting dot trails like what I have, YoHoJo, or line trails?

    Current projects:
    [ AeroGuardians (GotR minigame), Motherlode Miner, Blast furnace ]

    "I won't fall in your gravity. Open your eyes,
    you're the Earth and I'm the sky..."


  7. #7
    Join Date
    Dec 2007
    Location
    192.168.1.73
    Posts
    2,439
    Mentioned
    6 Post(s)
    Quoted
    119 Post(s)

    Default

    I know that we can't obviously draw the mouse at every stage as it moves, as PascalScript can't multithread, but would there be a way of getting each of the KeyEvents for mouse moved (ie, for each pixel it moves), and to draw it then? Would be nice to see how human like the mouse is like.

Thread Information

Users Browsing this Thread

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

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •