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

Request TaskScript#removeAll()

Discussion in 'Client & Site Suggestions' started by Pure_, Jun 26, 2016.

  1. Pure_

    Joined:
    Apr 22, 2016
    Messages:
    13
    Likes Received:
    6
    Syntactic sugar for:

    for (Task t : getTasks())
    remove(t);
     
  2. Arbiter

    Arbiter Mod Automation

    Joined:
    Jul 26, 2013
    Messages:
    2,938
    Likes Received:
    1,266
    @Cloud how about going all the way and making TaskScript implement Collection?
     
  3. Cloud

    Cloud Engineer

    Joined:
    Jul 28, 2013
    Messages:
    2,777
    Likes Received:
    1,124
    In what use case would you want to do this?
     
  4. Arbiter

    Arbiter Mod Automation

    Joined:
    Jul 26, 2013
    Messages:
    2,938
    Likes Received:
    1,266
    Changing what the bot does at runtime, i.e. without requiring a bot restart. For example, user schedules 1000 bronze bars and then 1000 iron bars. Bot Author implements this by removing active task(s) for bronze and adding a new set for iron.
     
  5. Aidden

    Aidden Author of MaxiBots

    Joined:
    Dec 3, 2013
    Messages:
    6,606
    Likes Received:
    990
    I make use of this in my new framework actually. Each activity ie chop 50 logs, chop until level 60 etc holds its own tasks and adds them to the taskscript. Once the activity is complete the tasks are removed and the next activity tasks are added.
    --- Double Post Merged, Jun 29, 2016, Original Post Date: Jun 29, 2016 ---
    However i will add that the remove method uses varargs so an array of tasks can be removed
     

Share This Page

Loading...