[UO][EC] Action>Commands: Agents: Selecting

Arroth_ThaielArroth_Thaiel Posts: 1,033
edited August 2022 in General Discussions

Six agents are available to players in the EC. The following are the Action>Commands necessary to select the agent directly, cycle forward through the list of agents returning to the first, and cycle backward through the list of agents returning to the last. All of these cycling Action>Commands have been tested with up to 9 agents of the same type. If you have ten or more agents of the same type and the math breaks, sorry, just use direct select.

To use these agent selectors, create a macro and drag Action>Command into a macro slot. Place (copy/paste) the indicated line of code into the text input box for the Action>Command and save the macro.

Some of the Action>Commands are too long for the text input box. If that is the case, you must log out, open the character file to the macros section, and manually input the remaining text. I have tried to indicate each Action>Command where this will be necessary.

Any list of agents is a table with index positions from 1 (the first agent in the list) to n (the last agent in the list). If you have 7 Organizers, the Organizer's index positions will be 1-7. To directly select an agent, you will use the number of the agent’s index position.

--

Select the Buy Agent: Z = the index position of the Buy agent you wish to select

script Organizer.ActiveBuy = Z

Cycle Forward and Loop the Buy Agent:

script Organizer.ActiveBuy = ( Organizer.ActiveBuy%Organizer.Buys ) + 1

Cycle Backward and Loop the Buy Agent:
script Organizer.ActiveBuy = Organizer.Buys - ( ( ( Organizer.Buys-Organizer.ActiveBuy ) + 1 ) % Organizer.Buys )
--

Select the Sell Agent: Z = the index position of the Sell agent you wish to select
script Organizer.ActiveSell = Z

Cycle Forward and Loop the Sell Agent:

script Organizer.ActiveSell = ( Organizer.ActiveSell%Organizer.Sells ) + 1

Cycle Backward and Loop the Sell Agent:
script Organizer.ActiveSell = Organizer.Sells - ( ( ( Organizer.Sells-Organizer.ActiveSell ) + 1 ) % Organizer.Sells )
--

Select the Organizer Agent: Z = the index position of the Organizer agent you wish to select

script Organizer.ActiveOrganizer = Z

Cycle Forward and Loop the Organizer Agent:

script Organizer.ActiveOrganizer = ( Organizer.ActiveOrganizer%Organizer.Organizers ) + 1

Cycle Backward and Loop the Organizer Agent: (Too long for input text box)
script Organizer.ActiveOrganizer = Organizer.Organizers - ( ( ( Organizer.Organizers-Organizer.ActiveOrganizer ) + 1 ) % Organizer.Organizers )
--

Select the Restock Agent: Z = the index position of the Restock agent you wish to select

script Organizer.ActiveRestock = Z

Cycle Forward and Loop the Restock Agent:

script Organizer.ActiveRestock = ( Organizer.ActiveRestock%Organizer.Restocks ) + 1

Cycle Backward and Loop the Restock Agent: (Too long for input text box)
script Organizer.ActiveRestock = Organizer.Restocks - ( ( ( Organizer.Restocks-Organizer.ActiveRestock ) + 1 ) % Organizer.Restocks )
--

Select the Undress Agent: Z = the index position of the Undress agent you wish to select

script Organizer.ActiveUndress = Z

Cycle Forward and Loop the Undress Agent:

script Organizer.ActiveUndress = ( Organizer.ActiveUndress%Organizer.Undresses ) + 1

Cycle Backward and Loop the Undress Agent: (Too long for input text box)
script Organizer.ActiveUndress = Organizer.Undresses - ( ( ( Organizer.Undresses-Organizer.ActiveUndress ) + 1 ) % Organizer.Undresses )
--

Select the Scavenger Agent: Z = the index position of the Scavenger agent you wish to select

script Organizer.ActiveScavenger = Z

Cycle Forward and Loop the Scavenger Agent:

script Organizer.ActiveScavenger = ( Organizer.ActiveScavenger%Organizer.Scavengers ) + 1

Cycle Backward and Loop the Scavenger Agent: (Too long for input text box)

script Organizer.ActiveScavenger = Organizer.Scavengers - ( ( ( Organizer.Scavengers-Organizer.ActiveScavenger ) + 1 ) % Organizer.Scavengers )

--

In a macro, the Action>Command to select an agent, or cycle agents, can be followed by an Action>Command for Bark & Chat feedback to indicate which agent is selected. A short delay between the Action>Commands may be necessary. This two-instruction macro will allow you to keep tabs on your agents, without having to mouse over an icon, or open the Agents Settings menu.

The following Action>Commands bark and chat the assocaited active agent. Put one line in an Action>Command to give yourself feedback as to the selected agent.

script WindowUtils.SendOverheadText(Organizer.Buys_Desc[Organizer.ActiveBuy], 1152, true)
script WindowUtils.SendOverheadText(Organizer.Sells_Desc[Organizer.ActiveSell], 1152, true)
script WindowUtils.SendOverheadText(Organizer.Organizers_Desc[Organizer.ActiveOrganizer], 1152, true)
script WindowUtils.SendOverheadText(Organizer.Restocks_Desc[Organizer.ActiveRestock], 1152, true)
script WindowUtils.SendOverheadText(Organizer.Undresses_Desc[Organizer.ActiveUndress], 1152, true)
script WindowUtils.SendOverheadText(Organizer.Scavengers_Desc[Organizer.ActiveScavenger], 1152, true)


You can change the colors of the bark feedback to differentiate the different types of agents.
Example of a barked agent:


--

The following Action>Commands concatenate the type of agent with the active agent. Put one line in an Action>Command to give yourself feedback as to the selected agent.

script WindowUtils.SendOverheadText(L"Buy: " .. Organizer.Buys_Desc[Organizer.ActiveBuy], 1152, true)
script WindowUtils.SendOverheadText(L"Sell: " .. Organizer.Sells_Desc[Organizer.ActiveSell], 1152, true)
script WindowUtils.SendOverheadText(L"Organizer: " .. Organizer.Organizers_Desc[Organizer.ActiveOrganizer], 1152, true)
script WindowUtils.SendOverheadText(L"Restock: " .. Organizer.Restocks_Desc[Organizer.ActiveRestock], 1152, true)
script WindowUtils.SendOverheadText(L"Undress: " .. Organizer.Undresses_Desc[Organizer.ActiveUndress], 1152, true)
script WindowUtils.SendOverheadText(L"Scavenger: " .. Organizer.Scavengers_Desc[Organizer.ActiveScavenger], 1152, true)

Again, you can change the bark colors to differentiate agent types.
Example of a concatenated barked agent:

You can also switch the feedback type from Bark & Chat to just Chat if you wish.

--

Hopefully this information helps people more easily control agents, while also providing some indication of which agent is active, since that information isn't readily available for some of the agents.

Credit to an old Stratics thread, and Pinco, for opening the door to this topic. 

-Arroth
Sign In or Register to comment.