SRL Archive - Research & Development Lounge

WearingItemCust simple function


hamster

2008-02-29 07:08:08

I was kinda shocked this function isnt in SRL, so I just made my own then…

It checks if there's an equiped item in the given slot -AND- it checks for its name. Handy when using jewelry with charges :-)

function WearingItemCust(i : integer; name : String) : Boolean;
var
x,y : integer;
T: TPoint;
begin
if(WearingItem(i)) then
begin
T := EquipmentCoords(i);
MMouse(T.x, T.y, 5, 5);
Wait(100+random(50));
if(IsUpText(name)) then
Result := True;
end else
writeln('You dont have an item equiped in that slot');
end;


it's kinda untested, so tell me if it works hehe (also, its my first decent function I made)

JuKKa

2008-02-29 07:15:16

i think u forgot

T := ItemCoords(I);

or w/e it is

hamster

2008-02-29 08:18:07

ah, thanks, you're right :p