• Visit Rebornbuddy
  • Visit Panda Profiles
  • Visit LLamamMagic
  • ScriptManager.GetCondition is hanging

    Discussion in 'Community Developer Forum' started by iyake, Jul 20, 2015.

    1. iyake

      iyake Member

      Joined:
      Oct 19, 2014
      Messages:
      143
      Likes Received:
      5
      Trophy Points:
      18
      Tried this in reborn console (also hanging in a compiled botbase):

      Code:
      ScriptManager.GetCondition("False");
       
    2. Cloud30000

      Cloud30000 New Member

      Joined:
      May 9, 2015
      Messages:
      298
      Likes Received:
      7
      Trophy Points:
      0
      You are checking a string; does GetCondition allow a bool?
       
    3. mastahg

      mastahg Administrator Staff Member

      Joined:
      Feb 27, 2011
      Messages:
      5,343
      Likes Received:
      383
      Trophy Points:
      83
      Not sure what your trying to do but the ScriptManager.GetCondition returns a func<bool> so calling it like that will do nothing. Also I get the feeling that that class should probally be internal as it was something from our bot toolkit.
       
    4. iyake

      iyake Member

      Joined:
      Oct 19, 2014
      Messages:
      143
      Likes Received:
      5
      Trophy Points:
      18
      The update today seems to have resolved it. Here's what I was trying to do:

      Code:
      var condition = "Core.Player.CurrentGPPercent > 90.0";
      if (ScriptManager.GetCondition(condition))()) {
          ...
      }
      
      where condition would be user supplied.

      If GetCondition isn't supposed to be exposed, is there another way short of parsing the string to do it?
       
      Last edited: Jul 21, 2015
    5. mastahg

      mastahg Administrator Staff Member

      Joined:
      Feb 27, 2011
      Messages:
      5,343
      Likes Received:
      383
      Trophy Points:
      83
      What are you doing that requires you to parse a string?
       
    6. iyake

      iyake Member

      Joined:
      Oct 19, 2014
      Messages:
      143
      Likes Received:
      5
      Trophy Points:
      18
      a fish tag that uses patience when a condition is true, specifically

      Code:
      IsTimeBetween(8,12) and Core.Player.CurrentGPPercent > 90.0
      
      but it's different for each fish -- some might have weather instead of a time frame for example.
       
    7. mastahg

      mastahg Administrator Staff Member

      Joined:
      Feb 27, 2011
      Messages:
      5,343
      Likes Received:
      383
      Trophy Points:
      83
      Yea that's probably one of the better ways to handle that. I was thinking about adding something similar for gatheringskills.

      If you want to test it in the console you'll need to start+stop orderbot at least once so that itll initialize the scriptmananger otherwise you'll get the lockup as its waiting for initialization.

      I had recently started on my own version of a fishing tag for orderbot as I was displeased with how predictable fishbot's behavior is. I've only got the movement logic completed as I wanted to make it much more random in its behavior ie randomized facing angles within a given range, and not standing in the exact same spot each time. Since im working on opensourcing all the included orderbot tags ill hold off on doing anymore work on my version since it seems your a good bit further ahead then we can see about including yours with the distribution of rb.
       
    8. iyake

      iyake Member

      Joined:
      Oct 19, 2014
      Messages:
      143
      Likes Received:
      5
      Trophy Points:
      18
      Oh, that explains why it was locking up in a botbase too. Is there a way to manually initialize it for use in a botbase? I see an exposed init method.
       
    9. mastahg

      mastahg Administrator Staff Member

      Joined:
      Feb 27, 2011
      Messages:
      5,343
      Likes Received:
      383
      Trophy Points:
      83
      ConditionParser.Initalize();
       
    10. y2krazy

      y2krazy Community Developer

      Joined:
      Jun 21, 2011
      Messages:
      2,803
      Likes Received:
      70
      Trophy Points:
      48
      Not sure if having 4+ people (mastahg, iyake, ExMatt, oruna) working on a Fish tag is the most efficient way of getting things done, but here's ExMatt's latest Fish tag if either or both of you want to reach out to him for collaboration (download link found in the link to his post below):

      Reference: https://www.thebuddyforum.com/rebornbuddy-forum/rebornbuddy-profiles/207271-fishing-ultimate-fishing-profiles-leveling-farming-grinding-15.html#post2007254
       

    Share This Page