Request TaskScript#removeAll()

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

  1. Pure_

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

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

    Arbiter Mod Automation

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

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

    Arbiter Mod Automation

    Joined:
    Jul 26, 2013
    Messages:
    2,548
    Likes Received:
    1,066
    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 The better executive ;)

    Joined:
    Dec 3, 2013
    Messages:
    3,464
    Likes Received:
    712
    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...