What's new
  • Visit Rebornbuddy
  • Visit Panda Profiles
  • Visit LLamamMagic
  • Visit Resources
  • Visit Downloads
  • Visit Portal

QuestTool Gem Upgrading Fix

dr01der

New Member
Joined
Aug 14, 2014
Messages
11
Reaction score
2
As a follow up to my post in the active Trinity/QuestTool thread here, here's what I had to do to get gem upgrade priority to factor in Minimum % Chance.

I had to update the ConvertBack method in QuestTools\UI\PercentConverter.cs to account for string values:

Code:
public object ConvertBack(object value, Type targetType, object parameter, System.Globalization.CultureInfo culture)
{
	var pf = 0f;
	var pd = 0.0;
	
	if (value is float)
	{
		return (float)Math.Round((float)value / 100, 2);
	}
	if (value is double)
	{
		return Math.Round((double)value / 100, 2);
	}
	if (float.TryParse(value.ToString(), out pf))
	{
		return (float)Math.Round(pf / 100, 2);
	}
	if (double.TryParse(value.ToString(), out pd))
	{
		return Math.Round(pd / 100, 2);
	}
	return 0f;
}

Then I had to modify QuestTool\ProfileTags\CompleteGreaterRift.cs line 69:

Code:
List<ACDItem> gems = ZetaDia.Actors.GetActorsOfType<ACDItem>()
	.Where(item => item.ItemType == ItemType.LegendaryGem
		&& GetUpgradeChance(item) >= minimumGemChance)
	.OrderByDescending(item => GetUpgradeChance(item))
	.ThenByDescending(item => item.JewelRank).ToList();

After doing so, restarting DB, and ensuring something was selected for Minimum % Chance (in my case, 70%), everything worked as expected.

Code:
Interacting With Urshi (2)
Completing Greater Rift (2)
[B][<CompleteGreaterRiftRoutine>d__20] Minimun Gem Upgrade Chance: 70[/B]
[<CompleteGreaterRiftRoutine>d__20] ***************************
[<CompleteGreaterRiftRoutine>d__20]   Pre Upgrade Gem Listing  
[<CompleteGreaterRiftRoutine>d__20] ***************************
[CompleteGreaterRift] Gem: Gogok of Swiftness; Rank: 10; Chance: 100
[CompleteGreaterRift] Gem: Zei's Stone of Vengeance; Rank: 7; Chance: 100
[CompleteGreaterRift] Gem: Simplicity's Strength; Rank: 2; Chance: 100
[CompleteGreaterRift] Gem: Wreath of Lightning; Rank: 2; Chance: 100
[CompleteGreaterRift] Gem: Bane of the Trapped; Rank: 1; Chance: 100
[CompleteGreaterRift] Gem: Bane of the Powerful; Rank: 1; Chance: 100
[CompleteGreaterRift] Gem: Taeguk; Rank: 1; Chance: 100
[CompleteGreaterRift] Gem: Moratorium; Rank: 1; Chance: 100
[CompleteGreaterRift] Gem: Pain Enhancer; Rank: 1; Chance: 100
[CompleteGreaterRift] Gem: Gem of Efficacious Toxin; Rank: 1; Chance: 100
[CompleteGreaterRift] Gem: Invigorating Gemstone; Rank: 1; Chance: 100
[B][CompleteGreaterRift] Gem: Bane of the Powerful; Rank: 25; Chance: 70[/B]
[B][QuestTools][<CompleteGreaterRiftRoutine>d__20] Using gem priority of Highest Rank[/B]
[B]Upgrading gem: Bane of the Powerful, Index: 1[/B]
[<CompleteGreaterRiftRoutine>d__20] Rift Vendor Dialog is not visible
[ExploreDungeonTag] ExploreDungeon Started
[QuestTools][GridRoute] Generated new Scene Route with 50 nodes in 10ms
[QuestTools][GridRoute] Generated new Scene Route with 50 nodes in 10ms
[QuestTools][ExploreDungeonTag] Found Object 398682!
Interacting With Urshi (2)
Completing Greater Rift (2)
[<CompleteGreaterRiftRoutine>d__20] Minimun Gem Upgrade Chance: 70
[<CompleteGreaterRiftRoutine>d__20] ***************************
[<CompleteGreaterRiftRoutine>d__20]   Pre Upgrade Gem Listing  
[<CompleteGreaterRiftRoutine>d__20] ***************************
[B][CompleteGreaterRift] Gem: Gogok of Swiftness; Rank: 10; Chance: 100[/B]
[CompleteGreaterRift] Gem: Zei's Stone of Vengeance; Rank: 7; Chance: 100
[CompleteGreaterRift] Gem: Simplicity's Strength; Rank: 2; Chance: 100
[CompleteGreaterRift] Gem: Wreath of Lightning; Rank: 2; Chance: 100
[CompleteGreaterRift] Gem: Bane of the Trapped; Rank: 1; Chance: 100
[CompleteGreaterRift] Gem: Bane of the Powerful; Rank: 1; Chance: 100
[CompleteGreaterRift] Gem: Taeguk; Rank: 1; Chance: 100
[CompleteGreaterRift] Gem: Moratorium; Rank: 1; Chance: 100
[CompleteGreaterRift] Gem: Pain Enhancer; Rank: 1; Chance: 100
[CompleteGreaterRift] Gem: Gem of Efficacious Toxin; Rank: 1; Chance: 100
[CompleteGreaterRift] Gem: Invigorating Gemstone; Rank: 1; Chance: 100
[QuestTools][<CompleteGreaterRiftRoutine>d__20] Using gem priority of Highest Rank
[B]Upgrading gem: Gogok of Swiftness, Index: 5[/B]
[<CompleteGreaterRiftRoutine>d__20] Rift Vendor Dialog is not visible
[ExploreDungeonTag] ExploreDungeon Started
[QuestTools][GridRoute] Generated new Scene Route with 50 nodes in 11ms
[QuestTools][GridRoute] Generated new Scene Route with 50 nodes in 11ms
[QuestTools][ExploreDungeonTag] Found Object 398682!
Interacting With Urshi (2)
Completing Greater Rift (2)
[<CompleteGreaterRiftRoutine>d__20] Minimun Gem Upgrade Chance: 70
[<CompleteGreaterRiftRoutine>d__20] ***************************
[<CompleteGreaterRiftRoutine>d__20]   Pre Upgrade Gem Listing  
[<CompleteGreaterRiftRoutine>d__20] ***************************
[B][CompleteGreaterRift] Gem: Gogok of Swiftness; Rank: 11; Chance: 100[/B]
[CompleteGreaterRift] Gem: Zei's Stone of Vengeance; Rank: 7; Chance: 100
[CompleteGreaterRift] Gem: Simplicity's Strength; Rank: 2; Chance: 100
[CompleteGreaterRift] Gem: Wreath of Lightning; Rank: 2; Chance: 100
[CompleteGreaterRift] Gem: Bane of the Trapped; Rank: 1; Chance: 100
[CompleteGreaterRift] Gem: Bane of the Powerful; Rank: 1; Chance: 100
[CompleteGreaterRift] Gem: Taeguk; Rank: 1; Chance: 100
[CompleteGreaterRift] Gem: Moratorium; Rank: 1; Chance: 100
[CompleteGreaterRift] Gem: Pain Enhancer; Rank: 1; Chance: 100
[CompleteGreaterRift] Gem: Gem of Efficacious Toxin; Rank: 1; Chance: 100
[CompleteGreaterRift] Gem: Invigorating Gemstone; Rank: 1; Chance: 100
[QuestTools][<CompleteGreaterRiftRoutine>d__20] Using gem priority of Highest Rank
[B]Upgrading gem: Gogok of Swiftness, Index: 5[/B]

As you can see, I conveniently had a gem right at the breakpoint for 70%. It upgraded once, then dropped off the list and the next highest was taken.

Hopefully this helps someone until rrrix is able to patch it in the next update.
 
Greeting, Sir.
Do you mind telling me which GreatRift profile you are using now? :D
 
R-Rift. Its been updated to integrate with the new QuestTools Rift options. Its packaged in EzUpdater
 
Thanks legend. Super helpful and works like a charm.
 
is the code above merged in QuestTool 2.1.32?
Because the bot seems to ignore the min chance to upgrade gem.

Test Settings:
Min chance to upgrade gem = 60% (Default)
Gem Priority = Equip , Lowest, Highest

I have a gem equipped with a chance of 1% (I expect that the bot will not attempt to upgrade it based on the current settings)
Test result : Fail (Bot attempts to upgrade the equipped gem regardless of the 1% chance to success)

Expected result : Bot will not upgrade gem with lower chance to success.

im not sure if this is how the bot should work.
 
is the code above merged in QuestTool 2.1.32?
Because the bot seems to ignore the min chance to upgrade gem.

Test Settings:
Min chance to upgrade gem = 60% (Default)
Gem Priority = Equip , Lowest, Highest

I have a gem equipped with a chance of 1% (I expect that the bot will not attempt to upgrade it based on the current settings)
Test result : Fail (Bot attempts to upgrade the equipped gem regardless of the 1% chance to success)

Expected result : Bot will not upgrade gem with lower chance to success.

im not sure if this is how the bot should work.
The above code snippets were my personal modifications to get it to work. Until rrrix updates QuestTools, you'll have to do the same.
 
Made my own tweak, this will ONLY allow gems within D3's upgrade limits to be selected (seems greater than -15 Diablo disables the upgrade button, so good way to get caught atm >.>)

Also if there are no gems that hit the minimum upgrade limit, it will now upgrade the keystone instead.

THIS IS NOT HARDCORE FRIENDLY AT PRESENT
View attachment CompleteGreaterRift.cs
 
Last edited:
changing this lines result in:
[Trinity] ENABLED: Trinity v2.1.12 now in action!
Failed to load profile: Element TownPortal is not supported. Please check your XML and try again. (<TownPortal questId="1" />) Line 31
System.Exception: Element TownPortal is not supported. Please check your XML and try again. (<TownPortal questId="1" />) Line 31
at ..(PropertyInfo , XElement , Object )
at Zeta.XmlEngine.XmlEngine.Load(Object obj, XElement element)
at ..(XElement , Type )
at ...(XElement )
at System.Linq.Enumerable.WhereSelectEnumerableIterator`2.MoveNext()
at System.Collections.Generic.List`1..ctor(IEnumerable`1 collection)
at System.Linq.Enumerable.ToList[TSource](IEnumerable`1 source)
at ..(XElement , PropertyInfo )
at ..(PropertyInfo , XElement , Object )
at Zeta.XmlEngine.XmlEngine.Load(Object obj, XElement element)
at Zeta.Bot.Profile.Profile.Load(XElement element, String path)
at Zeta.Bot.Profile.Profile.Load(String path)
at Zeta.Bot.ProfileManager.Load(String profilePath, Boolean rememberPath)
 
changing this lines result in:
[Trinity] ENABLED: Trinity v2.1.12 now in action!
Failed to load profile: Element TownPortal is not supported. Please check your XML and try again. (<TownPortal questId="1" />) Line 31
System.Exception: Element TownPortal is not supported. Please check your XML and try again. (<TownPortal questId="1" />) Line 31
at ..(PropertyInfo , XElement , Object )
at Zeta.XmlEngine.XmlEngine.Load(Object obj, XElement element)
at ..(XElement , Type )
at ...(XElement )
at System.Linq.Enumerable.WhereSelectEnumerableIterator`2.MoveNext()
at System.Collections.Generic.List`1..ctor(IEnumerable`1 collection)
at System.Linq.Enumerable.ToList[TSource](IEnumerable`1 source)
at ..(XElement , PropertyInfo )
at ..(PropertyInfo , XElement , Object )
at Zeta.XmlEngine.XmlEngine.Load(Object obj, XElement element)
at Zeta.Bot.Profile.Profile.Load(XElement element, String path)
at Zeta.Bot.Profile.Profile.Load(String path)
at Zeta.Bot.ProfileManager.Load(String profilePath, Boolean rememberPath)

You did it wrongly, try again. Good luck.
 
Would have been great if you included the attachments to this post, but none the less, good job! thank~
 
Back
Top