Results 1 to 3 of 3

Thread: ExistsSlotDTM:Boolean;

  1. #1
    Join Date
    Dec 2011
    Location
    Toronto, Ontario
    Posts
    6,424
    Mentioned
    84 Post(s)
    Quoted
    863 Post(s)

    Default ExistsSlotDTM:Boolean;

    Simba Code:
    function ExistsSlotDTM(DTM,InvSlot,x,y:Integer):Boolean;
    var
      Box:TBox;
    begin
      Box := InvBox(InvSlot);
      Result := FindDTM(DTM,x,y,Box.X1,Box.Y1,Box.X2,Box.Y2);
    end;

    Used for finding a DTM in a specific slot.

  2. #2
    Join Date
    Apr 2012
    Location
    Australia
    Posts
    1,252
    Mentioned
    1 Post(s)
    Quoted
    22 Post(s)

    Default

    Looks pretty handy, I don't know if it's suggestion worthy, but certainly a nice little snippet. +rep

  3. #3
    Join Date
    Dec 2011
    Location
    Toronto, Ontario
    Posts
    6,424
    Mentioned
    84 Post(s)
    Quoted
    863 Post(s)

    Default

    Thanks, although im not too sure if it already exists. I know "ExistsItemDTM" is there, but it doesn't search a specific slot.

    How I used it:

    Simba Code:
    procedure CheckInvDTMs;
    var
      i,lobDTM,sDTM,tDTM:Integer;
      foodCount,j,x,y:Integer;
      aDTM:TIntegerArray; //array of DTM/Integer
    begin
      aDTM := [lobDTM,sDTM,tDTM];
      for i := 1 to 28 do
        for j := Low(aDTM) to High(aDTM) do
        begin
          if ExistsSlotDTM(aDTM[j],i,x,y) then
            foodCount := foodCount + 1;
        end;
      if (foodCount <= 5) then                                                                                            g
      begin
        Action := 'travelF';
        SSTele;
      end;
      FreeDTMs(aDTM);
    end;

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
  •