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
This commit is contained in:
Justin Clark-Casey (justincc)
2011-11-03 22:31:31 +00:00
parent 3ea379e4cd
commit 5a67940acc
6 changed files with 106 additions and 8 deletions

View File

@@ -120,13 +120,23 @@ namespace pCampBot
string password = cs.GetString("password");
string loginUri = cs.GetString("loginuri");
// Hardcoded for new
List<IBehaviour> behaviours = new List<IBehaviour>();
behaviours.Add(new PhysicsBehaviour());
HashSet<string> behaviourSwitches = new HashSet<string>();
Array.ForEach<string>(
cs.GetString("behaviours", "p").Split(new char[] { ',' }), b => behaviourSwitches.Add(b));
for (int i = 0; i < botcount; i++)
{
string lastName = string.Format("{0}_{1}", lastNameStem, i);
List<IBehaviour> behaviours = new List<IBehaviour>();
// Hard-coded for now
if (behaviourSwitches.Contains("p"))
behaviours.Add(new PhysicsBehaviour());
if (behaviourSwitches.Contains("g"))
behaviours.Add(new GrabbingBehaviour());
startupBot(i, this, behaviours, firstName, lastName, password, loginUri);
}
}