SRL Archive - Research & Development Lounge

RS3_dropAllItemsWith/WithoutMouseOverText


KeepBotting

2013-12-09 21:43:04

procedure RS3_dropAllItemsWithMouseOverText(textToLookFor:string);
var
i:integer;
begin
for i := 1 to 28 do
begin
if (tabBackpack.isItemInSlot(i)) then
tabBackpack.mouseSlot(i, MOUSE_MOVE);
if isMouseOverText([textToLookFor]) then
begin
tabBackpack.dropItems([i]);
end;
end;
end;

procedure RS3_dropAllItemsWithoutMouseOverText(textToLookFor:string);
var
i:integer;
begin
for i := 1 to 28 do
begin
if (tabBackpack.isItemInSlot(i)) then
tabBackpack.mouseSlot(i, MOUSE_MOVE);
if not isMouseOverText([textToLookFor]) then
begin
tabBackpack.dropItems([i]);
end;
end;
end;

Sjoe

2013-12-15 17:23:06

From: KeepBotting


procedure RS3_dropAllItemsWithMouseOverText(textToLookFor:string);
var
i:integer;
begin
for i := 1 to 28 do
begin
if (tabBackpack.isItemInSlot(i)) then
begin
tabBackpack.mouseSlot(i, MOUSE_MOVE);
if isMouseOverText([textToLookFor]) then // don't want this to start when there is no item in slot
tabBackpack.dropItems([i]);
end;
end;
end;

Think it should look like this? :)

Rich

2013-12-15 18:08:19

You could combine the two very neatly using xor.

Check this out:

procedure RS3_dropAllOfOrExcept(textsToLookFor : TStringArray, keepItem : Boolean);
var
I : Integer;

begin
for I:= 1 to 28 do
begin
if (tabBackpack.isItemInSlot(I)) then
begin
tabBackpack.mouseSlot(I, MOUSE_MOVE);
if (isMouseOverText(textsToLookFor, 200) xor keepItem) then
tabBackpack.dropItems([I]);
Wait(RandomRange(75, 200));
end;
end;
end;

Pretty much if you set keepItem true, it will drop everything except textsToLookFor. Set it false and it will drop only those items. The text variable is now an array as well so you can keep/drop multiple items. Also added a wait onto the text checking just for security and a little random wait at the end to mix it up a bit.