• Visit Rebornbuddy
  • Did OldRoutine ever use Orb of Storms?

    Discussion in 'Archives' started by lyvewyre, Mar 30, 2017.

    1. lyvewyre

      lyvewyre Member

      Joined:
      Jan 3, 2013
      Messages:
      418
      Likes Received:
      12
      Trophy Points:
      18
      I thought at some point OldRoutine would consistently use Orb of Storms if you had it slotted. Recent character I'm leveling, never uses OoS, and in looking through Old Routine I cannot see a reference to it.

      Am I imagining this was the case? I'd like bot to use it frequently to proc curse on hit mostly.
       
    2. lyvewyre

      lyvewyre Member

      Joined:
      Jan 3, 2013
      Messages:
      418
      Likes Received:
      12
      Trophy Points:
      18
      Ok, so with no response I decided to tackle the situation myself. I've chopped together something to make the bot cast orb of storms in a generally useful manner.

      Code:
                      // If we have Orb of Storms skill, and we haven't cast it recently, will cast when there 5 or mobs nearby or Magic+ mobs nearby.
                      if (_orbOfStormSlot != -1 && _orbOfStormStopwatch.ElapsedMilliseconds >
                          6000 && ((NumberOfMobsNear(LokiPoe.Me, 30) > 5) || (cachedRarity >= Rarity.Magic)))
                      {
                          // See if we can use the skill.
                          var skill = LokiPoe.InGameState.SkillBarHud.Slot(_orbOfStormSlot);
                          if (skill.CanUse())
                          {
                              {
                                  await DisableAlwaysHiglight();
      
                                  await Coroutines.FinishCurrentAction();
      
                                  var err1 = LokiPoe.InGameState.SkillBarHud.UseAt(_orbOfStormSlot, true, myPos);
                                  if (err1 == LokiPoe.InGameState.UseResult.None)
                                  {
                                      _orbOfStormStopwatch.Restart();
      
                                      await Coroutines.FinishCurrentAction(false);
      
                                      return true;
                                  }
      
                                  Log.ErrorFormat("[Logic] UseAt returned {0} for {1}.", err1, skill.Name);
                              }
                          }
                      }
      
      I set a stopwatch to cast the spell every 6 seconds (the cooldown of the spell) and to only cast if it encounters a magic or greater enemy, as well as if there are 5 or more mobs in range. It's working for the most part, wher it'll fall down is if the bot repositions suddenly, it won't recast the spell until the cooldown is up. But with the way the bot functions, that doesn't happen often.

      Also, because I was running a cold elementalist of sorts, here's some bonus frost bomb logic that is also working pretty decently:

      Code:
                      // If we have Frost Bomb skill, and we haven't cast it recently, will cast when there 5 or mobs nearby or Magic+ mobs nearby.
                      if (_frostBombSlot != -1 && _frostBombStopwatch.ElapsedMilliseconds >
                          3000 && ((NumberOfMobsNear(LokiPoe.Me, 30) > 5) || (cachedRarity >= Rarity.Magic)))
                      {
                          // See if we can use the skill.
                          var skill = LokiPoe.InGameState.SkillBarHud.Slot(_frostBombSlot);
                          if (skill.CanUse())
                          {
                              {
                                  await DisableAlwaysHiglight();
      
                                  await Coroutines.FinishCurrentAction();
      
                                  var err1 = LokiPoe.InGameState.SkillBarHud.UseAt(_frostBombSlot, true, cachedPosition);
                                  if (err1 == LokiPoe.InGameState.UseResult.None)
                                  {
                                      _frostBombStopwatch.Restart();
      
                                      await Coroutines.FinishCurrentAction(false);
      
                                      return true;
                                  }
      
                                  Log.ErrorFormat("[Logic] UseAt returned {0} for {1}.", err1, skill.Name);
                              }
                          }
                      }
      
      Similar situation, using a stopwatch for the cooldown of the spell, the main difference between the two spells that I've used is targeting the cachedPosition much like how the bot targets curses.
       

    Share This Page