• Visit Rebornbuddy
  • Question about Getting Companion name

    Discussion in 'Community Developer Forum' started by Cryogenesis, Nov 10, 2013.

    1. Cryogenesis

      Cryogenesis Moderator Moderator

      Joined:
      Jul 13, 2010
      Messages:
      2,128
      Likes Received:
      13
      Trophy Points:
      38
      Question about Getting Companion name [+Answer]


      Answer Edit:
      So i figured it out. If you want to do something based upon what companion you currently have, you need to use the following code:
      Code:
      <If Condition="BuddyTor.Me.Companion.Name.Contains(&quot;Aric&quot;)">
             <UserDialog Title="ME" Message="Aric Jorgan it is" /> <!-- Change this line to whatever needs to be done -->
      </If> 
      
      For all companions see Attachments.

      BUT, do not call the same If condition with the companion name twice in a row!!!
      At least put a moveto between them, else the bot will go bonkers and wont continue your profile:
      So example
      If Condition for checking Companion (Can be all of them in a row like in the Attachment),
      Then when done, move or do something else
      then if condition for checking companion... and so on...
       

      Attached Files:

      Last edited: Jun 21, 2014
    2. Cryogenesis

      Cryogenesis Moderator Moderator

      Joined:
      Jul 13, 2010
      Messages:
      2,128
      Likes Received:
      13
      Trophy Points:
      38
      Nobody who can shet some light on this?
      I find the code thow in routines but i need a working line for profiles...
       
    3. Cryogenesis

      Cryogenesis Moderator Moderator

      Joined:
      Jul 13, 2010
      Messages:
      2,128
      Likes Received:
      13
      Trophy Points:
      38
      Still no reaction... :(
      Another question then, is it possible to get the specialisation of the char?
      For instance Jedi Consular Sage or Shadow?
       
    4. walter

      walter Active Member

      Joined:
      Jun 25, 2012
      Messages:
      1,112
      Likes Received:
      10
      Trophy Points:
      38
      I will get back to you with some answers when I get back home tonight. Just long day since new drug is up for FDA submission.


      Walter
       
    5. Cryogenesis

      Cryogenesis Moderator Moderator

      Joined:
      Jul 13, 2010
      Messages:
      2,128
      Likes Received:
      13
      Trophy Points:
      38
      Thanks for your help in advance mate!
       
    6. Cryogenesis

      Cryogenesis Moderator Moderator

      Joined:
      Jul 13, 2010
      Messages:
      2,128
      Likes Received:
      13
      Trophy Points:
      38
      Hey walter,

      If your looking into it, can you also check for the character spec, lets say knight sentinel or guardian?
       
    7. Cryogenesis

      Cryogenesis Moderator Moderator

      Joined:
      Jul 13, 2010
      Messages:
      2,128
      Likes Received:
      13
      Trophy Points:
      38
      So Spec i found:
      Code:
               <If Condition="(Me.AdvancedClass == AdvancedClass.Sage)">
               </If>
               <If Condition="(Me.Class == CharacterClass.Consular)">
               </If>
      
      I Still need a check for Companion name...
      Any findings on this Walter (or anyone else)?
       
    8. Cryogenesis

      Cryogenesis Moderator Moderator

      Joined:
      Jul 13, 2010
      Messages:
      2,128
      Likes Received:
      13
      Trophy Points:
      38
      Any news maybe on this topic?
      I find 2 parts, Me.Companion and .Name.Contain("")
      So i thought this should work: Me.Companion.Name.Contain("Kira")
      But that doesnt work in profiles because the " before Kira ends the If condition.
      I think this coding should work on CR level but not on profile level.
      Any other way i can code this line?

      It is the last problem im having besides Useobject and UseItem.
       
    9. Cryogenesis

      Cryogenesis Moderator Moderator

      Joined:
      Jul 13, 2010
      Messages:
      2,128
      Likes Received:
      13
      Trophy Points:
      38
      Ok so i got the code working... partially

      i got the following in a profile:
      Code:
      <Profile xmlns="http://tempuri.org/ProfileSchema.xsd">
        <Name>Companion test</Name>
      
      
      	<Questing>
      
      		<If Condition="BuddyTor.Me.Companion.Name == &quot;T7-O1&quot;">
      			<UserDialog Title="ME" Message="T7 it is" />
      		</If> 
      		<If Condition="BuddyTor.Me.Companion.Name == &quot;C2-N2&quot;">
      			<UserDialog Title="ME" Message="C2-N2" />
      		</If> 
      <UserDialog Title="ME" Message="Failed" />
      
      	</Questing>    
      
      </Profile>
      
      Now when i first tried, it worked and i got this:
      Code:
      [19:59:57.504 N] Current bot set to Quest Bot
      [19:59:57.504 N] Loaded profile Companion test
      [19:59:58.794 D] Start/Stop Button Clicked!
      [19:59:58.794 D] BotMain.Start() called
      [19:59:58.794 D] Forcing profile reload. -- Temporary fix for behavior cache issues during start/stop.
      [19:59:58.909 N] Current bot set to Quest Bot
      [19:59:58.910 N] Loaded profile Companion test
      [19:59:58.910 D] Starting bot Quest Bot
      [19:59:58.910 D] Added new hook [RepopCorpse] 0bbd8e02-ccac-44a1-bfe0-f0292a79627c
      [19:59:58.910 D] Added new hook [RoutineCombat] 94b85326-2117-40e6-9303-fadd16a2034e
      [19:59:58.910 D] Added new hook [HotspotPoi] 0765ded8-cfdd-4e8e-a65c-a7179c681866
      [19:59:58.910 D] Added new hook [SellVendorPoi] 451f5cf9-579a-4c27-96fa-d635e4ff62cc
      [19:59:58.910 D] Added new hook [SetLootPoi] 603de494-ed04-4103-a416-303eff7b5775
      [19:59:58.910 D] Added new hook [SetCombatPoi] 78836df6-2928-49b9-a18d-c2a6ff6a76a4
      [19:59:58.910 D] Added new hook [SetVendorPoi] 4e857efa-0a63-449c-a0b4-7fd3fee06e76
      [19:59:58.910 D] Added new hook [SetHotspotPoi] 865ec80a-b40e-4ab1-9ad2-5b4439ed50ea
      [19:59:58.910 D] Added new hook [SelectPoiType] f97f82f9-58f5-4259-ba22-5daf11517b75
      [19:59:58.910 D] Replaced hook [SelectPoiType] 5b20be72-6f21-47c0-8b1f-ce33da3b7da7
      [19:59:58.910 D] Spooling up bot thread.
      [19:59:58.910 D] Bot thread started.
      [20:00:02.879 V] [Poi.Clear] Reason: Current quest behavior changed to UserDialogTag: DialogFinished: True, DialogMessage: T7 it is, DialogTitle: ME, QuestId: 0, BranchId: 0, StepId: 0, TaskId: 0, QuestName: Quest Id: 0, IsDoneCache: True, Behavior: null, .
      [20:00:02.880 D] Replaced hook [QuestProfileBehavior_Hook] 132f9a49-d0bf-4774-a149-d35d6687d868
      [20:00:04.452 V] [Poi.Clear] Reason: Current quest behavior changed to UserDialogTag: DialogFinished: True, DialogMessage: Failed, DialogTitle: ME, QuestId: 0, BranchId: 0, StepId: 0, TaskId: 0, QuestName: Quest Id: 0, IsDoneCache: True, Behavior: null, .
      [20:00:04.452 D] Replaced hook [QuestProfileBehavior_Hook] 995f4fef-1a75-4b53-9a52-1fe556c1551b
      [20:00:04.452 V] [Poi.Clear] Reason: Profile completed.
      
      But then i switched from T7-O1 to C2-N2 or Kira Carsen and i get these errors:
      Code:
      [20:00:42.215 D] BotMain.Start() called
      [20:00:42.215 D] Forcing profile reload. -- Temporary fix for behavior cache issues during start/stop.
      [20:00:42.333 N] Current bot set to Quest Bot
      [20:00:42.334 N] Loaded profile Companion test
      [20:00:42.334 D] Starting bot Quest Bot
      [20:00:42.334 D] Added new hook [RepopCorpse] aeef81a5-1012-4219-afae-43bf4f3a5c08
      [20:00:42.334 D] Added new hook [RoutineCombat] 94b85326-2117-40e6-9303-fadd16a2034e
      [20:00:42.334 D] Added new hook [HotspotPoi] aed3700d-b6fb-4be8-83d5-c519191d1851
      [20:00:42.334 D] Added new hook [SellVendorPoi] 0fc24435-22cc-42b9-b767-f39ac13bdca8
      [20:00:42.334 D] Added new hook [SetLootPoi] d00a6eb8-5a7f-4f4e-b115-d135c9674ec9
      [20:00:42.334 D] Added new hook [SetCombatPoi] 2084c505-2740-42ed-9048-d790f72d5938
      [20:00:42.334 D] Added new hook [SetVendorPoi] d4712097-bbbc-4340-8930-f4137efb4d78
      [20:00:42.334 D] Added new hook [SetHotspotPoi] 3027a601-ed37-4707-a335-08ea70eec41e
      [20:00:42.334 D] Added new hook [SelectPoiType] 8c1b884e-429b-4380-9086-203c744e5093
      [20:00:42.334 D] Replaced hook [SelectPoiType] 3d67af60-c967-4348-81f6-02b99f4de119
      [20:00:42.334 D] Spooling up bot thread.
      [20:00:42.334 D] Bot thread started.
      [20:00:42.351 D] Traceback (most recent call last):
        File "<string>", line 3, in Execute
      AttributeError: 'NoneType' object has no attribute 'Name'
      [20:00:42.351 D] BotMain.Stop() called
      [20:00:42.351 N] Reason: 
      [20:00:42.453 D] Sleeping while waiting on execution state to be available for BotMain.Stop()
      [20:00:44.456 D] We slept way too long waiting for the bot thread to give control back. Aborting thread. Client may crash!
      [20:00:44.457 D] Exception during scheduling Pulse: System.MissingMemberException: 'NoneType' object has no attribute 'Name'
         bij Microsoft.Scripting.Interpreter.ThrowInstruction.Run(InterpretedFrame frame)
         bij Microsoft.Scripting.Interpreter.Interpreter.Run(InterpretedFrame frame)
         bij Microsoft.Scripting.Interpreter.LightLambda.Run3[T0,T1,T2,TRet](T0 arg0, T1 arg1, T2 arg2)
         bij System.Dynamic.UpdateDelegates.UpdateAndExecute2[T0,T1,TRet](CallSite site, T0 arg0, T1 arg1)
         bij Microsoft.Scripting.Interpreter.DynamicInstruction`3.Run(InterpretedFrame frame)
         bij Microsoft.Scripting.Interpreter.Interpreter.Run(InterpretedFrame frame)
         bij Microsoft.Scripting.Interpreter.LightLambda.Run1[T0,TRet](T0 arg0)
         bij IronPython.Compiler.PythonCallTargets.OriginalCallTarget0(PythonFunction function)
         bij System.Dynamic.UpdateDelegates.UpdateAndExecute1[T0,TRet](CallSite site, T0 arg0)
         bij _Scripting_(Object[] )
         bij Buddy.CommonBot.Profile.Quest.Composites.IfTag.GetConditionExec()
         bij Buddy.CommonBot.Profile.Quest.Composites.IfTag.get_IsDone()
         bij Buddy.CommonBot.Profile.ProfileBehavior.get_IsDoneCache()
         bij Buddy.CommonBot.QuestOrderManager.(IEnumerable`1 )
         bij Buddy.CommonBot.QuestOrderManager.UpdateCurrentBehavior()
         bij Buddy.CommonBot.ProfileManager.UpdateCurrentQuestBehavior()
         bij Buddy.CommonBot.Logic.BuddyQuestBot.(Object , EventArgs )
         bij System.EventHandler.Invoke(Object sender, EventArgs e)
         bij Buddy.CommonBot.Logic.BrainBehavior.()
      
      I then switched back to T7-O1 and i still get the same error. A reboot of the game and bot works for just one time and then the error kicks in.

      Am i doing something wrong?
       
    10. Cryogenesis

      Cryogenesis Moderator Moderator

      Joined:
      Jul 13, 2010
      Messages:
      2,128
      Likes Received:
      13
      Trophy Points:
      38
      Any devs around, who knows what causes this?
       
    11. Cryogenesis

      Cryogenesis Moderator Moderator

      Joined:
      Jul 13, 2010
      Messages:
      2,128
      Likes Received:
      13
      Trophy Points:
      38
      Ok so i figured something out, but dont know if its the cure to the problem,
      But as long as you do something between the second companion check, then its working...
       

    Share This Page