PDA

View Full Version : WearingItemCust simple function



hamster
02-29-2008, 12:08 PM
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
02-29-2008, 12:15 PM
i think u forgot

T := ItemCoords(I);

or w/e it is

hamster
02-29-2008, 01:18 PM
ah, thanks, you're right :p