• Visit Rebornbuddy
  • [Snippet] Golem

    Discussion in 'Archives' started by tozededao, Jul 28, 2015.

    1. tozededao

      tozededao Community Developer

      Joined:
      Jan 15, 2010
      Messages:
      1,225
      Likes Received:
      5
      Trophy Points:
      38
      Since new included routine does not have Golem Support here's what you have to add to do to make it summon your Golem.




      At the beginning of the cs, where all the other slots are declared add :

      Code:
      private int _golemSlot = -1;
      After that add a Golem Stopwatch near all the stop watches

      Code:
      private readonly Stopwatch _golemStopwatch = Stopwatch.StartNew();
      On public void Tick() when the game needs update and it resets all the other slots add

      Code:
      _golemSlot = -1;
      After that when it reads the slot contents for action bar add :

      Code:
                      var golem = LokiPoe.InGameState.SkillBarPanel.Skills.FirstOrDefault(s => s.Name == "Summon Flame Golem");
                      if (IsCastableHelper(golem))
                      {
                          _golemSlot = golem.Slot;
                      }
      
      
                      golem = LokiPoe.InGameState.SkillBarPanel.Skills.FirstOrDefault(s => s.Name == "Summon Ice Golem");
                      if (IsCastableHelper(golem))
                      {
                          _golemSlot = golem.Slot;
                      }
      
      
                      golem = LokiPoe.InGameState.SkillBarPanel.Skills.FirstOrDefault(s => s.Name == "Summon Chaos Golem");
                      if (IsCastableHelper(golem))
                      {
                          _golemSlot = golem.Slot;
                      }
      

      On the task logic where the auras are cast etc add

      Code:
       if (_golemSlot != -1 && _golemStopwatch.ElapsedMilliseconds > 10000)
                      {
                          // See if we can use the skill.
                          var skill = LokiPoe.InGameState.SkillBarPanel.Slot(_golemSlot);
                          if (skill.CanUse() && skill.NumberDeployed < 1)
                          {
                              var err1 = LokiPoe.InGameState.SkillBarPanel.Use(_golemSlot, true);
      
      
                              _golemStopwatch.Restart();
                              if (err1 == LokiPoe.InGameState.UseError.None)
                              {
                                  await Coroutine.Sleep(Utility.LatencySafeValue(500));
      
      
                                  await Coroutines.FinishCurrentAction(false);
      
      
                                  await Coroutine.Sleep(Utility.LatencySafeValue(100));
      
      
                                  return true;
                              }
      
      
                              Log.ErrorFormat("[Logic] Use returned {0} for {1}.", err1, skill.Name);
                          }
                      }
      
       
    2. Lay

      Lay Member

      Joined:
      Jul 6, 2015
      Messages:
      173
      Likes Received:
      6
      Trophy Points:
      18
      Damn dude thanks a ton for this! Working strong! :D
      Anyone that is too lazy to do this, here is the slightly modified old routine file.
      Go to your bot location -> Routines -> Replace OldRoutine.cs
      DONT FORGET TO MAKE A BACKUP IF I SCREWED SOMETHING UP! :)

      View attachment OldRoutine.cs


      Edit: Also for any newbs, where he says "golemSlot = -1;"
      he really means "_golemSlot = -1;"

      Edit2: The beautiful bastard fixed it! :D
       
    3. dbuddy2

      dbuddy2 New Member

      Joined:
      Mar 6, 2015
      Messages:
      206
      Likes Received:
      0
      Trophy Points:
      0
      great thanks, will try this!
      @devs: please include in the next update. i hope these manually changes don't screw up the bot.
       
    4. Lay

      Lay Member

      Joined:
      Jul 6, 2015
      Messages:
      173
      Likes Received:
      6
      Trophy Points:
      18
      ok for some reason the code he made causes an issue were the bot may randomly hang. You'll see nothing but "Highest latency", "lowest latency" ect on the log.
      removing the golem from my cast bar fixed it, i'll look through the code and find out what happened
       
    5. toNyx

      toNyx Well-Known Member

      Joined:
      Oct 29, 2011
      Messages:
      3,770
      Likes Received:
      35
      Trophy Points:
      48
      I'm using a similar version of this snippet without the stopwatch (who care of the time it stays alive) the latencytracker is here for info, not when the bot is hanging. (For example I use it to dynamically change my sleep times in AIF) so I would say it's based on server lags due to lockstep.
       
    6. Synchro

      Synchro Member

      Joined:
      Mar 13, 2014
      Messages:
      70
      Likes Received:
      1
      Trophy Points:
      8
      Sry for being noob, but it works only as a fallback skill.
      Should i place it at some specific slot?
       
    7. snytru

      snytru Member

      Joined:
      Dec 21, 2012
      Messages:
      105
      Likes Received:
      0
      Trophy Points:
      16
      @Synchro
      No. That option is for something else related to build. Place skill in skill bar and it will auto summon.


      Heres the updated one for the lazy xD
       

      Attached Files:

    8. Synchro

      Synchro Member

      Joined:
      Mar 13, 2014
      Messages:
      70
      Likes Received:
      1
      Trophy Points:
      8
      still nothing

      [​IMG]
       
    9. PleXy

      PleXy New Member

      Joined:
      Dec 29, 2012
      Messages:
      17
      Likes Received:
      0
      Trophy Points:
      1
      Many thanks tozededao!

      Had some error messages with the attached file so I edited my own one - in case anyone has any probs with the previously posted one
      View attachment OldRoutine.cs
       
    10. Synchro

      Synchro Member

      Joined:
      Mar 13, 2014
      Messages:
      70
      Likes Received:
      1
      Trophy Points:
      8
      @Plexy
      thanks a lot, works great now
       
    11. kenjou

      kenjou New Member

      Joined:
      Oct 15, 2013
      Messages:
      140
      Likes Received:
      0
      Trophy Points:
      0
      could this be added to oldRoutine? I've been testing it for a while and it works fine.
       
    12. kenjou

      kenjou New Member

      Joined:
      Oct 15, 2013
      Messages:
      140
      Likes Received:
      0
      Trophy Points:
      0
      maybe one more suggestion:

      If there are no enemies in the combat range and the golem doesn't have full life, resummon it. Otherwise you could enter a fight with the golem at 1% life.
       
    13. d3vourm3nt

      d3vourm3nt Member

      Joined:
      May 5, 2014
      Messages:
      61
      Likes Received:
      0
      Trophy Points:
      6
      hey can someone update this idont how to put that code in oldroutine
       
    14. dbuddy2

      dbuddy2 New Member

      Joined:
      Mar 6, 2015
      Messages:
      206
      Likes Received:
      0
      Trophy Points:
      0
      not working for me :(
       
    15. UmitB

      UmitB Member

      Joined:
      Mar 13, 2014
      Messages:
      100
      Likes Received:
      8
      Trophy Points:
      18

      Attached Files:

      Last edited: Aug 17, 2015
    16. d3vourm3nt

      d3vourm3nt Member

      Joined:
      May 5, 2014
      Messages:
      61
      Likes Received:
      0
      Trophy Points:
      6
      thanks for the update
       
    17. oskylol

      oskylol New Member

      Joined:
      Nov 21, 2012
      Messages:
      23
      Likes Received:
      0
      Trophy Points:
      1
      working great ty
       
    18. thelover

      thelover New Member

      Joined:
      Jul 10, 2012
      Messages:
      42
      Likes Received:
      0
      Trophy Points:
      0
      my golem dies too fast, anyway for the bot to recast it?
       
    19. toNyx

      toNyx Well-Known Member

      Joined:
      Oct 29, 2011
      Messages:
      3,770
      Likes Received:
      35
      Trophy Points:
      48
      It should recast as soon as it dies, no?
       
    20. thelover

      thelover New Member

      Joined:
      Jul 10, 2012
      Messages:
      42
      Likes Received:
      0
      Trophy Points:
      0
      nope, unfortunately it doesn't :)
       

    Share This Page