Results 1 to 14 of 14

Thread: Gravity: Extended? Help Please.

  1. #1
    Join Date
    Nov 2007
    Posts
    437
    Mentioned
    0 Post(s)
    Quoted
    0 Post(s)

    Default Gravity: Extended? Help Please.

    I was making my first script and I wanted to use the procedure IdleTime from the core include Mouse. The third parameter is Gravity: Extended. I know what an extended variable is I just don't know what the variable means in this case. Hope you guys can help

    Here is the procedure IdleTime.

    SCAR Code:
    {*******************************************************************************
    procedure IdleTime(Time, Rand: integer; Gravity: extended);
    By: BenLand100
    Description: Randomly moves the mouse (Rand, and Gravity) for Time milliseconds
    *******************************************************************************}


    procedure IdleTime(Time, Rand: Integer; Gravity: Extended);
    var
      H, W, Cx, Cy, i, n, St: Integer;
      Controls, Path: TPointArray;
      LastC, LastP: TPoint;
    begin
      St := GetSystemTime;
      GetClientDimensions(W, H);
      SetArrayLength(Controls, 4);
      GetMousePos(Cx, Cy);
      LastP.x := Cx;
      LastP.y := Cy;
      LastC.x := LastP.x + (Random(Rand * 2) - Rand)
        LastC.y := LastP.y + (Random(Rand * 2) - Rand)
        repeat
        Controls[0].x := LastP.x;
        Controls[0].y := LastP.y;
        Controls[1].x := LastP.x + -(LastC.x - LastP.x);
        Controls[1].y := LastP.y + -(LastC.y - lastP.y);
        Controls[2].x := Controls[1].x + (Random(Rand * 2) - Rand);
        Controls[2].y := Controls[1].y + (Random(Rand * 2) - Rand);
        Controls[3].x := Controls[2].x + (Random(Rand * 2) - Rand);
        Controls[3].x := Controls[3].x + Round(-(Controls[3].x - (W / 2)) *
          (Gravity));
        Controls[3].y := Controls[2].y + (Random(Rand * 2) - Rand);
        Controls[3].y := Controls[3].y + Round(-(Controls[3].y - (H / 2)) *
          (Gravity));
        LastC.x := Controls[2].x;
        LastC.y := Controls[2].y;
        LastP.x := Controls[3].x;
        LastP.y := Controls[3].y;
        Path := MakeSplinePath(Controls, 0.01);
        Path := MidPoints(Path, 5);
        n := GetArrayLength(Path);
        for i := 0 to n - 1 do
        begin
          MoveMouse(Path[i].x, Path[i].y);
          Wait(Random(2) + 2);
          if (GetSystemTime - St >= Time) then Break
        end;
      until (GetSystemTime - St >= Time)
    end;

    Here is my Script (If anyone wants to give me tips lol I know its bad).

    SCAR Code:
    {
    [=========================================================================]
    [                           AutoTyper 1.0                                 ]
    [=========================================================================]
    [                                                                         ]
    [           NAME        : AutoTyper 1.0                                   ]
    [           WRITER      : Dusk412                                         ]
    [           CATEGORY    : Auto Typer                                      ]
    [           DESCRIPTION : Types Messages Automatically                    ]
    [           CONTACT     : [email]dusk412@hotmail.com[/email]                             ]
    [           CREDITS     : Dusk412 - Creator                               ]
    [                                                                         ]
    [=========================================================================]
    [                                 Notes                                   ]
    [=========================================================================]
    [                                                                         ]
    [ My First Script ^_^                                                     ]
    [ Please Copy and Paste the Progress Report onto my thread                ]
    [ I haven't the automated way to do progress reports yet sorry            ]
    [                                                                         ]
    [=========================================================================]
    [                              Instructions                               ]
    [=========================================================================]
    [                                                                         ]
    [ 1. Enter the text you want it to say                                    ]
    [ 3. Drag the crosshairs to the runescape screen                          ]
    [ 4. Run the script                                                       ]
    [                                                                         ]
    [=========================================================================]
    [                            Words of Wisdom                              ]
    [=========================================================================]
    [                                                                         ]
    [ - KNOWLEDGE is knowing a tomato is a fruit; not putting it into your    ]
    [ fruit salad is WISDOM                                                   ]
    [ - A ship in the harbor is safe, but that's not what ships are built for.]
    [ - A peacock who sits on his tail is just another turkey.                ]
    [ - If you are willing to admit faults, you have one less fault to admit. ]
    [                                                                         ]
    [=========================================================================] }

    program AutoTyper;
    {.include SRL/SRL.scar}

    const                // *** FILL OUT THESE *** //
      Name='Dusk412';    // Please Enter Your Name Here (For Progress Report)
      Waittime=1000;     // How Long Between Each Message
      Message1='Merry Christmas!';   // What the Message Says
      NumSaid=5;         // How Many Times The Message Will Be Said (Leave as 0 for infinity)

    var
      i : Integer;
      //  BoredMouse : Integer;
      BoredTime : Integer;

    procedure ProgressReport;
      begin
        writeln('----------------------------------------')
        writeln('SRL-Forums Username: ' +Name)
        writeln('Message Sent ' +IntToStr(i) +' Times')
        writeln('----------------------------------------')
      end;

    {procedure Bored;
      begin
        BoredMouse:=random(1)
        BoredTime:=2500+random(350)
        if(BoredMouse=1) then
          begin
            //IdleTime(BoredTime,150,)
          end;
      end;}


    procedure TypeMessage;
      begin
        TypeSend(Message1)
        i:=i+1
      end;

    begin
      setupSRL
      ClearDebug
      activateclient;
      writeln('Hello, Welcome to AutoTyper 1.0')
      i:=0
      BoredTime:=0
      repeat
        TypeMessage
        Wait(1000)
        //Bored
      until(i>=NumSaid)
      ProgressReport
    end.

  2. #2
    Join Date
    Aug 2007
    Posts
    429
    Mentioned
    0 Post(s)
    Quoted
    2 Post(s)

    Default

    Extended is like a decimal number..

    EX.
    0.0
    1.2
    3.6
    etc.

  3. #3
    Join Date
    Nov 2007
    Posts
    437
    Mentioned
    0 Post(s)
    Quoted
    0 Post(s)

    Default

    Quote Originally Posted by Derek- View Post
    Extended is like a decimal number..

    EX.
    0.0
    1.2
    3.6
    etc.
    I know what an extended variable is I just don't know what the variable means in this case.
    I know what extended means. I don't know what the procedure is asking for in this case or what number I should put there. If I put in 2.5 what does 2.5 mean. Does it wait for 2.5 seconds or add a random(2.5) milliseconds or what?

  4. #4
    Join Date
    Nov 2007
    Posts
    437
    Mentioned
    0 Post(s)
    Quoted
    0 Post(s)

    Default

    I updated my script because I have been changing it so I want you all to see the most up to date version. Just concentrate on the IdleTime thing thought please I really need to solve that.
    Also if I say Number:= 1000+random(500) does that mean I am adding a random number between 1-500 or between 0-500 or betwenn 0-499?

  5. #5
    Join Date
    Jul 2007
    Location
    St. Louis, Missouri, USA.
    Posts
    575
    Mentioned
    0 Post(s)
    Quoted
    0 Post(s)

    Default

    Quote Originally Posted by Dusk412 View Post
    I updated my script because I have been changing it so I want you all to see the most up to date version. Just concentrate on the IdleTime thing thought please I really need to solve that.
    Also if I say Number:= 1000+random(500) does that mean I am adding a random number between 1-500 or between 0-500 or betwenn 0-499?
    With what you just said, Number can be a value between 1000 and 1499. You can also you the function RandomRange(start#,end#) and do Number := RandomRange(1000,1500);

    Also, please don't double post.
    -You can call me Mick-



  6. #6
    Join Date
    Nov 2007
    Posts
    437
    Mentioned
    0 Post(s)
    Quoted
    0 Post(s)

    Default

    Thank you mickalicious you answered that question but does anyone know what the Gravity : Extended variable is used for so that I know what to put in. I'm trying to use it as an Anti-Ban feature lol I don't even know if it will work but hey.

  7. #7
    Join Date
    Aug 2007
    Posts
    429
    Mentioned
    0 Post(s)
    Quoted
    2 Post(s)

    Default

    Oh my bad =]
    guess I can't read

    lol but judging just from the looks of it I think that in this case gravity just means how far you want the mouse to move
    Ex.
    2.5 will move the mouse farther than 1.0

    something along that line

  8. #8
    Join Date
    Nov 2007
    Posts
    437
    Mentioned
    0 Post(s)
    Quoted
    0 Post(s)

    Default

    So Gravity is the distance that the mouse will be moving? Is that is pixels or centimeters or miles or what lol? Ok let me get this straight. First parameter: how long the mouse will move. Second parameter: a random additional time that the mouse will move. Third Parameter: distance that the mouse will move.

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

    Default

    i think it is how much it will float when it moves the mouse.
    Think of waves. When you move the mouse example 2.0 has bigger waves than 1.0. Thats what i think.

    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!

  10. #10
    Join Date
    Nov 2007
    Posts
    437
    Mentioned
    0 Post(s)
    Quoted
    0 Post(s)

    Default

    well I have plugged in some different numbers and It is something to do with distance. I just can't figure out if the numbers correlate to centimeters or what.

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

    Default

    Quote Originally Posted by Dusk412 View Post
    well I have plugged in some different numbers and It is something to do with distance. I just can't figure out if the numbers correlate to centimeters or what.
    Does it really matter? Its just antiban..

    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!

  12. #12
    Join Date
    Nov 2007
    Posts
    437
    Mentioned
    0 Post(s)
    Quoted
    0 Post(s)

    Default

    yes because what real person whips their mouse across the whole screen over and over. come on now. anyways i got it to work so no more posts are necessary

  13. #13
    Join Date
    Feb 2006
    Location
    Berkeley, CA
    Posts
    1,837
    Mentioned
    52 Post(s)
    Quoted
    60 Post(s)

    Default

    They don't correlate to anything, rand defines how large the variance can be, and gravity specifies how much 'pull' the mouse feels towards the center of the screen. A low gravity value will let the mouse wander off, a high gravity value will make the mouse stay near the middle of the screen. Of course, gravity value are relative to the rand value.

  14. #14
    Join Date
    Nov 2007
    Posts
    437
    Mentioned
    0 Post(s)
    Quoted
    0 Post(s)

    Default

    Ah BenLand thank you that actually explains everything in the way i wanted. Thanks. I owe you.
    EDIT: I repped u benland thanx/

Thread Information

Users Browsing this Thread

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

Similar Threads

  1. Gravity script
    By Zyt3x in forum OSR Help
    Replies: 11
    Last Post: 07-16-2008, 10:32 AM
  2. function RoundDec(number: extended; decimals: integer): extended
    By mixster in forum Research & Development Lounge
    Replies: 8
    Last Post: 03-22-2008, 01:09 PM

Posting Permissions

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