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

Implemented TaskScript should execute one task per loop

Discussion in 'Client & Site Suggestions' started by Aidden, Oct 9, 2014.

  1. Aidden

    Aidden Author of MaxiBots

    Joined:
    Dec 3, 2013
    Messages:
    6,482
    Likes Received:
    990
    I think the TaskScript framework should only execute a single task each loop. Once it finds a valid task it should perform execute and then return the loop. What does everyone else think? An example being, right now my monk killer tries to loot, fails the interaction and then moves on to attacking the next monk and this happens quite often which is clearly not very human like.
     
  2. Eagles13

    Eagles13 The only thing Alpha about me is my bots

    Joined:
    Sep 22, 2014
    Messages:
    618
    Likes Received:
    186
    Support. I've had issues with this too. However I'll probably be demolished by someone more experienced.
     
  3. Infinite Inferno

    Infinite Inferno The Pip Collector

    Joined:
    Sep 14, 2014
    Messages:
    445
    Likes Received:
    122
    You can add a condition within your Task so that it only proceeds to attack another monk if the loot item on the ground is not valid or the length == 0.
     
  4. Aidden

    Aidden Author of MaxiBots

    Joined:
    Dec 3, 2013
    Messages:
    6,482
    Likes Received:
    990
    While this is true, its not a good thing in my opinion. The whole point of dividing things up into tasks is to make each task focus on one thing. We shouldn't have to check that other tasks shouldn't be executing.
     
  5. Infinite Inferno

    Infinite Inferno The Pip Collector

    Joined:
    Sep 14, 2014
    Messages:
    445
    Likes Received:
    122
    Technically you are not checking whether another task is executing, you are writing a condition for a particular task that will only execute when those particular conditions are true. The way i see the Task Framework is basically a series of executions where you (the scripter) create a set of rules for each particular task which do not correlate or clash with other tasks.
     
  6. Arbiter

    Arbiter Mod Automation

    Joined:
    Jul 26, 2013
    Messages:
    2,937
    Likes Received:
    1,266
    I agree with OP. I can see multiple use cases in which the sequential order (or priority) of tasks is pivotal to its function and not returning to the top after an execution completely breaks it. @Cloud thoughts?
     
  7. Aidden

    Aidden Author of MaxiBots

    Joined:
    Dec 3, 2013
    Messages:
    6,482
    Likes Received:
    990
    It also currently goes against what you guys always say about each loop should only perform one action.
     
  8. Arbiter

    Arbiter Mod Automation

    Joined:
    Jul 26, 2013
    Messages:
    2,937
    Likes Received:
    1,266
    Very true. Sounds like an oversight in the framework to me.
     
  9. Cloud

    Cloud Engineer

    Joined:
    Jul 28, 2013
    Messages:
    2,777
    Likes Received:
    1,124
    Okay so here's how the framework will work in the next build. As most of you already know (or at least should), the task framework is built on a tree of tasks. This means that tasks can have children that are dependent on the parent tasks being validated.

    Initially only the top level tasks will be checked for validation. As soon as one is found to be valid, it will be executed. All other tasks that could be evaluated will then be ignored (one task per execution). After this the child tasks of the validated task will be evaluated. This cycle will continue recursively until there are no tasks remaining to be validated or none of the tasks are considered valid.

    In other words, TaskScript will attempt to follow a single branch of nodes out as far as possible, and as soon as it can't reach any further it will end the loop.
     
    Arbiter and Exia like this.
  10. Qosmiof2

    Qosmiof2 I've been called a god before.

    Joined:
    Aug 5, 2014
    Messages:
    3,212
    Likes Received:
    924
    I use this

    Code (Text):
    1.  
    2. for(Node node : nodeList) {
    3.     if(node.activate()){
    4.              node.execute();
    5.   }
    6.  
    7.  
    8. }
    9.  
    activate is a boolean.
    execute is a void.
     
  11. Cloud

    Cloud Engineer

    Joined:
    Jul 28, 2013
    Messages:
    2,777
    Likes Received:
    1,124
    Although a simple implementation like that would work for some people, the current TaskScript is a more powerful framework. It's a flexible tree, not just a list of tasks.
     
    Qosmiof2 likes this.
  12. Aidden

    Aidden Author of MaxiBots

    Joined:
    Dec 3, 2013
    Messages:
    6,482
    Likes Received:
    990
    Sounds good :)
     

Share This Page

Loading...