mirror of
https://github.com/opensim/opensim.git
synced 2026-08-09 02:36:00 +08:00
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:
@@ -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);
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user