1. This site uses cookies. By continuing to use this site, you are agreeing to our use of cookies. Learn More.

Question Tree bot with duplicate branches

Discussion in 'Developer Support' started by xEliqa, Jul 18, 2020.

  1. xEliqa

    Joined:
    May 13, 2020
    Messages:
    2
    Likes Received:
    0
    Hi, im new to bot writing but not knew to programming in general. I am trying to write a simple TreeBot but fleshing it out first on Draw.io to visual the branches and leafs. However i want to check if the inventory is full then later on down 2 more branches check if it is full again, since it will become full during one of the leafs actions. Would it be best practice to rearrange the logic to only include 1 inventory check only, or would having the same logic in a different class name be fine, or better yet a way to differentiate which check its looking for within the same class.

    I feel like im being dumb with this one, but can't work it out for the sake of me.
     
  2. Chieftain

    Chieftain The only AI bot developer

    Joined:
    Mar 26, 2016
    Messages:
    166
    Likes Received:
    43
    Join the RuneMate developer slack channel. I can not really make out,what you are saying. So i will have to guess. You would typically have one branch that validates whether your inventory is full. When your tree reaches a leaf node, it will loop again to the root node. So It is irrelevant that your inventory will become full during a leaf action.
     
  3. xEliqa

    Joined:
    May 13, 2020
    Messages:
    2
    Likes Received:
    0
    Perfect, I kinda figured it out by going back through my logic and realised that. I will join the slack though. Cheers
     

Share This Page

Loading...