Uhhh I don't like the idea of right clicking to see if an item is there.. You could modify the gametab to check like so:
Simba Code:
function EquipmentCoords(EquipSlot: Integer): TPoint;
begin
case EquipSlot of
1: Result := Point(640, 225);
2: Result := Point(600, 266);
3: Result := Point(640, 266);
4: Result := Point(684, 266);
5: Result := Point(588, 304);
6: Result := Point(644, 304);
7: Result := Point(700, 304);
8: Result := Point(642, 343);
9: Result := Point(588, 384);
10: Result := Point(643, 384);
11: Result := Point(700, 384);
12: Result := Point(600, 226);
else
begin
result := Point(-1,-1);
srl_warn('EquipmentCoords','Invalid EquipSlot('+inttostr(EquipSlot)+') passed',warn_AllVersions);
end;
end;
end;
function GetEquippedItemBounds(Which: Variant): TBox;
var
P: TPoint;
I: Integer;
begin
Result := IntToBox(0, 0, 0, 0);
I := -1;
case VarType(Which) of
varInteger: if (InRange(Which, 1, 11)) then
I := Which;
varString: case Which of
'helm', 'helmet' :
I := 1;
'cape' :
I := 2;
'amulet', 'neck', 'necklace' :
I := 3;
'arrows', 'bolts' :
I := 4;
'right hand', 'weapon' :
I := 5;
'plate', 'chest', 'platebody' :
I := 6;
'left hand', 'sheild', 'shield' :
I := 7;
'legs', 'platelegs', 'skirt', 'plateskirt' :
I := 8;
'gloves', 'gauntlets' :
I := 9;
'boots':
I := 10;
'ring' :
I := 11;
'aura':
I := 12;
end;
end;
if (I = -1) then
begin
SRL_Warn('GetEquiptItemBounds', 'Invalid entry (' + ToStr(Which) + ')', Warn_AllVersions);
Exit;
end;
P := EquipmentCoords(I);
Result := IntToBox(P.x - 11, P.y - 11, P.x + 11, P.y + 11);
end;
function CountEquippedItems: Integer;
var
I: Integer;
begin
Result := Integer(GameTab(tab_Equip)) - 2;
if (Result = -1) then exit;
for I := 1 to 12 do
if WearingItem(I) then
Inc(Result);
end;
Then in your functions you can do:
Simba Code:
Function ActivateAura: Boolean;
begin
if WearingItem(12) then
begin
MouseEquippedItem('aura', MOUSE_RIGHT);
Result:= (WaitOptionMulti(['tivate', 'Activate', 'vate', 'ctiv'], 600)
end;
end;
Function AuraFinished: Boolean;
begin
if WearingItem(12) then
begin
MouseEquippedItem('aura', MOUSE_RIGHT);
if WaitOptionMulti(['ura time', 'me remain', 'remaining'], 'action', 600) then
begin
Wait(RandomRange(900+Random(100)));
Result:= FindBlackChatMessage('The aura has finished');
end;
end;
end;