Results 1 to 3 of 3

Thread: Anglewalk Procedure

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

    Default Anglewalk Procedure

    I'm Writing A Script At The Moment Using Srl 4, and i was typing away, then when i came to compile it said (unknown procedure "anglewalk") Now anglewalk was avaluble in previous versions of srl, but not in srl 4, now i wonderd if anyone has the old procedure still, or could make me a new one, cos i loved the angle walk procedure, thanks all.

  2. #2
    Join Date
    Sep 2006
    Posts
    6,089
    Mentioned
    77 Post(s)
    Quoted
    43 Post(s)

    Default

    SCAR Code:
    procedure AngleWalk(Angle, Distance, Randomx, Randomy: Integer);
    var
      x, y, Degree: Extended;
    begin
      Randomx := Random(Randomx);
      Randomy := Random(Randomy);
      Degree := FixD(Angle - Round(Rs_GetCompassAngleDegrees * 56));
      x := Distance * Cos(Degree * Pi / 180);
      y := Distance * Sin(-Degree * Pi / 180);
      Mouse(Round(x + 648), Round(y + 83), Randomx, Randomy, True);
    end;

    SCAR Code:
    function AWalk2(Angle, Radius, Color, Tol: Integer): Boolean;
    var
      awx, awy, tout, Radius2, x1, y1: Integer;
      CurrentMinimapAngle: Extended;
    begin
      Radius2 := Radius;
      if (Radius = 0) or (Radius2 = 0) or (Radius > 57) or (Radius2 > 57) then
        Radius2 := 57;
      repeat
        if (not LoggedIn) then
          Exit;
        Inc(tout);
        CurrentMinimapAngle := Rs_GetCompassAngleDegrees;
        if (CurrentMinimapAngle < 0) then
        begin
          WriteLn('Minimap not Found!');
          Exit;
        end;
        X1 := Round(Radius2 * Sin((Pi / 180) * (CurrentMinimapAngle + Angle))) + MMCX;
        Y1 := Round(-Radius2 * Cos((Pi / 180) * (CurrentMinimapAngle + Angle))) + MMCY;
        MouseFindNoFlag(x1 - 2, y1 - 2, 4, 4);
        if (not FlagPresent) then
        begin
          WriteLn('AWalk2 could not Click!');
          Exit;
        end;
        FFLag(10);
        awx := MMCX;
        awy := MMCY;
      until (FindColorSpiralTolerance(awx, awy, color, MMX1, MMY1, MMX2, MMY2, Tol)) or
        (Tout > 20);
      Result := True;
    end;

    SCAR Code:
    procedure RotatePoint(var x, y: Integer);
    var
      x1, y1, r, Rad: Integer;
    begin
      Rad := Distance(MMCX, MMCY, x, y);
      for r :=0 to 360 do
      begin
        x1:= Round(Rad * Sin(r * pi / 180)) + MMCX;
        y1:= Round(-Rad * Cos(r * pi / 180)) + MMCY;
        if(Distance(x1,y1,x,y)<=1)then
        begin
          x := Trunc(Rad * Sin((Pi / 180) * (Rs_GetCompassAngleDegrees + r)) + MMCX);
          y := Trunc(-Rad * Cos((Pi / 180) * (Rs_GetCompassAngleDegrees + r)) + MMCY);
          Exit;
        end
      end
    end;

    procedure RotatePointEx(var x, y: Integer; Angle: Integer);
    var
       Rad: Integer;
    begin
      Rad := Distance(MMCX, MMCY, x, y);
      x := Trunc(Rad * Sin((Pi / 180) * (Rs_GetCompassAngleDegrees + Angle)) + MMCX);
      y := Trunc(-Rad * Cos((Pi / 180) * (Rs_GetCompassAngleDegrees + Angle)) + MMCY);
    end;

    SCAR Code:
    function MouseFindFlagAngle(x1, y1: Integer; angle: Integer): Boolean;
    var
      Xmod, Ymod: Integer;
    begin
      Mouse(x1, y1, 2, 2, True);
      Wait(50);
      if (not (FlagPresent)) then
      begin
        angle := angle - Round(Rs_GetCompassAngleDegrees);
        Xmod := Round(2 * Sin(angle * Pi / 180));
        Ymod := Round(-2 * Cos(angle * Pi / 180));
        repeat
          x1 := x1 + Xmod;
          y1 := y1 + Ymod;
          Mouse(x1, y1, 2, 2, True);
          if (FlagPresent) then
          begin
            Result := True;
            Break;
          end;
        until (x1 < 570) or (x1 > 725) or (y1 < 5) or (y1 > 160);
      end;
    end;

    You might need to replace SCAR's Compass Function with SRL's, as the one in SCAR is broken (?).
    Hup Holland Hup!

  3. #3
    Join Date
    Aug 2007
    Location
    England
    Posts
    136
    Mentioned
    0 Post(s)
    Quoted
    0 Post(s)

    Default

    cheers mate i owe you one

Thread Information

Users Browsing this Thread

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

Similar Threads

  1. Procedure Help...
    By impiwimpi in forum OSR Help
    Replies: 16
    Last Post: 01-08-2009, 06:20 PM
  2. Procedure TypeSendRandom & Procedure AutoResponder!
    By Ultra in forum Research & Development Lounge
    Replies: 12
    Last Post: 01-08-2008, 07:04 PM
  3. Replies: 8
    Last Post: 05-24-2007, 11:57 PM
  4. 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
  •