SRL Archive - SRL Archives

ItemActivated(Slot: Integer): Boolean;


marpis

2009-10-02 13:28:21

Checks if we have clicked the item in inventory and "activated" it
Where to use?
- In every trade where you have to combine items
-> firemaking (logs, matches)
-> crafting (needle, leather, etc)
-> herblore (potions, herbs)
-> ???


function ItemActivated(Slot: Integer): Boolean;
var
X, Y: Integer;
B: TBox;
begin
B := InvBox(Slot);
Result := FindColor(X, Y, 16777215, B.X1, B.Y1, B.X2, B.Y2);
end;

caused

2009-10-02 14:33:52

Very Useful.

Does it always have a perfect "white" frame though ?
I thought that would vary ;/

~caused

marpis

2009-10-02 15:50:14

From: caused
Very Useful.

Does it always have a perfect "white" frame though ?
I thought that would vary ;/

~caused


nope, it's always white.

EvilChicken!

2009-10-02 16:18:45

Thanks, Marpis, I committed this.
I've thought of adding this a long time ago, but I obviously forgot it.

Plus, I added function FindActiveItemSlot: TBox; too, inspired by you. :)