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.
Printable View
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.
Looks pretty handy, I don't know if it's suggestion worthy, but certainly a nice little snippet. +rep :)
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;