Add a -form switch to pCampbot to allow one to login a sequence of bots starting from numbers other than 0

0.7.6-extended
Justin Clark-Casey (justincc) 2013-08-14 18:26:11 +01:00
parent 2146b20169
commit 3a62f39044
2 changed files with 8 additions and 4 deletions

View File

@ -157,6 +157,7 @@ namespace pCampBot
string password = startupConfig.GetString("password");
string loginUri = startupConfig.GetString("loginuri");
string startLocation = startupConfig.GetString("start", "last");
int fromBotNumber = startupConfig.GetInt("from", 0);
string wearSetting = startupConfig.GetString("wear", "no");
string startUri = ParseInputStartLocationToUri(startLocation);
@ -178,7 +179,7 @@ namespace pCampBot
for (int i = 0; i < botcount; i++)
{
string lastName = string.Format("{0}_{1}", lastNameStem, i);
string lastName = string.Format("{0}_{1}", lastNameStem, i + fromBotNumber);
// We must give each bot its own list of instantiated behaviours since they store state.
List<IBehaviour> behaviours = new List<IBehaviour>();

View File

@ -118,6 +118,7 @@ namespace pCampBot
ArgvConfigSource cs = new ArgvConfigSource(args);
cs.AddSwitch("Startup", "botcount", "n");
cs.AddSwitch("Startup", "from", "f");
cs.AddSwitch("Startup", "loginuri", "l");
cs.AddSwitch("Startup", "start", "s");
cs.AddSwitch("Startup", "firstname");
@ -137,15 +138,17 @@ namespace pCampBot
// You can either say no, to not load anything, yes, to load one of the default wearables, a folder
// name, to load an specific folder, or save, to save an avatar with some already existing wearables
// worn to the folder MyAppearance/FirstName_LastName, and the load it.
Console.WriteLine(
"usage: pCampBot <-loginuri loginuri> [OPTIONS]\n"
+ "Spawns a set of bots to test an OpenSim region\n\n"
+ " -l, -loginuri loginuri for grid/standalone (required)\n"
+ " -s, -start start location for bots. Can be \"last\", \"home\" or a specific location with or without co-ords (e.g. \"region1\" or \"region2/50/30/90\"\n"
+ " -n, -botcount number of bots to start (default: 1)\n"
+ " -s, -start optional start location for bots. Can be \"last\", \"home\" or a specific location with or without co-ords (e.g. \"region1\" or \"region2/50/30/90\"\n"
+ " -firstname first name for the bots\n"
+ " -lastname lastname for the bots. Each lastname will have _<bot-number> appended, e.g. Ima Bot_0\n"
+ " -password password for the bots\n"
+ " -n, -botcount optional number of bots to start (default: 1)\n"
+ " -f, -from optional starting number for login bot names, e.g. 25 will login Ima Bot_25, Ima Bot_26, etc. (default: 0)"
+ " -b, behaviours behaviours for bots. Comma separated, e.g. p,g. Default is p\n"
+ " current options are:\n"
+ " p (physics - bots constantly move and jump around)\n"
@ -153,7 +156,7 @@ namespace pCampBot
+ " n (none - bots do nothing)\n"
+ " t (teleport - bots regularly teleport between regions on the grid)\n"
// " c (cross)" +
+ " -wear set appearance folder to load from (default: no)\n"
+ " -wear optional folder from which to load appearance data, \"no\" if there is no such folder (default: no)\n"
+ " -h, -help show this message.\n");
}
}