A scripted confederate
A scripted agent says only your lines. Make a timed greeting, a keyword reply with a follow-up, and a line at a number of messages.
-
Why script an agent
A scripted agent does not make up lines. Each participant gets the same lines, after the same events. Thus you can describe the agent exactly in a methods section.
Each line comes from a trigger. A trigger is a condition and a response.
This tutorial starts from a chamber with one resident and the host agent from Add an agent to the room.
-
Open its Script Builder
Click the agent in the chamber's cast to open its settings. Then click Open Script Builder.
Each agent has a column of triggers. The list on the left shows the trigger types, in groups: message content, timing, counting, events and chaining. Types with the MED mark are only for mediators.
An agent with no triggers does not send messages.
The Script Builder of Harbour host, with no triggers. -
A timed greeting
Drag Timed onto the column of the agent.
The value is a delay in milliseconds from the start of the segment. For example, 2000 is two seconds. The response is the line that the agent sends.
Each trigger also has a Thinking Delay before the agent starts to type. The default is one second. Then participants see the agent type for a time that agrees with the length of the line.
A greeting two seconds after the chat starts. -
A keyword reply, and a follow-up
Keyword match fires when a message from a participant contains one of its words. Here the word is ferry. The match ignores capital letters, unless you tick Case sensitive.
A Chain only trigger fires only when a different trigger chains to it. A new trigger is available for chaining only after you apply it. To chain the two triggers:
- Click Apply changes.
- Open the Script Builder again.
- Double-click the keyword trigger.
- Under Then chain to, select the agent and the chain-only trigger.
- Set a delay in milliseconds.
The reply comes first. The follow-up comes two seconds later.
The word ferry gets a reply, then a follow-up two seconds later. -
A line at a number of messages
Message count fires when the segment has exactly that number of messages. All messages count, also the lines of the agent.
CAUTION: The agent checks the count only when a different participant sends a message. The trigger does not fire when the Nth message is the agent's own. Thus, select a number that a message from a participant will reach.
Here the greeting, the message from the resident, the reply and the follow-up are four messages. The next message from the resident is the fifth.
Click Apply changes to close the Script Builder. Then click Deploy to save.
At the fifth message, the host tells the group to talk about more topics. -
In the chat
The host greets the resident. The resident writes about the ferry and gets the reply and the follow-up. At the fifth message, the host tells the group to talk about more topics.
The chat history in the data export contains each line, with the agent that sent it.
A resident talks with the scripted host.