Results 1 to 5 of 5

Thread: Run South?

  1. #1
    Join Date
    Jul 2007
    Location
    Pluto... Maybe?
    Posts
    198
    Mentioned
    0 Post(s)
    Quoted
    0 Post(s)

    Default Run South?

    Hi ok im making a script and at one point i need it to find a symbol but sometimes that symbol is slightly south of the screen and i was wondering how i could make it so that if it didnt find the symbol it would run south and try to find the symbol again.

    Here is the part of the script that i need it on:

    Code:
    procedure FishingSpot;
     begin
       if not loggedin then Exit;
       If(FindSymbol(x,y, 'Fishing Spot')) then
        Wait(200+random(90));
        SetRun(true);
       Mouse(x,y,5,5,true);
       FFlag(2);
     End;
    iv been trying to do this for ages now and i just couldnt do it on my own.

    All help is greatly appreciated!

  2. #2
    Join Date
    Nov 2007
    Location
    Chile
    Posts
    1,901
    Mentioned
    0 Post(s)
    Quoted
    0 Post(s)

    Default

    scar Code:
    Function BlindPoint(D, R : Integer): TPoint;
    Var
      D2 : Integer;
    Begin
      D2 := D - Round(rs_GetCompassAngleDegrees);
      Result.X := MMCX + Round(R * Cos(Radians(D2 - 90)));
      Result.Y := MMCY + Round(R * Sin(Radians(D2 - 90)));
    End;

    procedure FishingSpot;
    var
      tries, x, y : integer;
      TP : TPoint;
    label
      NotFound;
    begin
     if not loggedin then Exit;
     NotFound:
     If Tries > 4 Then
       Exit;
     If(FindSymbol(x,y, 'Fishing Spot')) then
     begin
       Wait(200+random(90));
       SetRun(true);
       Mouse(x,y,5,5,true);
       FFlag(2);
       Exit;
     end else
     begin
       TP := BlindPoint(180, 10);
       MouseFlag(Tp.X, TP.Y, 2, 2, 0);
       Inc(Tries);
       GoTo NotFound;
     end;
    End;
    That should walk to south(even if the compass is rotated) until it finds the fishing spot or it walked more than 4 times.
    Last edited by Cazax; 03-26-2009 at 01:34 AM.


  3. #3
    Join Date
    Jul 2007
    Location
    Pluto... Maybe?
    Posts
    198
    Mentioned
    0 Post(s)
    Quoted
    0 Post(s)

    Default

    Thanks it worked perfectly! but what would i change if i wanted to make it run in a different direction?

  4. #4
    Join Date
    Nov 2007
    Location
    Chile
    Posts
    1,901
    Mentioned
    0 Post(s)
    Quoted
    0 Post(s)

    Default

    scar Code:
    BlindPoint(180, 10);
    The 180 is the minimap degrees to walk on, so 0 is north, 90 is east, 180 is south, 270 is west
    Last edited by Cazax; 03-26-2009 at 02:05 AM.


  5. #5
    Join Date
    Jul 2007
    Location
    Pluto... Maybe?
    Posts
    198
    Mentioned
    0 Post(s)
    Quoted
    0 Post(s)

    Default

    Thanks alot u have helped me massively

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
  •