Complete Task Action Does Not Work?

Post Reply
nw_sony
Advanced Member
Advanced Member
Posts: 33
Joined: Tue Jun 21, 2016 6:21 am

Complete Task Action Does Not Work?

Post by nw_sony »

I'm currently looking for a way to speed up the process of doing professions. "Start A Task" is great for spending Morale, but it takes too long. I'm not sure Astral is even able to process a full account (2 Morale per Task) within 24 hours during a 2x Professions event to be honest. Manually it takes me 2-5 minutes per character, depending on the Artisans, approach etc.

I tried the "Complete Task" action, but either I can't figure out what it's supposed to do or is entirely broken. It does at least not complete a running task with morale.
CJIoHuKu
Advanced Member
Advanced Member
Posts: 35
Joined: Sun Mar 28, 2021 2:56 am

Re: Complete Task Action Does Not Work?

Post by CJIoHuKu »

I quit spending morale. It does not bring enough coin to bother. Just catch instant and fast crafters set Craft as many and gather result using the Stone. Too much time wasted.
nw_sony
Advanced Member
Advanced Member
Posts: 33
Joined: Tue Jun 21, 2016 6:21 am

Re: Complete Task Action Does Not Work?

Post by nw_sony »

In case anyone is interested. I've built my own Action around

code: Select all

MyNW.Internals.GameCommands.Execute("Itemassignmentscompletenowbyid " + Assignment.ID);
It works like a charm and you can power through 400 Morale within seconds, even at Double Professions.

Full Code:

code: Select all

using Astral.Logic.Classes.Map;
using MyNW.Classes;
using System.ComponentModel;
using System.Drawing.Design;
using Astral.Professions.Forms;

namespace /* [your namespace] */
{
    public class RushTask : Astral.Quester.Classes.Action
    {
        public RushTask() {
            var task = new Astral.Professions.Classes.Task();
            Task = task;
        }

        [Editor(typeof(TasksEditor), typeof(DevExpress.XtraEditors.XtraForm))]
        public Astral.Professions.Classes.Task Task { get; set; }

        public override string ActionLabel => "RushTask: " + Task.DisplayName;

        public override string Category => "Tasks";

        public override bool NeedToRun => true;

        public override string InternalDisplayName => "RushTask";

        public override bool UseHotSpots => false;

        protected override bool IntenalConditions => true;

        protected override Vector3 InternalDestination => MyNW.Classes.Vector3.Empty;

        protected override ActionValidity InternalValidity => new Astral.Quester.Classes.Action.ActionValidity();

        public override void GatherInfos()
        {
            Task = Astral.Professions.Forms.TasksEditor.Show();
        }

        public override void InternalReset()
        {
        }

        public override void OnMapDraw(GraphicsNW graph)
        {
        }

        public override ActionResult Run()
        {
            foreach (var Assignment in Astral.Logic.NW.Professions2.CurrentOrders)
            {
                if (Assignment.Def.InternalName == Task.InternalName) {
                    MyNW.Internals.GameCommands.Execute("Itemassignmentscompletenowbyid " + Assignment.ID);
                }
            }

            return Astral.Quester.Classes.Action.ActionResult.Completed;
        }
    }
}
Bringing up the TasksEditor to edit the Task doesn't work for me (see viewtopic.php?f=116&t=8763), but you can set it once when adding the Action.
michaelprog
Contributor
Contributor
Posts: 526
Joined: Wed Aug 31, 2016 7:32 am

Re: Complete Task Action Does Not Work?

Post by michaelprog »

You are right. The middsummer-product are invisible to CompleteATask and conditions.

However you can collect all products from delivery-box by clicking button "CollectAll".
This can be emulated by ingame command.
I do this in my profile
michaelprog
Contributor
Contributor
Posts: 526
Joined: Wed Aug 31, 2016 7:32 am

Re: Complete Task Action Does Not Work?

Post by michaelprog »

CollectAllTasks from my profile.
I use action ConsoleCommand from QuesterAssistant plugin

code: Select all

<?xml version="1.0"?>
<ActionPack xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
  <ActionID>5ff374d8-54f9-463b-9634-bcd8b707734f</ActionID>
  <OverrideName>CollectAllTasks</OverrideName>
  <Sound>
    <SoundName />
    <Trigger>OnActionCompleted</Trigger>
  </Sound>
  <Disabled>false</Disabled>
  <PlayWhileConditionsAreOk>false</PlayWhileConditionsAreOk>
  <PlayWhileUnSuccess>true</PlayWhileUnSuccess>
  <AssociateMission />
  <Loop>false</Loop>
  <MaxRunningTime>0</MaxRunningTime>
  <OnlyOneConditionMustBeGood>false</OnlyOneConditionMustBeGood>
  <OnlyDoneByServer>false</OnlyDoneByServer>
  <Conditions>
    <Condition xsi:type="CurrentMap">
      <Locked>false</Locked>
      <Tested>Equal</Tested>
      <MapName>M15_Professions_Workshop</MapName>
    </Condition>
    <Condition xsi:type="FreeOrderSlots">
      <Locked>false</Locked>
      <Sign>Equal</Sign>
      <Value>3</Value>
    </Condition>
    <Condition xsi:type="FreeGatherSlots">
      <Locked>false</Locked>
      <Sign>Equal</Sign>
      <Value>3</Value>
    </Condition>
    <Condition xsi:type="FreeTasksSlots">
      <Locked>false</Locked>
      <Sign>Superior</Sign>
      <Value>10</Value>
    </Condition>
  </Conditions>
  <HotSpots />
  <Actions>
    <Action xsi:type="InteractSpecificNPC">
      <ActionID>86d7f62e-0a83-4995-820a-17bdbf699709</ActionID>
      <OverrideName />
      <Sound>
        <SoundName />
        <Trigger>OnActionCompleted</Trigger>
      </Sound>
      <Disabled>false</Disabled>
      <PlayWhileConditionsAreOk>false</PlayWhileConditionsAreOk>
      <PlayWhileUnSuccess>true</PlayWhileUnSuccess>
      <AssociateMission />
      <Loop>false</Loop>
      <MaxRunningTime>0</MaxRunningTime>
      <OnlyOneConditionMustBeGood>false</OnlyOneConditionMustBeGood>
      <OnlyDoneByServer>false</OnlyDoneByServer>
      <Conditions />
      <HotSpots />
      <NPCCostume />
      <Dialogs />
      <DisplayName>Контейнер</DisplayName>
      <Position>
        <X>33.93457</X>
        <Y>-53.25415</Y>
        <Z>4.078369</Z>
      </Position>
      <InteractTime>2000</InteractTime>
      <Tolerance>1</Tolerance>
      <NPCUntranslatedName>Maps_Neverwinter_City_M15_Professions_Workshop_Content.Deliverybox_Actor_1_Displayname.Deliverybox</NPCUntranslatedName>
    </Action>
    <Action xsi:type="ConsoleCommand">
      <ActionID>2f368a20-01a8-4081-93f4-54f5116a7266</ActionID>
      <OverrideName />
      <Sound>
        <SoundName />
        <Trigger>OnActionCompleted</Trigger>
      </Sound>
      <Disabled>false</Disabled>
      <PlayWhileConditionsAreOk>false</PlayWhileConditionsAreOk>
      <PlayWhileUnSuccess>true</PlayWhileUnSuccess>
      <AssociateMission />
      <Loop>false</Loop>
      <MaxRunningTime>0</MaxRunningTime>
      <OnlyOneConditionMustBeGood>false</OnlyOneConditionMustBeGood>
      <OnlyDoneByServer>false</OnlyDoneByServer>
      <Conditions />
      <HotSpots />
      <GameCommand>GenButtonClick Deliverybox_Collectallbutton</GameCommand>
    </Action>
  </Actions>
  <SimultaneousActions>false</SimultaneousActions>
  <AsynchronousMode>false</AsynchronousMode>
  <BotsAssignment>
    <Server>true</Server>
    <Client1>true</Client1>
    <Client2>true</Client2>
    <Client3>true</Client3>
    <Client4>true</Client4>
  </BotsAssignment>
</ActionPack>
nw_sony
Advanced Member
Advanced Member
Posts: 33
Joined: Tue Jun 21, 2016 6:21 am

Re: Complete Task Action Does Not Work?

Post by nw_sony »

michaelprog wrote: Tue Sep 14, 2021 5:41 pm CollectAllTasks from my profile.
I use action ConsoleCommand from QuesterAssistant plugin

code: Select all


  5ff374d8-54f9-463b-9634-bcd8b707734f
  CollectAllTasks
  
    
    OnActionCompleted
  
  false
  false
  true
  
  false
  0
  false
  false
  
    
      false
      Equal
      M15_Professions_Workshop
    
    
      false
      Equal
      3
    
    
      false
      Equal
      3
    
    
      false
      Superior
      10
    
  
  
  
    
      86d7f62e-0a83-4995-820a-17bdbf699709
      
      
        
        OnActionCompleted
      
      false
      false
      true
      
      false
      0
      false
      false
      
      
      
      
      Контейнер
      
        33.93457
        -53.25415
        4.078369
      
      2000
      1
      Maps_Neverwinter_City_M15_Professions_Workshop_Content.Deliverybox_Actor_1_Displayname.Deliverybox
    
    
      2f368a20-01a8-4081-93f4-54f5116a7266
      
      
        
        OnActionCompleted
      
      false
      false
      true
      
      false
      0
      false
      false
      
      
      GenButtonClick Deliverybox_Collectallbutton
    
  
  false
  false
  
    true
    true
    true
    true
    true
  
Thanks! Appreciated!
Post Reply