Results 1 to 9 of 9

Thread: random clicking

  1. #1
    Join Date
    Jun 2007
    Posts
    69
    Mentioned
    0 Post(s)
    Quoted
    0 Post(s)

    Default random clicking

    how do you make a mouse click a spot then randomly choose how many times to click there. And how do you make the mouse click in the same spot repeadaly without typing Mouse(x,y,122,121,1,1,). over and over again.

    thanks.

  2. #2
    Join Date
    May 2007
    Location
    baltimore, md
    Posts
    836
    Mentioned
    0 Post(s)
    Quoted
    8 Post(s)

    Default

    SCAR Code:
    i:=0;
    repeat
      Mouse(whatever);
      i:=i+1;
    until(i=random(5));

  3. #3
    Join Date
    Dec 2006
    Location
    .̿̂̔͋͗̎̆ͥ̍̒ͤ͂̾̌̀̅
    Posts
    3,012
    Mentioned
    1 Post(s)
    Quoted
    3 Post(s)

    Default

    jhildy, Isn't there a big possibility that "random(5)" would be for example 0? Or change to lower numbers than i? because then that would be endless...

    SCAR Code:
    program New;
    {Include SRL/SRL.scar}

    var
      Int, RInt: integer; //The variables.

    begin
      RInt := Random(10) + 1;//Random number between 1-10..
      Int := 0;// Sets Int to 0.
      while not (Int = RInt) do //while the integers aren't equal do..
      begin
        Mouse(StuffHere);//Add coordinates etc. here.
        Int := Int + 1;//Add one to Int
      end;
    end.

  4. #4
    Join Date
    Jan 2007
    Location
    Not here
    Posts
    1,604
    Mentioned
    2 Post(s)
    Quoted
    19 Post(s)

    Default

    O.o I always thought if u did random it would only do randomly more than the number not randomly less....example
    5+random(5) I thought that would only randomly choose out of
    5,6,7,8,9,10 not 1,2,3,4 as well
    Sleeping...

  5. #5
    Join Date
    Dec 2006
    Location
    .̿̂̔͋͗̎̆ͥ̍̒ͤ͂̾̌̀̅
    Posts
    3,012
    Mentioned
    1 Post(s)
    Quoted
    3 Post(s)

    Default

    eh.. i = random(5).. I think that means that i has to be equal to random(5) so the loop will end.. So..

    random(5) = 0,1,2,3,4.. Chooses random number between that and if they happend to be lower and i goes above 4 it will be endless..

    "5+random(5) I thought that would only randomly choose out of
    5,6,7,8,9,10 not 1,2,3,4 as well"

    What..? If you mean this part

    RInt := Random(10) + 1;//Random number between 1-10..

    It picks a number between 0-9 and adds 1 to it..

    I even tested what jhildy posted there.. 1 out of 3 tries resulted a endless loop

  6. #6
    Join Date
    May 2007
    Location
    baltimore, md
    Posts
    836
    Mentioned
    0 Post(s)
    Quoted
    8 Post(s)

    Default

    whoops my bad but i had the right idea.

  7. #7
    Join Date
    Jun 2007
    Posts
    69
    Mentioned
    0 Post(s)
    Quoted
    0 Post(s)

    Default

    k thanks i think i underrstand now.

  8. #8
    Join Date
    Jan 2007
    Location
    Not here
    Posts
    1,604
    Mentioned
    2 Post(s)
    Quoted
    19 Post(s)

    Default

    errr woops I read ur post wrong GoF, my bad
    Sleeping...

  9. #9
    Join Date
    Jun 2006
    Posts
    1,492
    Mentioned
    0 Post(s)
    Quoted
    0 Post(s)

    Default

    Quote Originally Posted by jhildy View Post
    SCAR Code:
    i:=0;
    repeat
      Mouse(whatever);
      i:=i+1;
    until(i=random(5));
    That could go on forever. The Random(5) will change every loop. You have to set i to a random number before the loop.

    SCAR Code:
    i := 1 + Random(5); //Will not get zero, will get 1 - 5
    repeat
      Mouse(x,y,blah,blah,true);
      a := a + 1;
    until(a >= i)

Thread Information

Users Browsing this Thread

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

Similar Threads

  1. Help with clicking?
    By Kyle Undefined in forum OSR Help
    Replies: 20
    Last Post: 11-12-2008, 07:17 AM
  2. clicking on an npc
    By patman16 in forum OSR Help
    Replies: 3
    Last Post: 07-29-2008, 03:19 PM
  3. Random clicking problem
    By tenfold in forum OSR Help
    Replies: 5
    Last Post: 06-04-2008, 11:06 AM
  4. clicking
    By Splicer16 in forum OSR Help
    Replies: 13
    Last Post: 05-04-2008, 08:41 AM
  5. Clicking..
    By Rambozin in forum OSR Help
    Replies: 20
    Last Post: 05-09-2007, 01:33 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
  •