• Visit Rebornbuddy
  • BuddyTor.Me.CurrentTarget Issue

    Discussion in 'Community Developer Forum' started by wbulot, Dec 19, 2015.

    1. wbulot

      wbulot New Member

      Joined:
      Sep 20, 2014
      Messages:
      24
      Likes Received:
      0
      Trophy Points:
      0
      Hello,

      I'm using a personal plugin who cast spell for me and it seems that there is some problems with BuddyTor.Me.CurrentTarget.
      Indeed, often the value is null, while I really have a target.

      It happen a lot in PvP (But in PVE as well). Maybe 1 in 10 target is not recognise as a target.
      Is it a known issue ? Is there a dirty fix or something ?

      Thank you.
       
    2. pindleskin

      pindleskin Community Developer

      Joined:
      Oct 24, 2012
      Messages:
      1,124
      Likes Received:
      2
      Trophy Points:
      38
      You can send me the code and tell me what you are trying to do
       
    3. wbulot

      wbulot New Member

      Joined:
      Sep 20, 2014
      Messages:
      24
      Likes Received:
      0
      Trophy Points:
      0
      Here is my plugin : http://pastebin.com/tJum6Lt3

      I register an Hotkey and I execute some code to cast spell when I press the hotKey.
      Everything works fine but in PVP, some targets are not recognise. Maybe 5 or 10% of the time. Don't know why.

      When I say not recognise, I mean BuddyTor.Me.CurrentTarget return null.
      So obviously in this case, the spells are not cast.

      Thx for your help.
       
    4. Teo

      Teo Member

      Joined:
      Oct 6, 2012
      Messages:
      35
      Likes Received:
      1
      Trophy Points:
      8
      Might be a sync issue. Maybe wrapping all the code in Routine between an AcquireFrame could help.
       
    5. wbulot

      wbulot New Member

      Joined:
      Sep 20, 2014
      Messages:
      24
      Likes Received:
      0
      Trophy Points:
      0
      Is it simple to do ?
      Can you show me an example ?
       
    6. Teo

      Teo Member

      Joined:
      Oct 6, 2012
      Messages:
      35
      Likes Received:
      1
      Trophy Points:
      8
      Code:
      private static void Routine()
      {
      	using (BuddyTor.Memory.AcquireFrame())
      	{
      		BuddyTor.Update();
      		BuddyTor.Me.SetTarget(BuddyTor.Me.CurrentTarget);
      		//The rest of the code from Routine....
      	}
      }
      
       
    7. wbulot

      wbulot New Member

      Joined:
      Sep 20, 2014
      Messages:
      24
      Likes Received:
      0
      Trophy Points:
      0
      I will try thx
       

    Share This Page