A G E N T
2008-10-17 20:10:28
Hi all,
This idea sort of just popped into mind while I was thinking about DTMs, blacklists, and such…
A quick function to find the position of all logs (any type) in your inventory. I thought it might come in handy for woodcutting scripts, probably a bit faster and less memory-intensive than DTMs.
The function: (couldn't think of a name.)
Usage:
-Agent
This idea sort of just popped into mind while I was thinking about DTMs, blacklists, and such…
A quick function to find the position of all logs (any type) in your inventory. I thought it might come in handy for woodcutting scripts, probably a bit faster and less memory-intensive than DTMs.
The function: (couldn't think of a name.)
function CheckLogs : TIntegerArray;
var
i, n : integer;
Box : TBox;
ResArr : Array of integer;
begin
GameTab(4);
n := 0;
for i:=1 to 28 do
begin
Box := InvBox(i);
if(CountColor(65536, Box.x1, Box.y1, Box.x2, Box.y2) = 85)then
begin
SetArrayLength(ResArr, (n+1));
ResArr[n] := i;
Inc(n);
end;
end;
Result := ResArr;
end;
Usage:
TheArr := CheckLogs;
for x := 0 to GetArrayLength(TheArr) do
begin
DropItem(TheArr[x]);
end;
-Agent