Results 1 to 5 of 5

Thread: I;m so noob! please help me! :p

  1. #1
    Join Date
    Jul 2007
    Location
    Ottawa, Canada
    Posts
    930
    Mentioned
    0 Post(s)
    Quoted
    0 Post(s)

    Default I;m so noob! please help me! :p

    [Runtime Error] : Type Mismatch in line 34 in script D:\SCAR 3.15\Scripts\Script.scar

    I have no earthly idea what's wrong with it. Dan sais its taking up too much memory or something... Any way to fix it?

    It goes through the loop once, but then dies on the second loop.

    SCAR Code:
    program New;
    //{.include SRL/SRL/MISC/SMART.SCAR}
    {.Include Srl/Srl.scar}

    Procedure SetupSmart;
    begin
      SmartSetup('world113', True, True, False);
      wait(1000);
      SetTargetDC(SmartGetDC);
    end;

    function ClimbRope : Boolean;
    var
       i, h, hightpa : Integer;
       TPA, TPA2 : TPointArray;
       ATPA, ATPA2 : T2DPointArray;
       Side1, Side2 : Boolean;
       MiddleTPA1 : TPoint;
    begin
      FindColorsSpiralTolerance(MSCX, MSCY, TPA, 2900815, MSX1, MSY1, MSX2, MSY2, 30);
      FindColorsSpiralTolerance(MSCX, MSCY, TPA2, 922905, MSX1, MSY1, MSX2, MSY2, 30);
      ATPA := TPAToATPA(TPA, 30);
      SortATPASize(ATPA, true);
      ATPA2 := TPAToATPA(TPA2, 10);
      for i := 0 to High(ATPA) do
      begin
        MiddleTPA1 := MiddleTPA(ATPA[i]);
        wait(500);
        MMouse(MiddleTPA1.x, MiddleTPA1.y, 0, 0);
        hightpa := high(ATPA2);
        writeln(inttostr(High(ATPA2)))
        for h := 0 to hightpa do
        begin
          if PointInBox(MiddleTPA(ATPA2[h]), IntToBox(MiddleTPA1.x-40, MiddleTPA1.y-100, MiddleTPA1.X, MiddleTPA1.y+100)) then //this line
          begin
            Side1 := true;
          end;
          if PointInBox(MiddleTPA(ATPA2[h]), IntToBox(MiddleTPA1.x, MiddleTPA1.y-100, MiddleTPA1.X + 40, MiddleTPA1.y+100)) then
          begin
            Side2 := true;
          end;
          writeln(inttostr(MiddleTPA(ATPA2[h]).x));
          writeln(inttostr(MiddleTPA(ATPA2[h]).y));
        end;
        if Side1 and Side2 then
        begin
          TPA[0] := MiddleTPA(ATPA[i]);
          MMouse(tpa[0].x, tpa[0].y, 0, 0);
          wait(50);
          if isuptext('limb') then
          begin
            Mouse(tpa[0].x, tpa[0].y, 0, 0, false);
            if ChooseOption('limb') then
            begin
              fflag(0);
              result := true;
              exit;
            end;
          end;
        end;
        Side1 := false;
        Side2 := false;
      end;
    end;

    Begin
    //SetupSmart;
    SetupSRL;
    ClimbRope;

    end.
    ~ Metagen

  2. #2
    Join Date
    Dec 2006
    Location
    Sydney, New South Wales, Australia
    Posts
    4,603
    Mentioned
    15 Post(s)
    Quoted
    42 Post(s)

    Default

    *sigh* I told you. Remove those WriteLns and it'll work. Too much memory is being taken up by SCAR (i think).
    You may contact me with any concerns you have.
    Are you a victim of harassment? Please notify me or any other staff member.

    | SRL Community Rules | SRL Live Help & Chat | Setting up Simba | F.A.Q's |

  3. #3
    Join Date
    Jul 2007
    Location
    Ottawa, Canada
    Posts
    930
    Mentioned
    0 Post(s)
    Quoted
    0 Post(s)

    Default

    AHAAA! I WIN!!! i took out the boxes so now it looks like this instead...

    SCAR Code:
    Box1 := IntToBox(MTPA1.x-40, MTPA1.y-100, MTPA1.x, MTPA1.y+100);
      Box2 := IntToBox(MTPA1.x, MTPA1.y-100, MTPA1.x + 40, MTPA1.y+100)
       ///... later on
        for h := 0 to HighTPA do
        begin
          Side1 := PointInBox(TPA2[h], Box1);
          Side2 := PointInBox(TPA2[h], Box2);
          writeln(inttostr(TPA2[h].x));
          writeln(inttostr(TPA2[h].y));
        end;

    edit for anyone who cares, this is the finished thing

    SCAR Code:
    function ClimbRope : Boolean;
    var
       i, h, hightpa : Integer;
       TPA, TPA2 : TPointArray;
       ATPA, ATPA2 : T2DPointArray;
       Side1, Side2 : Boolean;
       MTPA1, MTPA2 : TPoint;
       Box1, Box2 : TBox;
    begin
      Box1 := IntToBox(MTPA1.x-40, MTPA1.y-100, MTPA1.x, MTPA1.y+100);
      Box2 := IntToBox(MTPA1.x, MTPA1.y-100, MTPA1.x + 40, MTPA1.y+100)
      FindColorsSpiralTolerance(MSCX, MSCY, TPA, 2900815, MSX1, MSY1, MSX2, MSY2, 30);
      FindColorsSpiralTolerance(MSCX, MSCY, TPA2, 922905, MSX1, MSY1, MSX2, MSY2, 30);
      ATPA := TPAToATPA(TPA, 50);
      SortATPASize(ATPA, true);
      ATPA2 := TPAToATPA(TPA2, 50);
      SetLength(TPA2, Length(ATPA));
      for h := 0 to high(ATPA2) do
      begin
        TPA2[h] := MiddleTPA(ATPA2[h]);
      end;
      highTPA :=Length(TPA2) - 1;
      SetLength(ATPA2, 0);
      for i := 0 to High(ATPA) do
      begin
        MTPA1 := MiddleTPA(ATPA[i]);
        for h := 0 to HighTPA do
        begin
          Side1 := PointInBox(TPA2[h], Box1);
          Side2 := PointInBox(TPA2[h], Box2);
        end;
        if Side1 and Side2 then
        begin
          TPA[0] := MiddleTPA(ATPA[i]);
          MMouse(tpa[0].x, tpa[0].y, 0, 0);
          wait(50);
          if isuptext('limb') then
          begin
            Mouse(tpa[0].x, tpa[0].y, 0, 0, false);
            if ChooseOption('limb') then
            begin
              fflag(0);
              result := true;
              exit;
            end;
          end;
        end;
        Side1 := false;
        Side2 := false;
      end;
    end;
    ~ Metagen

  4. #4
    Join Date
    Aug 2008
    Posts
    19
    Mentioned
    0 Post(s)
    Quoted
    0 Post(s)

    Default

    613 posts and ur a noob!!!???

  5. #5
    Join Date
    Jul 2007
    Location
    Ottawa, Canada
    Posts
    930
    Mentioned
    0 Post(s)
    Quoted
    0 Post(s)

    Default

    yea, that makes you a super noob welcome to the club
    ~ Metagen

Thread Information

Users Browsing this Thread

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

Similar Threads

  1. Noob To Noob Mentoring!
    By passiondrive in forum News and General
    Replies: 19
    Last Post: 11-11-2007, 03:23 AM
  2. Me = NOOB
    By Eugeniu in forum OSR Help
    Replies: 5
    Last Post: 10-20-2007, 11:46 AM
  3. Noob script ideas for a noob scripter
    By 13lacknova in forum First Scripts
    Replies: 7
    Last Post: 09-30-2007, 01:01 AM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •