Results 1 to 5 of 5

Thread: Random mouse procedure

  1. #1
    Join Date
    Aug 2007
    Location
    Australia
    Posts
    133
    Mentioned
    0 Post(s)
    Quoted
    0 Post(s)

    Default Random mouse procedure

    Hi, i'm adding an AutoFighter feature to my script, and I need a way to find goblins. Here's the procedure for finding the monster and killing it:
    SCAR Code:
    Procedure FindMonster;
    Begin
     SendArrowWait(0,1000+random(500));
     Repeat
     RandomMovement;
     Until IsUpText('Goblin');
    End;

    Procedure Fight;
    Begin
     i:= 0;
     Repeat
     i:= i + 1;
     GetMousePos(x,y);
     Mouse(x,y,0,0,false)
     ChooseOptionEx('Attack');
     FindMonster;
     Until (i >=(HowManyAttack));
    End;

    With procedure FindMonster, I need a way for the mouse to move around in a way were it can detect IsUpText. At the moment it is using RandomMovement, but that usually takes about five to find a goblin, as the mouse sails right over it without giving SCAR a chance to use IsUpText. What I need is a procedure or function that will move the mouse and look for the goblin. I don't want to use FindMonster or KAttackMonster. Help would be appreciated. Cheersh):
    Quote Originally Posted by The Un-Named View Post
    You can do this a few times before mods catch on...

    "oh fuck, I think the icecream truck just knocked a kid over, brb".

  2. #2
    Join Date
    May 2006
    Posts
    1,230
    Mentioned
    0 Post(s)
    Quoted
    0 Post(s)

    Default

    Best way is FindObj, it will move the mouse to the color of the gobin, check for IsUpText, then if its found, returns x, y with the coord of the goblin, else checks the rest of the screen for it. But currentely FindObj won't work until SRL is fixed.


    SCAR Code:
    if FindObj(x, y, 'oblin', GoblinColor, 10) then
      begin
        Mouse(x, y, 0, 0, False)
        ChooseOptionEx('Attack');
      end;

  3. #3
    Join Date
    Aug 2007
    Posts
    8
    Mentioned
    0 Post(s)
    Quoted
    0 Post(s)

    Default

    i have a random movement code, i use it to annoy my sister, funny as hell

    Code:
    program New;
    var
    x,y:integer;
    begin
    repeat
    
    x:=random(1022)+1;
    y:=random(766)+1;
    movemousesmooth(x,y)
    wait (3000)
    
    until(false)
    end.
    just replace the # after random with the range you want it to randomly move in, the way i have it set is so it uses my whole screen

    ummm what you want is to randomly click on the goblin in random spots, no?
    just add 1, 2, or 3

    like

    add:= random(3) + 1
    x:= x + add

  4. #4
    Join Date
    Apr 2007
    Location
    Michigan -.-
    Posts
    1,357
    Mentioned
    2 Post(s)
    Quoted
    4 Post(s)

    Default

    also you could use:

    SCAR Code:
    procedure FindGoblin;
    var i, z: Integer;
    begin
    repeat
      for i:= 0 to 10 do
      begin  
        if(FindColorSpiralTolerance(x,y,GoblinColor,MSX1,MSY1,MSX2,MSY2,i)then
        begin
          MMouse(x,y,3,3);
          if(IsUpText('oblin'))then
            Mouse(x,y,3,3,True);
            z:= z + 1;
        end;
       end;
      until(z >= HowManyAttack);
    end;
    METAL HEAD FOR LIFE!!!

  5. #5
    Join Date
    Aug 2007
    Location
    Australia
    Posts
    133
    Mentioned
    0 Post(s)
    Quoted
    0 Post(s)

    Default

    Sweet, thanks guys.
    Quote Originally Posted by The Un-Named View Post
    You can do this a few times before mods catch on...

    "oh fuck, I think the icecream truck just knocked a kid over, brb".

Thread Information

Users Browsing this Thread

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

Similar Threads

  1. Move the mouse random
    By marre in forum OSR Help
    Replies: 5
    Last Post: 10-21-2007, 02:23 PM
  2. procedure Mouse not working?
    By alartt in forum OSR Help
    Replies: 4
    Last Post: 09-30-2007, 01:07 PM
  3. Procedure that calls random procedure?
    By Secet in forum OSR Help
    Replies: 2
    Last Post: 03-03-2007, 03:56 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
  •