• Visit Rebornbuddy
  • Visit Panda Profiles
  • Visit LLamamMagic
  • How to get number of uses for traps?

    Discussion in 'Archives' started by baal887, Oct 28, 2013.

    1. baal887

      baal887 New Member

      Joined:
      Oct 13, 2013
      Messages:
      13
      Likes Received:
      0
      Trophy Points:
      1
      I see Loki.Game.Spell.UsesAvailable but how would I call it with, say, bear trap?
       
    2. baal887

      baal887 New Member

      Joined:
      Oct 13, 2013
      Messages:
      13
      Likes Received:
      0
      Trophy Points:
      1
      Actually, I think .UsesAvailable does not even work with traps because I have my code set up like this:
      Code:
      
       int FTS = SpellManager.GetSpell("Fire Trap").UsesAvailable;
                  int LTS = SpellManager.GetSpell("Lightning Trap").UsesAvailable;
      
      
                  if (LTS > 0)
                  {
                      return Cast("Lightning Trap",
                      ret =>
                          {
                              Monster monster = MainTarget;
                              return monster != null;
                          });
                  }
      
                  if (FTS > 0)
                  {
                      return Cast("Fire Trap",
                          ret =>
                          {
                              Monster monster = MainTarget;
                              return monster != null;
                          });
                  }
      
      and it is never casting fire trap
       
    3. toNyx

      toNyx Well-Known Member

      Joined:
      Oct 29, 2011
      Messages:
      3,770
      Likes Received:
      35
      Trophy Points:
      48
      Iirc, there's a player settings called "MaxNumberOfTraps" or something check in the tools section of the bot, and retrieve player data, check for options.
       
    4. baal887

      baal887 New Member

      Joined:
      Oct 13, 2013
      Messages:
      13
      Likes Received:
      0
      Trophy Points:
      1
      That has absolutely nothing to do with what I am trying to do but thank you for that information, it would be useful if Spell.UsesAvailable actually worked.

      EDIT: After debugging and looking at the actual values of these...this function just spits out a random number in the 300s. I get anywhere from 306 - 350 and it doesn't even seem to care how many charges I actually have it is just broken. It also seems that Fire Trap and Bear Trap always show the same number of charges while Lightning Trap is a completely different number. It would be awesome if this was fixed because I could release a working trap combat routine.
       

    Share This Page