diff --git a/osrs/interfaces/mainscreen/goldscreen.simba b/osrs/interfaces/mainscreen/goldscreen.simba index 730254e9..199dcb9b 100644 --- a/osrs/interfaces/mainscreen/goldscreen.simba +++ b/osrs/interfaces/mainscreen/goldscreen.simba @@ -239,15 +239,23 @@ function TRSGoldScreen.CanCraftItem(Item: ERSGoldItem): Boolean; ``` Returns `True` if the given item icon is available for crafting. *) -function TRSGoldScreen.CanCraftItem(i: ERSGoldItem): Boolean; +function TRSGoldScreen.CanCraftItem(i: ERSGoldItem): Boolean; const - GOLD_COLOR: TColor := 2806763; + GOLD_COLOR : TColor := 2806763; + AMULET_COLOR : TColorTolerance := [$24BCBD, 0.829, EColorSpace.HSV, [2.402, 0.499, 0.100]]; + NECKLACE_COLOR : TColorTolerance := [$20ACC0, 0.663, EColorSpace.HSV, [1.544, 1.355, 0.103]]; begin if not Self.IsOpen() then Exit; Result := Target.FindColor(GOLD_COLOR, 1, Self.ItemBoxes[i]).Length > 0; -end; + + if not Result then + Result := Target.HasColor(AMULET_COLOR, 10 ,Self.ItemBoxes[i]); + + if not Result then + Result := Target.HasColor(NECKLACE_COLOR, 10 ,Self.ItemBoxes[i]); +end; (* ## GoldScreen.IsItemHighlighted @@ -256,9 +264,11 @@ function TRSGoldScreen.IsItemHighlighted(Item: ERSGoldItem): Boolean; ``` Returns `True` if the given item is currently highlighted. *) -function TRSGoldScreen.IsItemHighlighted(i: ERSGoldItem): Boolean; +function TRSGoldScreen.IsItemHighlighted(i: ERSGoldItem): Boolean; var - highlight: TColorTolerance := [4807018,2]; + highlight : TColorTolerance := [$49596A, 2, EColorSpace.RGB, [1.000, 1.000, 1.000]]; + amuletColor : TColorTolerance := [$24BCBD, 0.829, EColorSpace.HSV, [2.402, 0.499, 0.100]]; + necklaceColor : TColorTolerance := [$20ACC0, 0.663, EColorSpace.HSV, [1.544, 1.355, 0.103]]; begin if not Self.IsOpen() then Exit; @@ -266,8 +276,14 @@ begin if not Self.CanCraftItem(i) then Exit; - Result := Target.FindColor(highlight, Self.ItemBoxes[i]).Length > 0; -end; + Result := Target.HasColor(highlight, 80 ,Self.ItemBoxes[i]); + + if not Result then + Result := Target.HasColor(amuletColor, 10 ,Self.ItemBoxes[i]); + + if not Result then + Result := Target.HasColor(necklaceColor, 10 ,Self.ItemBoxes[i]); +end; (* ## GoldScreen.CraftItem