SRL Archive - Jr. Member General Help and Discussion

Dropping miscellaneous items


Ross

2014-09-04 10:03:25

My fighting script has a loot menu of three items. How would I write a drop function for if it picks something up that is not from that list of items (misclick etc.)?

I couldn't find anything here.

Thanks!

riwu

2014-09-04 10:55:06

loop through the inv slots to find the dtm/bitmap of the unwanted items, or check if they match any of the dtm/bitmap of the wanted items.
right click and checking option menu can also minimize picking up wrong items.

TylerT

2014-09-04 16:16:50

Obviously it isn't the greatest and there is probably a way to check all the slots without hardcoding each one, but I'm too stupid for that. Maybe someone else can add to this.

Try this?
procedure dropMisc();
begin
if not
isMouseOverText(['item that you want to keeps mouseOverText'])
or
isMouseOverText(['other item that you want to keeps mouseOverText'])
or
isMouseOverText(['other item that you want to keeps mouseOverText'])
then // if text matches then begin
begin
fastClick(MOUSE_RIGHT); // right click
chooseOption.select(['rop']); // choose drop option
writeLn('We dropped a junk item');
end else
writeln('item is a wanted item, keeping it');
end;

procedure findMisc();
begin
if not isLoggedIn then
Exit;

if not (tabBackpack.isOpen()) then
tabBackpack.open();

if (tabBackpack.isOpen()) then
tabBackPack.mouseSlot(1, MOUSE_MOVE); // move mouse slot 1

if (tabBackpack.isItemInSlot(1)) then
begin
dropMisc();
tabBackPack.mouseSlot(2, MOUSE_MOVE); // move mouse slot 2
end else
writeln('slot 1 empty, moving to next slot');
tabBackPack.mouseSlot(2, MOUSE_MOVE); // move mouse slot 2

if (tabBackpack.isItemInSlot(2)) then
begin
dropMisc();
tabBackPack.mouseSlot(3, MOUSE_MOVE); // move mouse slot 3
end else
writeln('slot 2 empty, moving to next slot');
tabBackPack.mouseSlot(3, MOUSE_MOVE); // move mouse slot 3

//Add in the same code from slots 3-28 to sort out the junk items from the whole inventory
end;

Actually I don't even think you need the mouse moves, but eh this is off the top of my head.

Kyle

2014-09-04 17:18:01

From: TylerT
Obviously it isn't the greatest and there is probably a way to check all the slots without hardcoding each one, but I'm too stupid for that. Maybe someone else can add to this.

Try this?


Use
[./Simba] tags, much easier to read :)

TylerT

2014-09-04 17:19:58

From: elfyyy
Use
[./Simba] tags, much easier to read :)


Ty sir.

KeepBotting

2014-09-04 22:37:22

From: TylerT
*snip*


You could shorten that a lot by using a for..to..do loop, and possibly add in a bit that says quit if there's no item in the slot :P no need to check the slots for mouseovertext if there's no item!