Results 1 to 6 of 6

Thread: srl problem?

  1. #1
    Join Date
    Jul 2008
    Posts
    12
    Mentioned
    0 Post(s)
    Quoted
    0 Post(s)

    Default srl problem?

    I updated my SRL Includes this morning, and now I'm getting this:

    SCAR Code:
    program New;
    {.include srl/srl.scar}
    begin
     Setupsrl;
    end;

    Failed when compiling
    Line 47: [Error] (321:11): Unknown identifier 'CreateTPAFromBMP' in script C:\Program Files\SCAR 3.21\includes\SRL\SRL\Core\Math.scar

    help?

    -- Here is a copy of what the math.scar looks like. The error seems to be in 'CreateTPAFromText':

    SCAR Code:
    //-----------------------------------------------------------------//
    //--               Scar Standard Resource Library                --//
    //--               ยป Math Routines                               --//
    //-----------------------------------------------------------------//
    // * procedure LoadCoSineArrays;                                                                           // * by Mutant Squirrle
    // * function CreateTPAFromText(Txt : String; Chars : Integer) : TPointArray;                              // * by Raymond
    // * function GetSplinePt(Points: TPointArray; Theta: Extended): TPoint;                                   // * by BenLand100
    // * function MakeSplinePath(Points: TPointArray; ThetaInc: Extended): TPointArray;                        // * by BenLand100
    // * function MidPoints(Path: TPointArray; MaxDist: Integer): TPointArray;                                 // * by BenLand100
    // * function InAbstractBox(x1, y1, x2, y2, x3, y3, x4, y4: Integer; x, y: Integer): Boolean;              // * by BenLand100
    // * function inAngle(Origin: TPoint; Angle1, Angle2, Radius1, Radius2: Extended; X, Y: Integer): Boolean; // * by BenLand100
    // * function Sine(degrees: Integer): Extended;                                                            // * by ?
    // * function Cose(degrees: Integer): Extended;                                                            // * by ?
    // * Function MMToMS(MM: TPoint): TPoint;                                                                  // * by N1ke!

    Var
       SineArray, Cosearray: Array[0..360] Of Extended;
       
    {*******************************************************************************
    procedure LoadCoSineArrays;
    By: Mutant Squirrle
    Description: Loads arrays for use with Radial- and LinearWalk.
    *******************************************************************************}


    procedure LoadCoSineArrays;
    var
      i: Integer;
    begin
      for i := 0 to 360 do
      begin
        Sinearray[i] := Sin(i * Pi / 180);
        Cosearray[i] := Cos(i * Pi / 180);
      end;
    end;

    {*******************************************************************************
    Function CreateTPAFromText(Txt : String; Chars : Integer) : TPointArray;
    By: MastaRaymond
    Description: Returns the TPointArray of the inputted Text. Needs Wizzyplugin
    *******************************************************************************}


    Function CreateTPAFromText(Txt : String; Chars : Integer) : TPointArray;
    var
      TempBMP : integer;
    begin;
      TempBMP := CreateBitmapMaskFromText(Txt,Chars);
      Result := CreateTPAFromBMP( GetBitmapDC(TempBMP));
      FreeBitmap(TempBMP);
    end;


    {*******************************************************************************
    function GetSplinePt(Points: TPointArray; Theta: Extended): TPoint;
    By: BenLand100
    Description: Returns the point on a spline, defined by control points Points, at Theta
    *******************************************************************************}


    function GetSplinePt(Points: TPointArray; Theta: Extended): TPoint;
    var
      i, n: Integer;
      XTemp, YTemp: Extended;
    begin
      n := GetArrayLength(Points) - 1;
      for i := 0 to n do
      begin
        XTemp := XTemp + (BinCoe(n, i) * Points[i].x * Pow((1 - Theta), n - i) *
          Pow(Theta, i));
        YTemp := YTemp + (BinCoe(n, i) * Points[i].y * Pow((1 - Theta), n - i) *
          Pow(Theta, i));
      end;
      Result.x := Round(XTemp);
      Result.y := Round(YTemp);
    end;

    {*******************************************************************************
    function MakeSplinePath(Points: TPointArray; ThetaInc: Extended): TPointArray;
    By: BenLand100
    Description: Returns a spline, defined by control points Points, incrementing theta by ThetaInc
    *******************************************************************************}


    function MakeSplinePath(Points: TPointArray; ThetaInc: Extended): TPointArray;
    var
      i: Integer;
      t: Extended;
      temp, last: TPoint;
      done: Boolean;
    begin
      repeat
        if t >= 1 then
        begin
          t := 1;
          done := True;
        end;
        temp := GetSplinePt(Points, t);
        if ((temp.x <> last.x) and (temp.y <> last.y)) then
        begin
          i := i + 1;
          SetArrayLength(Result, i);
          Result[i - 1] := temp;
          last := temp;
        end;
        t := t + ThetaInc;
      until (done)
    end;

    {*******************************************************************************
    function MidPoints(Path: TPointArray; MaxDist: Integer): TPointArray;
    By: BenLand100
    Description: Adds midpoints to Path so no distance on it is greater than MaxDist
    *******************************************************************************}


    function MidPoints(Path: TPointArray; MaxDist: Integer): TPointArray;
    var
      i, c: Integer;
      last: TPoint;
      done: Boolean;
    begin
      if (getarraylength(path) > 0) then
      begin
        repeat
          last := Path[0];
          done := True;
          for i := 1 to GetArrayLength(Path) - 1 do
          begin
            if Sqrt(Pow((Path[i].x - last.x), 2) + Pow((Path[i].y - last.y), 2)) >
              MaxDist then
            begin
              done := False;
              SetArrayLength(Path, GetArrayLength(Path) + 1);
              for c := GetArrayLength(Path) - 1 downto i + 1 do
              begin
                Path[c] := Path[c - 1];
              end;
              Path[i].x := Round((last.x + Path[i + 1].x) / 2);
              Path[i].y := Round((last.y + Path[i + 1].y) / 2);
            end;
            last := Path[i];
          end;
        until (done);
      end;
      Result := Path;
    end;

    {*******************************************************************************
    function InAbstractBox(x1, y1, x2, y2, x3, y3, x4, y4: Integer; x, y: Integer): Boolean;
    By: BenLand100
    Description: Returns true if point x, y is in an abstract box defined by x1, y1, x2, y2, x3, y3, x4, y4
    An abstract box example:

    x1, y1     x2, y2
       +--------+
        \         /
         \       /
          +--+
    x4, y4    x3, y3
    *******************************************************************************}


    function InAbstractBox(x1, y1, x2, y2, x3, y3, x4, y4: Integer; x, y: Integer):
      Boolean;
    var
      U, D, R, L: Boolean;
      UB, DB, LB, RB, UM, DM, LM, RM: Extended;
    begin
      UM := (-y1 - -y2) div (x1 - x2);
      DM := (-y4 - -y3) div (x4 - x3);
      if x1 - x4 <> 0 then
      begin
        LM := (-y1 - -y4) div (x1 - x4);
      end else
      begin
        LM := Pi;
      end;
      if x2 - x3 <> 0 then
      begin
        RM := (-y2 - -y3) div (x2 - x3);
      end else
      begin
        RM := Pi;
      end;
      UB := -(UM * x1) + -y1
        RB := -(RM * x2) + -y2;
      DB := -(DM * x3) + -y3;
      LB := -(LM * x4) + -y4;
      if (UM * x + UB >= -y) then U := True;
      if (DM * x + DB <= -y) then D := True;
      if (RM <> Pi) and (RM >= 0) and (RM * x + RB <= -y) then R := True;
      if (RM <> Pi) and (RM < 0) and (RM * x + RB >= -y) then R := True;
      if (RM = Pi) and (x < x2) then R := True;
      if (LM <> Pi) and (LM >= 0) and (LM * x + LB >= -y) then L := True;
      if (LM <> Pi) and (LM < 0) and (LM * x + LB <= -y) then L := True;
      if (LM = Pi) and (x > x1) then L := True;
      if U and D and L and R then Result := True;
    end;

    {*******************************************************************************
    function inAngle(Origin: TPoint; Angle1, Angle2, Radius1, Radius2: Extended; X, Y: Integer): Boolean;
    By: BenLand100
    Description: Returns True if X and Y fall within Radius1 to Radius2 and Angle1 to Angle2
    Note1: EVERYTHING IS RELATIVE TO ORIGIN!!!
    Note2: This checks in the smallest segment of the circle formed by Angle1 and Angle 2
    Example: (Assume the origin is 0,0)
     inAngle(0, 90, 5, 10, origin, 5, 5) = true;
     inAngle(0, 90, 0, 5, origin, 5, 5) = false;
     inAngle(90, 0, 5, 10, origin, 5, 5) = false;
    *******************************************************************************}


    function inAngle(Origin: TPoint; Angle1, Angle2, Radius1, Radius2: Extended; x,
      y: Integer): Boolean;
    var
      PTemp: PPoint;
      OTemp: TPoint;
      MinAngle, MaxAngle, MinRadius, MaxRadius: Extended;
    begin
      Angle1 := FixD(Angle1);
      Angle2 := FixD(Angle2);
      MinAngle := Angle1;
      if Angle1 > Angle2 then MinAngle := Angle2;
      MaxAngle := Angle1;
      if Angle1 < Angle2 then MaxAngle := Angle2;
      MinRadius := Radius1;
      if Radius1 > Radius2 then MinRadius := Radius2;
      MaxRadius := Radius1;
      if Radius1 < Radius2 then MaxRadius := Radius2;
      OTemp.x := x;
      OTemp.y := y;
      PTemp := ToPolarOffset(OTemp, Origin);
      if (PTemp.R >= MinRadius) and (PTemp.R <= MaxRadius) then
        if (PTemp.T >= MinAngle) and (PTemp.T <= MaxAngle) then
          Result := True;
    end;

    {*******************************************************************************
    function Sine(degrees: Integer): Extended;
    By:
    Description:
    *******************************************************************************}


    function Sine(Degrees: Integer): Extended;
    begin
      Result := sinearray[Trunc(FixD(Degrees))];
    end;

    {*******************************************************************************
    function Cose(degrees: Integer): Extended;
    By:
    Description:
    *******************************************************************************}


    function Cose(Degrees: Integer): Extended;
    begin
      Result := cosearray[Trunc(FixD(Degrees))];
    end;

    {*******************************************************************************
    Function MMToMS(MM: TPoint): TPoint;
    By: N1ke!
    Description: Turns a Minimap point into a close MS point.
    *******************************************************************************}

    Function MMToMS(MM: TPoint): TPoint;
    var
      X, Y: Integer;
      Dis: TPoint;
    begin
      X := ((MM.X - 647));
      Y := ((MM.Y - 84));

      Dis := Point( (MMCX - MM.X)*-1, (MMCY - MM.Y)*-1);
      Result := Point(Round((259.5 + X)+ Dis.X*10), Round((170.0 + Y)+ Dis.Y*6.5));

      If Not IntInBox(Result.X, Result.Y, IntToBox(MSX1, MSY1, MSX2, MSY2))then
        Result := Point(-1, -1);
    end;

  2. #2
    Join Date
    Oct 2008
    Location
    C:\Simba\Includes\
    Posts
    7,566
    Mentioned
    19 Post(s)
    Quoted
    180 Post(s)

    Default

    Change the semicolon on the end to a period

    SCAR Code:
    program New;
    {.include SRL/SRL.scar}
    begin
      SetupSRL;
    end.

    ~Camo
    Away for awhile, life is keeping me busy. | Want to get my attention in a thread? @Kyle Undefined; me.
    { MSI Phoenix || SRL Stats Sigs || Paste || Scripts || Quotes || Graphics }

    When posting a bug, please post debug! Help us, help you!

    I would love to change the world, but they won't give me the source code. || To be the best, you've got to beat the rest. || Logic never changes, just the syntax.
    If you PM me with a stupid question or one listed in FAQ, or about a script that is not mine, I will NOT respond.


    SRL is a Library of routines made by the SRL community written for the Program Simba. We produce Scripts for the game Runescape.


  3. #3
    Join Date
    Jun 2007
    Location
    Wednesday
    Posts
    2,446
    Mentioned
    3 Post(s)
    Quoted
    1 Post(s)

    Default

    Problem is caused by not having moved plugins rather than the semi-colon to period - that will give a different error

    There's an option under Tools->Options->SRL Download (or somewhere like that) else you can move by hand by going into your Scar folder/Includes/SRL/Move into plugins folder (or a similar folder name) then copy and all files in there and paste them into your Scar folder/Plugins (if doing this way, you will have to restart Scar - if using built in then it's not a problem).
    By reading this signature you agree that mixster is superior to you in each and every way except the bad ways but including the really bad ways.

  4. #4
    Join Date
    Aug 2009
    Location
    Inside the Matrix...yes it has me, and it has you too.
    Posts
    1,896
    Mentioned
    0 Post(s)
    Quoted
    0 Post(s)

    Default

    Quote Originally Posted by Camo Developer View Post
    Change the semicolon on the end to a period

    SCAR Code:
    program New;
    {.include SRL/SRL.scar}
    begin
      SetupSRL;
    end.

    ~Camo
    LOL good job. Made me lol, got a good eye there
    NYAN NYAN NYAN NYAN NYAN NYAN NYAN NYAN NYAN NYAN NYAN NYAN NYAN

  5. #5
    Join Date
    Oct 2009
    Posts
    10
    Mentioned
    0 Post(s)
    Quoted
    0 Post(s)

    Default

    I have the same problem. I copyed the files where you said, restarted scar but no difference..

  6. #6
    Join Date
    Feb 2006
    Location
    Tracy/Davis, California
    Posts
    12,631
    Mentioned
    135 Post(s)
    Quoted
    418 Post(s)

    Default

    Tools>Options>SRL Download>Move Plugins.

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
  •