Results 1 to 8 of 8

Thread: Procedure JMouse(hl,hk : integer ; jl, jk : integer; left:boolean);

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

    Default Procedure JMouse(hl,hk : integer ; jl, jk : integer; left:boolean);

    SCAR Code:
    {*******************************************************************************
    procedure JMouse(hl,hk : integer ; jl, jk : integer; left:boolean);
    By: JuKKa
    Description: Moves the mouse a little randomly. should be pretty undetectable
    *******************************************************************************}

    Procedure JMouse(hl,hk : integer ; jl, jk : integer; left:boolean);
    var
       KK,KL : Integer;
       GK,Gl : Integer;
    begin
    getmousepos(kk,kl)
     Case random(2)of
      0 : kk:= kk + 250;
      1 : kk:= kk - 250;
     end;
     
      Case random(2)of
       0: kl:= kl + 250;
       1: kl:= kl - 250;
      end;
     
       case random(2)of
        0: GL:= hl + 150;
        1: GL:= HL - 150;
       end;
     
        Case Random(2)of
         0: GK:= Hk + 150;
         1: Gk:= Hk - 150;
        end;
     
         MouseSpeed:= 5+random(5);
         MMouse(kk,Kl,10,10)
         MouseSpeed:= 15+random(5);
         MMouse(Gl,Gk,Jl,Jk)
         MouseSpeed:= 10+random(5);
         Mouse(Hl,Hk,Jl,Jk,left)
    end;

    u use it like this:

    SCAR Code:
    Begin
       SetupSRL;
       activateclient;
       JMouse(895, 121,5,5,true)
    End.

    and for the lazy ones:

    SCAR Code:
    program mousetest;
    {.include SRL/SRL.scar}

    procedure setup;
    begin
    setupsrl;
    x:= 500;
    y:= 500;
    end;

    Procedure JMouse(hl,hk : integer ; jl, jk : integer; left:boolean);
    var
       KK,KL : Integer;
       GK,Gl : Integer;
    begin
    getmousepos(kk,kl)
     Case random(2)of
      0 : kk:= kk + 250;
      1 : kk:= kk - 250;
     end;
     
      Case random(2)of
       0: kl:= kl + 250;
       1: kl:= kl - 250;
      end;
     
       case random(2)of
        0: GL:= hl + 100;
        1: GL:= HL - 100;
       end;
     
        Case Random(2)of
         0: GK:= Hk + 100;
         1: Gk:= Hk - 100;
        end;
     
         MouseSpeed:= 5+random(5);
         MMouse(kk,Kl,10,10)
         MouseSpeed:= 15+random(5);
         MMouse(Gl,Gk,Jl,Jk)
         MouseSpeed:= 10+random(5);
         Mouse(Hl,Hk,Jl,Jk,left)
    end;

    begin
       Setup;
       activateclient;
       JMouse(X, Y,5,5,true)
    end.

    open up a BIG window in paint, if u wonder how it will move.

    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!

  2. #2
    Join Date
    Aug 2006
    Location
    London
    Posts
    2,021
    Mentioned
    2 Post(s)
    Quoted
    0 Post(s)

    Default



    modern art

    i think its a good idea, but its too regular, perhaps you should add more of those case random statments
    Join the Official SRL IRC channel. Learn how to Here.

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

    Default

    looks good lol .. yeah i might add when i come back from church..

    edit:/ while in church i got a idea... show u later
    k.. im so brain washed... is there a way to make it choose a value from 0-250?

    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!

  4. #4
    Join Date
    Nov 2006
    Posts
    56
    Mentioned
    0 Post(s)
    Quoted
    0 Post(s)

    Default

    Yes:

    SCAR Code:
    Begin Case Random(2)
    0: X :=0+Random(250)
    1: X :=250-Random(250)
    end;

    Something like that

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

    Default

    k thx ill credit j00 :P

    SCAR Code:
    {*******************************************************************************
    procedure JMouse(hl , hk, jl , jk : integer; left:boolean);
    By: JuKKa, Small credit to: Akriam
    Description: Random mouse movement.
    Example: Jmouse(500,500,5,5,true)
    *******************************************************************************}

    procedure JMouse(hl , hk, jl , jk : integer; left:boolean);
    var
       KK,KL : Integer;
       GK,Gl : Integer;
    begin
      Case random(2)of
      0: kk:= Hk + Random(250);
      1: kk:= Hk - Random(250);
     end;
      Case random(2)of
      0: kl:= Hl + Random(250);
      1: kl:= Hl - Random(250);
      end;
       case random(2)of
      0: GL:= Hk + Random(250);
      1: GL:= Hk - Random(250);
       end;
        Case Random(2)of
      0: Gk:= Hl + Random(250);
      1: Gk:= Hl - Random(250);
        end;
        mousespeed:=15;
        MMouse(hl,hk,kk,kl);
        writeln('33,3%')
        MMouse(hl,hk,gk,gl);
        writeln('66,6%')
        Mouse(Hl,Hk,Jl,Jk,left)
        writeln('99,9%')
        writeln('100% Succsessfuly Moved Mouse.')
    end;

    had a few problems with it but should work fine now.

    developers feel free to add this into --> SRL/SRL/Core/MouseFlag.Scar. i would feel honoured! ^_^

    -Known bugs if it moves over the "screen" it kinds of tilt's and moves up and down fast.
    -Need fix omg :O

    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!

  6. #6
    Join Date
    Nov 2006
    Posts
    56
    Mentioned
    0 Post(s)
    Quoted
    0 Post(s)

    Default

    You should add an option at the end that would make it move the mouse in a random pattern like a parabula:

    SCAR Code:
    var KK,KL ,GK,GL
     begin
      getmouspos(X,Y)
      GK :=X*2
      GL :=Y
    end;

    That is a simple curve

  7. #7
    Join Date
    Feb 2006
    Location
    Pennsylvania
    Posts
    1,524
    Mentioned
    2 Post(s)
    Quoted
    1 Post(s)

    Default

    Quote Originally Posted by Akriam View Post
    You should add an option at the end that would make it move the mouse in a random pattern like a parabula:

    SCAR Code:
    var KK,KL ,GK,GL
     begin
      getmouspos(X,Y)
      GK :=X*2
      GL :=Y
    end;

    That is a simple curve
    If you want a parabola then just use even powers:

    pow(X,2)


  8. #8
    Join Date
    Nov 2006
    Posts
    56
    Mentioned
    0 Post(s)
    Quoted
    0 Post(s)

    Default

    I didn't even know you could do a power function...erm...actually I did I just couldn't remember it. I just used 2 to demonstrate x to the power of 2 or whatever Thanks Bebe.

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
  •