diff options
author | Justin Clark-Casey (justincc) | 2011-11-03 22:31:31 +0000 |
---|---|---|
committer | Justin Clark-Casey (justincc) | 2011-11-03 22:31:31 +0000 |
commit | 5a67940acc17c80c419781fddc9efa0c18ce1f15 (patch) | |
tree | 18b58a3cb1434a1ec05c5170bdb59e4d55e19cb3 /OpenSim/Tools/pCampBot/BotManager.cs | |
parent | Move PhysicsBehaviour into a spearate behaviours folder (diff) | |
download | opensim-SC-5a67940acc17c80c419781fddc9efa0c18ce1f15.zip opensim-SC-5a67940acc17c80c419781fddc9efa0c18ce1f15.tar.gz opensim-SC-5a67940acc17c80c419781fddc9efa0c18ce1f15.tar.bz2 opensim-SC-5a67940acc17c80c419781fddc9efa0c18ce1f15.tar.xz |
Add click/grab behaviour to pCampbot, which gets bots to randomly click things.
This can be specified on pCampbot.exe by using g in the list of behaviours for the new -behaviours,-b switch
e.g. -b p,g to get both existing physics and grabbing behaviours.
grabbing is primitive, it attempts grabs on random prims whether they're actually signalled as clickable or not.
behaviour is currently primitive overall, behaviours are just executed in a list
Diffstat (limited to 'OpenSim/Tools/pCampBot/BotManager.cs')
-rw-r--r-- | OpenSim/Tools/pCampBot/BotManager.cs | 16 |
1 files changed, 13 insertions, 3 deletions
diff --git a/OpenSim/Tools/pCampBot/BotManager.cs b/OpenSim/Tools/pCampBot/BotManager.cs index 0505c97..dac6e0e 100644 --- a/OpenSim/Tools/pCampBot/BotManager.cs +++ b/OpenSim/Tools/pCampBot/BotManager.cs | |||
@@ -120,13 +120,23 @@ namespace pCampBot | |||
120 | string password = cs.GetString("password"); | 120 | string password = cs.GetString("password"); |
121 | string loginUri = cs.GetString("loginuri"); | 121 | string loginUri = cs.GetString("loginuri"); |
122 | 122 | ||
123 | // Hardcoded for new | 123 | HashSet<string> behaviourSwitches = new HashSet<string>(); |
124 | List<IBehaviour> behaviours = new List<IBehaviour>(); | 124 | Array.ForEach<string>( |
125 | behaviours.Add(new PhysicsBehaviour()); | 125 | cs.GetString("behaviours", "p").Split(new char[] { ',' }), b => behaviourSwitches.Add(b)); |
126 | 126 | ||
127 | for (int i = 0; i < botcount; i++) | 127 | for (int i = 0; i < botcount; i++) |
128 | { | 128 | { |
129 | string lastName = string.Format("{0}_{1}", lastNameStem, i); | 129 | string lastName = string.Format("{0}_{1}", lastNameStem, i); |
130 | |||
131 | List<IBehaviour> behaviours = new List<IBehaviour>(); | ||
132 | |||
133 | // Hard-coded for now | ||
134 | if (behaviourSwitches.Contains("p")) | ||
135 | behaviours.Add(new PhysicsBehaviour()); | ||
136 | |||
137 | if (behaviourSwitches.Contains("g")) | ||
138 | behaviours.Add(new GrabbingBehaviour()); | ||
139 | |||
130 | startupBot(i, this, behaviours, firstName, lastName, password, loginUri); | 140 | startupBot(i, this, behaviours, firstName, lastName, password, loginUri); |
131 | } | 141 | } |
132 | } | 142 | } |