From 5a67940acc17c80c419781fddc9efa0c18ce1f15 Mon Sep 17 00:00:00 2001 From: Justin Clark-Casey (justincc) Date: Thu, 3 Nov 2011 22:31:31 +0000 Subject: 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 --- OpenSim/Tools/pCampBot/BotManager.cs | 16 +++++++++++++--- 1 file changed, 13 insertions(+), 3 deletions(-) (limited to 'OpenSim/Tools/pCampBot/BotManager.cs') 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 string password = cs.GetString("password"); string loginUri = cs.GetString("loginuri"); - // Hardcoded for new - List behaviours = new List(); - behaviours.Add(new PhysicsBehaviour()); + HashSet behaviourSwitches = new HashSet(); + Array.ForEach( + 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 behaviours = new List(); + + // 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); } } -- cgit v1.1