so here is the function

Code:
var NDA: Array of Integer; //DTM Array Variable
SCAR Code:
procedure DropItems(Items: TStringArray);
var
  tx, ty, logs, i, R, R2, L, b: Integer;
  Pr: TPoint;
  TB: TBox;
  ndaMP: TDTMPointDef;
  ndaSP: array[0..1] of TDTMPointDef;
  ndaTDTM: TDTM;
  begin
  if not(LoggedIn) then Exit;

  logs := DTMFromString('78DA63FCC8C4C0D0C0C8800C9A536D19FE036' +
       '990E87F20607C0E545385AA06220B2381F46FA09A72026AFE03D5' +
       'B41350F306A8A68F809A1740355D04D43C06AA69C4AF0600FED91' +
       '064');

  NDA[0] := DTMFromString('78DA633CC1C4C0F0870105B4A40832FC07D28' +
       'C40FC1F08180F01D50832A22A6260442281F47E22D41C03AAF9C9' +
       '805FCD15A09AFF04D45C06AAF94540CD45A01A26FCEE010086730' +
       'FB3');
       
  NDA[1] := DTMFromString('78DA635CCECCC0C0C1C8800CD2447918FE036' +
       '990E87F20609C0B54F39F010D302291407A2D116AD603D5B033E2' +
       '57B30EA84690809AF940350204D4CC01AAE1C2AF0600018F0C72');

  if FindDTM(logs, tx, ty, MIX1, MIY1, MIX2, MIY2) then
  begin
    repeat
      if not(LoggedIn) then break;
      if RMM then
       MouseSpeed := (15 + random(5));
      Status('Inv MouseSpeed := '+ IntToStr(MouseSpeed));
      i := InvCount;
      r := random(8);
      r2 := random(2);
      Mouse(tx, ty, 8, 8, false);
      wait(100 + random(75));
      case r of

        0,1,2,3,4,5,6: begin
                         if not(LoggedIn) then Exit;
                         ChooseOption('rop');
                         Players[CurrentPlayer].Integers[1] := Players[CurrentPlayer].Integers[1] + 1;
                         LogsCut := LogsCut + 1;
                         CutChange := CutChange + 1;
                         while InvCount = i do wait(1);
                       end;

        7: begin
             if not(LoggedIn) then Exit;
             ChooseOption('se');
             wait(100 + random(75));


             case r2 of

               0: Mouse(tx, ty, 8, 8, true);

               1: begin
                    if not(LoggedIn) then Exit;
                    Mouse(tx, ty, 10, 4, false);
                    wait(100 + random(75));
                    ChooseOption('ancel');
                  end;

             end;
             Continue;
           end;

        {8: begin
             ChooseOption('xam');
             Goto repeat;
           end;}


      end;
      repeat
        if not(LoggedIn) then break;
         FindRand;
      until(not(InvCount = i));
    until not(FindDTM(logs, tx, ty, MIX1, MIY1, MIX2, MIY2));
  end;
  for L := 1 to 28 do
  begin
    if not(LoggedIn) then Exit;
    if KeepExtraItems then Break;
    if ExistsItem(L) then
    begin
      for b := 0 to GetArrayLength(NDA) - 1 do
      begin
        TB := InvBox(L);
        writeln(inttostr(NDA[b]));
        if FindDTM(NDA[b], tx, ty, TB.x1, TB.y1, TB.x2, TB.y2) then break;
        if b = High(NDA) then
        begin
          Pr := ItemCoords(L);
          MMouse(Pr.x, Pr.y, 8, 8);
          wait(100 + randomrange(100, 250));
          if not(IsUpTextMultiCustom(Items)) then
          begin
            Mouse(Pr.x, Pr.y, 8, 8, False);
            Wait(170 + Random(50));
            if (ChooseOption('rop')) then
              Wait(500 + Random(100));
          end else
          begin
            SafeItem := SafeItem + 1;
           
            ndaMP.x:= Pr.x;
            ndaMP.y:= Pr.y;
            ndaMP.AreaSize:= 1;
            ndaMP.AreaShape:= 0;
            ndaMP.Color:= GetColor(Pr.x, Pr.y);
            ndaMP.Tolerance:= 0;

            ndaSP[0].x:= Pr.x - 3;
            ndaSP[0].y:= Pr.y - 3;
            ndaSP[0].AreaSize:= 1;
            ndaSP[0].AreaShape:= 0;
            ndaSP[0].Color:= GetColor(Pr.x - 3, Pr.y - 3);
            ndaSP[0].Tolerance:= 0;

            ndaSP[1].x:= Pr.x + 3;
            ndaSP[1].y:= Pr.y + 3;
            ndaSP[1].AreaSize:= 1;
            ndaSP[1].AreaShape:= 0;
            ndaSP[1].Color:= GetColor(Pr.x + 3, Pr.y + 3);
            ndaSP[1].Tolerance:= 0;

            ndaTDTM.MainPoint:= ndaMP;
            ndaTDTM.SubPoints:= ndaSP;
           
            SetArrayLength(NDA, SafeItem);
            NDA[SafeItem - 1]:= AddDTM(ndaTDTM);
          end;
        end;
      end;
    end;
  end;
  ArrangeInv;
  FreeDTM(logs);
  for b := 0 to GetArrayLength(NDA) - 1 do FreeDTM(NDA[b]);
  LoadsDone := LoadsDone + 1;
  TotalLoads := TotalLoads + 1;
  Players[CurrentPlayer].Integers[0] := Players[CurrentPlayer].Integers[0] + 1;
end;

SCAR Code:
procedure SetVariables;
var i: Integer;
begin
  LoadsDone := 0;
  TotalLoads := 0;
  AxeFixes := 0;
  SafeItem := 2;
  SetArrayLength(NDA, 2);
  for i := 0 to GetArrayLength(Players)- 1  do
  begin
    Players[i].Integers[0] := 0;
    Players[i].Integers[1] := 0;
  end;
end;

so this is what it does right now

it sets the length of NDA to 2 at the beginning of the script since there are 2 pre-set dtms in the function, then it sets SafeItem to 2 also because that will be the variable that the ddtms that the function makes store to into the array

so the function, it searches the logs and drops the log dtms like a lot of other scripts, then it looks for the dtms stored into the NDA array and if it finds that dtm then it skips moving the mouse to that location in the inventory, and then it moves mouse to the items that arent found as stored dtms, and if the specified uptext is found on that item it makes a dtm of it, so far so good

then when it chops again and goes to drop it drops all the logs but then when you get to the FindDTM(NDA[b], ...), i get this error

Code:
[Runtime Error] : Exception: Access violation at address 006D71E8 in module 'scar.exe'. Read of address 00000000 in line 667 in script F:\CutEmDown.scar
i writeln for the dtms and i get this output

Code:
87
87
88
67
so there are values stored in the dtms since non of them are 0's...

would really appreciate any help someone could give me!

EDIT: on the second time it drops remember the dtm that i made from the uptext is now stored and im guessing for some reason that is not being stored correctly or something