• Visit Rebornbuddy
  • Visit Panda Profiles
  • Visit LLamamMagic
  • How to say 'if trickattack cooldown is more than 10 then use raiton' ?

    Discussion in 'Archives' started by fakeangels3, Dec 12, 2014.

    1. fakeangels3

      fakeangels3 New Member

      Joined:
      Jul 12, 2014
      Messages:
      19
      Likes Received:
      0
      Trophy Points:
      1
      or would it be easier to say if trick attack cooldown is less then 10 seconds then use suiton?

      Is there a simple way to add lines to CR?

      I really don't know how to do both. How do you make the CR check cooldown on other spell in general could point me to the right track.

      I really need help :( kupper CR kept using suiton over and over even when trick attack is on cooldown.

      Thank you very much.
       
      Last edited: Dec 12, 2014
    2. kaihaider

      kaihaider Community Developer

      Joined:
      May 18, 2010
      Messages:
      1,325
      Likes Received:
      5
      Trophy Points:
      38
      cooldown data: GetSpellData(spell).Cooldown.TotalMilliseconds
      spell being "Trick Attack" <- case senstive

      To get the correct spelldata, you should create your own method for getspelldata (instead of datamanager)
      Code:
      public static SpellData GetSpellData(string spell)
              {
                  SpellData data;
                  Actionmanager.CurrentActions.TryGetValue(spell, out data);
                  return data;
              }
      Just to warn you, the .Cooldown method is very slow. Like stupid insane wtf just happened to my rotation cause I'm using a few per tick slow.

      You should be able to just add bools to the rotation.

      However there are already three custom rotations which should handle ninjutsu very well. Instead of modifying kupo you could try them and leave a comment if you think anything about their rotation should be improved?

      edit: oh kupper not kupo. Can you please post a log of that in his thread? Hard to fix a bug if no one tells you about it :(
       
      Last edited: Dec 12, 2014
    3. mastahg

      mastahg Administrator Staff Member

      Joined:
      Feb 27, 2011
      Messages:
      5,327
      Likes Received:
      378
      Trophy Points:
      83
      What? I don't see how that can be slow unless your calling it a ton of times on another thread outside a framelock.
       
    4. kaihaider

      kaihaider Community Developer

      Joined:
      May 18, 2010
      Messages:
      1,325
      Likes Received:
      5
      Trophy Points:
      38
      it's a couple hundred ms per check. I'm guessing you're using some type of internal cache for it though? Since after a slow check, additional checks are quick for a short time frame and then have another spike of a couple hundred ms. Rinse and repeat.

      Hitting several of those long cooldown calls during a single tick at a bad time is way way too slow and will appear to freeze your rotation for a second. <-- pretty bad
       
    5. mastahg

      mastahg Administrator Staff Member

      Joined:
      Feb 27, 2011
      Messages:
      5,327
      Likes Received:
      378
      Trophy Points:
      83
      Nope. You must be doing something wrong.
       
    6. mastahg

      mastahg Administrator Staff Member

      Joined:
      Feb 27, 2011
      Messages:
      5,327
      Likes Received:
      378
      Trophy Points:
      83
      Code:
      ClearLog();
      Stopwatch stopwatch = new Stopwatch();
      stopwatch.Restart();
      int i = 0;
      using(Core.Memory.AcquireFrame(true))
      {
      foreach(var action in Actionmanager.CurrentActions.Values)
      {
      var stuff = action.Cooldown;
      i++;
      }
      }
      Log(i);
      Log(stopwatch.Elapsed);
      
      Code:
      13
      00:00:00.0047661
      
      vs...


      Code:
      ClearLog();
      Stopwatch stopwatch = new Stopwatch();
      stopwatch.Restart();
      int i = 0;
      foreach(var action in Actionmanager.CurrentActions.Values)
      {
      var stuff = action.Cooldown;
      i++;
      }
      Log(i);
      Log(stopwatch.Elapsed);
      
      
      Code:
      13
      00:00:00.4246534
      
      Like I said, if you are testing this outside a framelock; ie using the console you will get different results then if you used it inside a routine as everything inside routines/plugins is run on the main thread inside a framelock unless you do some stuff like making your own thread. Also the first results are higher then normal cause it needs to wait until a frame becomes available.
       
    7. kaihaider

      kaihaider Community Developer

      Joined:
      May 18, 2010
      Messages:
      1,325
      Likes Received:
      5
      Trophy Points:
      38
      well damn
       
      Last edited: Dec 13, 2014

    Share This Page