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

Need a little help for making bot use vaal skills on only rare mobs and above.

fabcard

Member
Joined
Nov 7, 2013
Messages
131
Reaction score
1
Hello friends,

As in title, I would like to make bot use vaal skills only on monsters that are rare and above.
I know it's a little check we have to add on the OldRoutine.cs file but I don't remember how.

Code:
// Auto-cast any vaal skill at the best target as soon as it's usable.
				if (OldRoutineSettings.Instance.AutoCastVaalSkills && _vaalStopwatch.ElapsedMilliseconds > 1000)
				{
					foreach (var skill in LokiPoe.InGameState.SkillBarPanel.Skills)
					{
						if (skill.SkillTags.Contains("vaal"))
						{
							if (skill.CanUse()) // Something we have to add here if I'm not wrong. Like monster.rarity >= rare and !monster.isdead
							{
								await DisableAlwaysHiglight();

								var err1 = LokiPoe.InGameState.SkillBarPanel.UseAt(skill.Slot, false, cachedPosition);
								if (err1 == LokiPoe.InGameState.UseError.None)
								{
									await Coroutine.Sleep(Utility.LatencySafeValue(250));

									await Coroutines.FinishCurrentAction(false);

									await Coroutine.Sleep(Utility.LatencySafeValue(1000));

									return true;
								}

								Log.ErrorFormat("[Logic] Use returned {0} for {1}.", err1, skill.Name);
							}
						}
					}
					_vaalStopwatch.Restart();
				}
Thanks in advance :D
 
cachedRarity >= Rarity.Rare for example.
You can chack the "handle curses" area of routine for an example of usage.
 
cachedRarity >= Rarity.Rare for example.
You can chack the "handle curses" area of routine for an example of usage.

Thank you, PainfulDeath, that worked :D
I noticed that every time bot uses a vaal attack skill (even a buff such vaal haste) there's a little delay before and after using it, some like 1 second. I tried to remove that stopwatch 1000 but the delay persists. Just worried because a hard boss can kill me due that delay... If you have any idea on how to remove or decrease it, please let me know. :D
Again, thank you.
 
Stopwatch does nothing (it is there so that the bot doesn't try to spam the skill 10 times in one seconds).
await Coroutine.Sleep(Utility.LatencySafeValue(250));

await Coroutines.FinishCurrentAction(false);

await Coroutine.Sleep(Utility.LatencySafeValue(1000));

There are the lines you want to look into. The "sleep" mostly. You can try to remove/reduce the sleep and see how it works.
 
Stopwatch does nothing (it is there so that the bot doesn't try to spam the skill 10 times in one seconds).
await Coroutine.Sleep(Utility.LatencySafeValue(250));

await Coroutines.FinishCurrentAction(false);

await Coroutine.Sleep(Utility.LatencySafeValue(1000));

There are the lines you want to look into. The "sleep" mostly. You can try to remove/reduce the sleep and see how it works.
Hey friend, I'll try changing those later. Hope it works. :D
One quick question. I added cachedRarity >= Rarity.Rare as you said to make bot uses vaal attacks only on rare+ mobs, it's working. Is there any way to add a command on that same line to make it don't use vaal attacks on ele/phys reflect rare+ mobs? Some like: if (skill.CanUse() && cachedRarity >= Rarity.Rare && cachedXXX != XXX.Ele/PhysReflect).
Please someone tell me that's possible and what is the command for that. It will be very appreciated :D
Thanks in advance.
 
Back
Top