[UO][EC] Actions>Commands: Agents: Executing Organizers

[UO][EC] Action>Commands: Agents: Executing Organizers

Is there a way to execute an organizer with a macro? That question has been asked many times over the years. The answer is yes. What follows are the Actions>Commands necessary to execute an organizer and the steps you will need to use to get the process to work correctly, along with a few examples.

--

First, let’s understand the process of executing an organizer.

1.      There must be an organizer.

2.      That organizer must have a destination container.

3.      The destination container must be registered with the server. This means either the destination container must be open, or the container containing the destination container must be open. (The sever needs to know where the container is and what’s in it.)

4.      The originating container (the container from which the organizer will be run) must be registered with the server (must be open). (Again, the sever needs to know where the container is and what’s in it.)

5.      The organizer must be selected.

6.      The originating container must be identified. (Many containers exist, which one would you like to execute the organizer on?)

7.      The destination container must be identified. (Organizer directs destination to which container?)

8.      The organizer must be executed.

Eight pieces to Ultima magic, just as it’s always been.

--

Ok, so that is the process. Now, how does one work through that process?

Step 1 and 2 you probably know how to do. However, if you need help building an organizer, ask in the forums or in chat. Organizers can be quite specialized and other players might have helpful input.

Action>Commands will be used to complete steps 3-8.

            3. objectID with HandleSingleLeftClick will open the destination container.

script HandleSingleLeftClkTarget(objectID)
            4. objectID with HandleSingleLeftClick will open the originating container.
script HandleSingleLeftClkTarget(objectID)
            5. Organizer.ActiveOrganizer will direct select the desired organizer.
script Organizer.ActiveOrganizer = Z
            6. objectID and .OrganizeParent will define the originating container.
script ContainerWindow.OrganizeParent = objectID
            7. .OrganizeBag will define the destination container.
script ContainerWindow.OrganizeBag = Organizer.Organizers_Cont[Organizer.ActiveOrganizer]
            8. .Organize will execute the agent.
script ContainerWindow.Organize = true

 

Those are the Action>Commands necessary to execute an organizer.

 

In some cases, Step 4 and Step 6, defining the originating container, can be done from the target window instead of by objectID. For instance, if you have a reward bag from Percolem or Grizelda, and you just want to pull the loot and toss the bag.

For these situations:
            4. Target By Type will open the originating container. You will need to Target By Type a bag (or backpack, whatever) when creating the macro, and not have any other bags in your main backpack. This way, when the macro runs, just the reward bag will be targeted and placed in the targeting window.

Target By Type

           6. .TargetId and .OrganizeParent will define the originating container (the reward bag).

script ContainerWindow.OrganizeParent = TargetWindow.TargetId

 

Next, let’s build some example macros to demonstrate how to put all this information together.

--

The simplest example:

You want to move gold from your main backpack to a chest. You want to manually open your main backpack and the chest, and you want to manually select the organizer from the organizer list.

 

Create your organizer for Gold and set the destination container (must be open) as the chest.

Obtain the objectID for your main pack. (Your main backpack’s objectID can also be found in the General Settings section of the Character File.)
Main backpack                        11115555                   

 

In this example, where you have completed most of the steps yourself, the macro will be three lines. Each line is input via Action>Other>Command.

Define the originating container:

script ContainerWindow.OrganizeParent = 11115555

Define the destination container:

script ContainerWindow.OrganizeBag = Organizer.Organizers_Cont[Organizer.ActiveOrganizer]

Execute the organizer:

script ContainerWindow.Organize = true

 

--

 

An example where a container is opened and an organizer selected:

Now, let’s repeat moving gold from the main backpack into a chest. This time, the macro will also open the destination container, the main backpack will already be open, and select the organizer.

 

As before, first build an organizer (Gold), set the destination container as the chest (must be open), and record the position of organizer Gold in the organizer list (the index position). In this example Gold will be the only organizer.
Gold                            1

Next, use one of the methods available to obtain the objectID for both the chest and main backpack.
Chest                           1101555
Main backpack            77766688

 

This macro is longer but will also open the destination container and select organizer Gold. Each “script” line is input via Action>Other>Command.

Target the destination container:

script HandleSingleLeftClkTarget(1101555)

Open the destination container:

Use Targeted Object

Register the open container:

Delay 1.0

Select the Organizer:

script Organizer.ActiveOrganizer = 1

Update the selection:

Delay 1.0

Define the originating container:

script ContainerWindow.OrganizeParent = 77766688

Define the destination container:

script ContainerWindow.OrganizeBag = Organizer.Organizers_Cont[Organizer.ActiveOrganizer]

Execute the organizer:

script ContainerWindow.Organize = true

--

-Arroth

Comments

  • Arroth_ThaielArroth_Thaiel Posts: 1,072
    edited August 2022

    A more complex and realistic example: Back from hunting

    I have a gold bag in a chest. I have a gem bag in another chest. I have a reagent bag in a third chest. When I come back from hunting, I want my organizer to put gold, gems, and reagents into the appropriate bags, tell me which thing is being put away, close all the containers when done, and notify me the loot is distributed. Oh, and I use a hot bag for gems and reagents, but gold is found in my main pack, which is already open.

    To make this work, I’ll build three organizers, Gold, Gems, and Reagents, each with respective destination containers. Gold will have 1 item, Gems 9, and Reagents 8. I’ll need the index positions of each of the three organizers. I’m also going to need the objectID codes for: chest holding gold bag, chest holding gem bag, chest holding reagent bag, hot bag, and main backpack.

     

    Organizer Index positions:
    Gold                                        3
    Gems                                      5
    Reagents                                6

    objectID codes:
    Chest holding gold bag           222444222
    Chest holding gem bag           333555333
    Chest holding reagent bag      777888666
    Hot bag                                    111999111
    Main backpack                         999131

     

    Macro:

    Target the destination container (chest holding gold bag):

    script HandleSingleLeftClkTarget(222444222)

    Open destination container (chest holding gold bag):

    Use Targeted Object

    Register the open container:

    Delay 1.0

    Target the destination container (chest holding gem bag):

    script HandleSingleLeftClkTarget(333555333)

    Open destination container (chest holding gem bag):

    Use Targeted Object

    Register the open container:

    Delay 1.0

    Target the destination container (chest holding reagent bag):

    script HandleSingleLeftClkTarget(777888666)

    Open destination container (chest holding reagent bag):

    Use Targeted Object

    Register the open container:

    Delay 1.0

    Target the destination container (hot bag):

    script HandleSingleLeftClkTarget(111999111)

    Open destination container (hot bag):

    Use Targeted Object

    Register the open container:

    Delay 1.0

    Select Organizer (Gold):

    script Organizer.ActiveOrganizer = 3

    Update the selection:

    Delay 1.0

    Define the originating container (main backpack):

    script ContainerWindow.OrganizeParent = 999131

    Define the destination container:

    script ContainerWindow.OrganizeBag = Organizer.Organizers_Cont[Organizer.ActiveOrganizer]

    Execute the organizer:

    script ContainerWindow.Organize = true

    Feedback:

    Say “Moving Gold”

    Allow the organizer to move the item(s) (Only 1 item being moved.):

    Delay 1.0s 

    Select Organizer (Gems):

    script Organizer.ActiveOrganizer = 5

    Update the selection:

    Delay 1.0

    Define the originating container (hotbag):

    script ContainerWindow.OrganizeParent = 111999111

    Define the destination container:

    script ContainerWindow.OrganizeBag = Organizer.Organizers_Cont[Organizer.ActiveOrganizer]

    Execute the organizer:

    script ContainerWindow.Organize = true

    Feedback:

    Say “Putting away Gems”

    Allow the organizer to move the item(s) (Up to 9 items being moved.):

    Delay 9.0s

    Select Organizer (Reagents):

    script Organizer.ActiveOrganizer = 6

    Update the selection:

    Delay 1.0

    Define the originating container (hotbag):

    script ContainerWindow.OrganizeParent = 111999111

    Define the destination container:

    script ContainerWindow.OrganizeBag = Organizer.Organizers_Cont[Organizer.ActiveOrganizer]

    Execute the organizer:

    script ContainerWindow.Organize = true

    Feedback:

    Say “Stocking Reagents”

    Allow the organizer to move the item(s) (Up to 8 items being moved.):

    Delay 8.0s

    Clean up (leave main backpack open):

    Close All Containers

    Bark and System Message that the macro is complete.

    script WindowUtils.SendOverheadText(L"Loot put away!", 1152, true)

    -Arroth
  • SethSeth Posts: 2,926
    edited August 2022
    I guess this would still required all 3 bags or containers close by.

    It would be nice if we can have 1 container that holds all 7500 items in the castle or X items for any size house. 

    I would rather have one fixed super storage container, while the rest in the house are either cosmetic or functional (e.g. create sound, recall portal, or give resources, etc) 

    If they can make jewelry case with max 500 items, then 125 is not a coding limit. They can code such that any house container can accept up to the Max storage allowed, as long as total locked down plus secured is < Max.

    Once this is done, I would configure dozens of organizers to sort and store item by simply standing next to 1 container.
    If it ain't broke, don't fix it. 
    ESRB warning: Some Blood. LOTS of Alcohol. Some Violence. LOTS of Bugs
  • SethSeth Posts: 2,926
    Once we can get a single super storage container, then it becomes easier to do a search just for this. 

    It would be harder to code a search for the entire house with 100s of separate containers.
    If it ain't broke, don't fix it. 
    ESRB warning: Some Blood. LOTS of Alcohol. Some Violence. LOTS of Bugs
Sign In or Register to comment.