SRL Archive - OSR Help

How to drop Item in inventory


astoria1112000

2011-12-01 09:19:12

What is the function to drop an item from the inventory??

RISK

2011-12-01 09:26:58

DropItem(I);

I is what slot, 1 ~ 28. You can see all of SRL's functions by using the in-built search that Simba has, by the way:

astoria1112000

2011-12-01 09:30:10

No i dont know the inventory slot of my item , want to rtclick my item and select select drop

I am using ChooseOption('Drop') but it doesnot click on Drop after rt clicking????

RISK

2011-12-01 09:35:32

Here, you can study this from my script that I am working on. If you have any questions, feel free to ask.

function DropInventory: Boolean;
var
X, Y, I, DTM : Integer;
Box : TBox;
M : string;
begin
if (not(LoggedIn)) or (not(InvFull)) then Exit;
FindNormalRandoms;

M := Players[CurrentPlayer].Strings[MINING];
case Lowercase(M) of
'iron' : DTM := DTMFromString('mbQAAAHicY2VgYOhhYmCYA8S1QDwJiFuAWISRgYEf' +
'iGWhmBeITeXFgaqZUDArAyZgxILBAABOugO3');
'copper' : DTM := DTMFromString('mbQAAAHicY2VgYLjKxMBwE4jPAvF9ID4JxOKMD' +
'AzcQCwHxPJALAjEu7OtgKqZUDArAyZgxILBAAA' +
'WYgYa');
'tin' : DTM := DTMFromString('mbQAAAHicY2VgYNjGxMBwDIi3AvEyIN4AxKKMDAz' +
'8QKwIxCJAzAnEaYmJQNVMKJiLARMwYsFgAADKOgU9');
end;

for I := 1 to 28 do
begin
Box := InvBox(I);
if FindDTM(DTM, X, Y, Box.X1, Box.Y1, Box.X2, Box.Y2) then
begin
Mouse(X, Y, 5, 5, False);
WaitOption('rop', 710);
end;

Wait(RandomRange(122, 180));
end;

FreeDTM(DTM);

if (InvFull) then ExitPlayer('We were unable to drop our inventory...');
end;

The procedure will search the inventory from slot 1 to slot 28 for a DTM. Every time it finds the DTM, it will drop it. Then it will continue from the slot it left off on.

If you want a simplified version:

procedure SimpleDrop;
var X, Y, DTM : Integer;
begin
if (not(LoggedIn)) then Exit;
FindNormalRandoms;

DTM := DTMFromString('');

if FindDTM(DTM, X, Y, MIX1, MIY1, MIX2, MIY2) then
begin
Mouse(X, Y, 5, 5, False);
ChooseOption('rop');
end;

FreeDTM(DTM);
end;

For your edit: You should never use capital letters in your text finding, try it that way. Also make sure everything is updated.

From: astoria1112000
No i dont know the inventory slot of my item , want to rtclick my item and select select drop

i luffs yeww

2011-12-01 12:11:11

From: RISK
For your edit: You should never use capital letters in your text finding, try it that way. Also make sure everything is updated.


That's not true anymore. That hasn't been necessary for.. years, I believe. We were just so used to it we never changed tutorials or anything, even though there's no real reason to do it. Theoretically it's faster if you do use them, I think, because reading the first three letters is faster than just the lower case letters (which sometimes can be a bit down the line).

But that's a bit unrelated.

YoHoJo

2011-12-01 13:02:04

Try looking up and using chooseoptionmulti but that's odd chooseoption should work just fine.
Try downloading new Simba from here: http://villavu.com/forum/showthread.php?t=68477

Sir R. M8gic1an

2011-12-01 15:09:50

Make sure your SRL and Simba are the latest due to the recent font change.

@RISK
instead of

for I := 1 to 28 do
begin
Box := InvBox(I);
if FindDTM(DTM, X, Y, Box.X1, Box.Y1, Box.X2, Box.Y2) then
begin
Mouse(X, Y, 5, 5, False);
WaitOption('rop', 710);
end;

// I'd Really suggest

FoundDTM: boolean;

FoundDTM := FindDTM(DTM, X, Y, MIX1, MIY1, MIX2, MIY2);
while (FoundDTM) do
begin
Mouse(X, Y, 5, 5, False);
WaitOption('rop', 710);
FoundDTM := FindDTM(DTM, X, Y, MIX1, MIY1, MIX2, MIY2);
end;

Cus that might really save you a lot of DTM searches.

-RM