Difference between revisions of "IS:ClickBoxerHelper"

From Lavish Software Wiki
Jump to navigation Jump to search
 
Line 1: Line 1:
 
== What is ClickBoxerHelper? ==
 
== What is ClickBoxerHelper? ==
ClickBoxerHelper is a tweakable [http://www.lavishsoft.com/wiki/index.php/LavishScript:Script-Defined_Object_Types lavishscript object] designed to overcome a few of the flaws in the current set of multiboxing tools as well as making things a bit more dynamic.
+
ClickBoxerHelper is a tweakable [http://www.lavishsoft.com/wiki/index.php/LavishScript:Script-Defined_Object_Types lavishscript object] designed to overcome a few of the flaws in the current set of multiboxing tools as well as making things a bit more dynamic. After the introduction of RelayGroups, ClickBoxerHelper was reworked and code was significantly reduced, but its main uses are still valid.
  
You need to customize a few things for use with this. Firstly, you need to make a method to load specific settings, and secondly you need to edit the switch block to call that method. I use two setups, one for Pyro and another for Blast, as such I have a switch block entry to check for Pyro and Blast as passed character names, and methods LoadPyroXML and LoadBlastXML to load their stuff. You will also want to change windowsnapper settings.
+
You need to customize a few things for use with this. Firstly, you need to make a method to load specific settings, and secondly you need to edit the switch block to call that method. I use two setups, one for Pyro and another for Blast, as such I have a switch block entry to check for Pyro and Blast as passed character names, and methods LoadPyroXML and LoadBlastXML to load their stuff. You will also want to change windowsnapper settings, as mine are set to tile onto a second monitor.
  
 
=== Features ===
 
=== Features ===
 
* More robust determining of multi-boxing sessions so as to enable these tools to work on other games (such as EVE Online) that have oddities to them in session number (EVE Online's loader is is1 and the actual game is is2).
 
* More robust determining of multi-boxing sessions so as to enable these tools to work on other games (such as EVE Online) that have oddities to them in session number (EVE Online's loader is is1 and the actual game is is2).
 
* Easy loading of separate settings, such as character-specific scripts and binds.
 
* Easy loading of separate settings, such as character-specific scripts and binds.
* Enabling relaying to all multi-boxing sessions instead of all sessions or a specific session
+
* Automatically joins RelayGroup "Boxers"
  
 
== Installing and Customizing ClickBoxerHelper ==
 
== Installing and Customizing ClickBoxerHelper ==
 
To obtain the code I use for ClickBoxerHelper, copy the following to a new ISS file (that is, make a new text file, save it as all files and .iss as the extension, and open that .iss file) and save it, in your InnerSpace\Scripts\ directory. I saved all of this as multi.iss. This is the up-to-date code I use.
 
To obtain the code I use for ClickBoxerHelper, copy the following to a new ISS file (that is, make a new text file, save it as all files and .iss as the extension, and open that .iss file) and save it, in your InnerSpace\Scripts\ directory. I saved all of this as multi.iss. This is the up-to-date code I use.
  /* Global (that is, global to all scrips in this session instance of the ClickBoxerHelper */
+
  /* Global instance of ClickBoxerHelper */
 
  variable(global) ClickBoxerHelper CBH
 
  variable(global) ClickBoxerHelper CBH
 
  function main(string Character)
 
  function main(string Character)
 
  {
 
  {
  CBH:UpdateSessionsIndex
+
  /* Join the "Boxers" relaygroup */
 +
uplink relaygroup -join "Boxers"
 +
 +
/* Wait a second because this breaks otherwise (Probably trying to use the relaygroup too soon after creation */
 +
wait 10
 +
 
 +
/ * Update the number of Sessions */
 +
relay Boxers "relay ${Session} CBH.Number:Inc"
 
  while (${LavishScript.RunningTime} < ${CBH.LoadTimer})
 
  while (${LavishScript.RunningTime} < ${CBH.LoadTimer})
{
+
{  
echo "Loading scripts in ${Math.Calc[(${CBH.LoadTimer} - ${LavishScript.RunningTime}) / 1000]} seconds"
+
echo "Loading ClickerBoxer and WindowSnapper in ${Math.Calc[(${CBH.LoadTimer} - ${LavishScript.RunningTime}) / 1000]} seconds"
 
  wait 10
 
  wait 10
 
  }
 
  }
if (${CBH.MySessions.Used} == 0)
 
CBH.Number:Set[1]
 
else
 
CBH.Number:Set[${CBH.GetAvailableNumber}]
 
 
   
 
   
 +
/* Launch all the scripts minus repeater */
 
  run windowsnapper -size 400x300 -pos -400,${Math.Calc[(${CBH.Number} - 1) * 300]}
 
  run windowsnapper -size 400x300 -pos -400,${Math.Calc[(${CBH.Number} - 1) * 300]}
 
  windowpos -viewable ${Display.DesktopX},${Display.DesktopY}
 
  windowpos -viewable ${Display.DesktopX},${Display.DesktopY}
Line 32: Line 36:
 
  ui -load -skin WoWSkin ClickerBoxer
 
  ui -load -skin WoWSkin ClickerBoxer
 
   
 
   
 +
/* Character switch block for determining which settings to load */
 
  switch ${Character}
 
  switch ${Character}
 
  {
 
  {
/* My first character */
 
 
  case Pyro
 
  case Pyro
 
  echo "Loading Pyro XML"
 
  echo "Loading Pyro XML"
 
  CBH:LoadPyroXML
 
  CBH:LoadPyroXML
 
  break
 
  break
/* My second character /
 
 
  case Blast
 
  case Blast
 
  echo "Loading Blast XML"
 
  echo "Loading Blast XML"
 
  CBH:LoadBlastXML
 
  CBH:LoadBlastXML
 
  break
 
  break
/* In case we're passed unhandled things */
 
 
  default
 
  default
 
  echo "Unrecognized character, returning"
 
  echo "Unrecognized character, returning"
Line 50: Line 52:
 
  }
 
  }
 
   
 
   
  /* Loop while the session is alive to prevent this script from ending */
+
  /* Infinite loop to prevent script exit, so I can access CBH */
 
  while (1==1)
 
  while (1==1)
 
  {
 
  {
CBH:UpdateSessionsIndex
 
 
  waitframe
 
  waitframe
 
  }
 
  }
 
  }
 
  }
 
   
 
   
  /* Atom executed as the script exits */
+
  /* At exit, kill clickboxer */
 
  atom atexit()
 
  atom atexit()
 
  {
 
  {
Line 64: Line 65:
 
  }
 
  }
 
   
 
   
  /* ClickBoxerHelper: Fix and enhance some of the issues with the current implemenation and running multiple games */
+
  /* The ClickBoxerHelper object */
 
  objectdef ClickBoxerHelper
 
  objectdef ClickBoxerHelper
 
  {
 
  {
  /*Which boxer session am I?*/
+
  /* The "number" used for determining WindowSnapper positioning */
 
  variable int Number = 0
 
  variable int Number = 0
/*What sessions are there?*/
+
variable set MySessions
+
  /* Our load timer */
/*and what are their numbers?*/
 
variable collection:int SessionsNumbers
 
  /*Timer used for loading*/
 
 
  variable int LoadTimer = ${Math.Calc[${LavishScript.RunningTime} + 5000]}
 
  variable int LoadTimer = ${Math.Calc[${LavishScript.RunningTime} + 5000]}
 
/* Easy way to relay a command (ex. keypresses, mouse movement) to all multiboxing sessions */
 
method RelayToBoxers(string command)
 
{
 
if (${SessionsNumbers.FirstKey(exists)})
 
{
 
do
 
{
 
relay ${SessionsNumbers.CurrentKey} "${command}"
 
}
 
while (${SessionsNumbers.NextKey(exists)})
 
}
 
}
 
 
/* Update the set of sessions */
 
method UpdateSessionsIndex()
 
{
 
variable int i
 
for (i:Set[1]; ${i} <= ${Sessions:Inc}; i:Inc)
 
{
 
if (!${MySessions.Contains[is${i}]})
 
relay is${i} CBH:GetBoxerStatus[${Session}]
 
}
 
}
 
 
/* Method another session will call to tell us if it's multiboxing */
 
method SetBoxerStatus(string session, int number)
 
{
 
/* If we don't aleady have the session listed and the session isn't our current session and its number isn't 0 */
 
if (!${MySessions.Contains[${session}]} && !${session.Equal[${Session}]} && ${number} != 0)
 
{
 
/* Add it and update the timer */
 
MySessions:Add[${session}]
 
SessionsNumbers:Set[${session}, ${number}]
 
LoadTimer:Set[${LavishScript.RunningTime} + 5000]
 
}
 
}
 
 
/* Have another session callback us and tell us if it's multiboxing */
 
method GetBoxerStatus(string session)
 
{
 
relay ${session} "CBH:SetBoxerStatus[${Session}, ${Number}]"
 
}
 
 
/* Get the first available "Number" */
 
member:int GetAvailableNumber()
 
{
 
variable int t = 1
 
/* If we already have sessions... */
 
if (${SessionsNumbers.FirstValue(exists)})
 
{
 
/* Find the first gap between sessions */
 
do
 
{
 
if (${t} == ${SessionsNumbers.CurrentValue})
 
t:Inc
 
else
 
return ${t}
 
}
 
while (${SessionsNumbers.NextValue(exists)})
 
/* If there's no gap, add on to the end */
 
if (!${SessionsNumbers.CurrentValue(exists)})
 
{
 
return ${t}
 
}
 
}
 
/* Otherwise, just return 1 because it's the first boxing session */
 
return 1
 
}
 
 
   
 
   
 
  /* Load the ClickBoxer row for Pyro */
 
  /* Load the ClickBoxer row for Pyro */
 
  method LoadPyroXML()
 
  method LoadPyroXML()
 
  {
 
  {
/* Set affinity for core 1 */
 
 
  proc 1 only
 
  proc 1 only
/* Only pyro is running repeater */
 
 
  run repeater "mouse5"
 
  run repeater "mouse5"
/* ClickBoxer additions for Pyro */
 
 
  UIElement[clickerboxer]:AddChild[frame, Pyro,\
 
  UIElement[clickerboxer]:AddChild[frame, Pyro,\
 
  "<Frame name='Pyro'>\
 
  "<Frame name='Pyro'>\
Line 167: Line 93:
 
  <Height>12</Height>\
 
  <Height>12</Height>\
 
  <Alignment>Right</Alignment>\
 
  <Alignment>Right</Alignment>\
  </text>\
+
</text>\
  <button name='tab'>\
+
<button name='tab'>\
  <Text>Tab</Text>\
+
<Text>Tab</Text>\
  <X>50</X>\
+
<X>50</X>\
  <Y>2</Y>\
+
<Y>2</Y>\
  <Width>48</Width>\
+
<Width>48</Width>\
  <Height>16</Height>\
+
<Height>16</Height>\
  <OnLeftClick>\
+
<OnLeftClick>\
  <![CDATA[\
+
relay \"other Boxers\" \"press tab\"\
  CBH:RelayToBoxers\[\"press tab\"\]\
+
</OnLeftClick>\
  ]]>\
+
</button>\
  </OnLeftClick>\
+
<button name='poly'>\
  </button>\
+
<Text>Polymorph</Text>\
  <button name='poly'>\
+
<X>100</X>\
  <Text>Polymorph</Text>\
+
<Y>2</Y>\
  <X>100</X>\
+
<Width>48</Width>\
  <Y>2</Y>\
+
<Height>16</Height>\
  <Width>48</Width>\
+
<OnLeftClick>\
  <Height>16</Height>\
+
relay \"other Boxers\" \"press =\"\
  <OnLeftClick>\
+
</OnLeftClick>\
  <![CDATA[\
+
</button>\
  CBH:RelayToBoxers\[\"press =\"\]\
+
<button name='frostnova'>\
  ]]>\
+
<Text>Frost Nova</Text>\
  </OnLeftClick>\
+
<X>150</X>\
  </button>\
+
<Y>2</Y>\
  </Children>\
+
<Width>48</Width>\
  </Frame>", WoWSkin]
+
<Height>16</Height>\
  }
+
<OnLeftClick>\
 
+
relay \"other Boxers\" \"press 3\"\
  /* Load the ClickBoxer row for Blast */
+
</OnLeftClick>\
  method LoadBlastXML()
+
</button>\
  {
+
</Children>\
  /* Set affinity to core 2 */
+
</Frame>", WoWSkin]
  proc 2 only
+
}
  /* ClickBoxer additions for Blast */
+
  UIElement[clickerboxer]:AddChild[frame, Blast,\
+
/* Load the ClickBoxer row for Blast */
  "<Frame name='Blast'>\
+
method LoadBlastXML()
  <Texture/>\
+
{
  <BackgroundColor/>\
+
proc 2 only
  <Y>34</Y>\
+
UIElement[clickerboxer]:AddChild[frame, Blast,\
  <Width>100%</Width>\
+
"<Frame name='Blast'>\
  <Height>20</Height>\
+
<Texture/>\
  <Children>\
+
<BackgroundColor/>\
  <text name='Blast'>\
+
<Y>34</Y>\
  <Text>Blast</Text>\
+
<Width>100%</Width>\
  <Y>4</Y>\
+
<Height>20</Height>\
  <Width>48</Width>\
+
<Children>\
  <Height>16</Height>\
+
<text name='Blast'>\
 +
<Text>Blast</Text>\
 +
<Y>4</Y>\
 +
<Width>48</Width>\
 +
<Height>16</Height>\
 
  <Alignment>Right</Alignment>\
 
  <Alignment>Right</Alignment>\
 
  </text>\
 
  </text>\
Line 224: Line 154:
 
  <Height>16</Height>\
 
  <Height>16</Height>\
 
  <OnLeftClick>\
 
  <OnLeftClick>\
<![CDATA[\
+
relay \"other Boxers\" \"press tab\"\
CBH:RelayToBoxers\[\"press tab\"\]\
 
]]>\
 
 
  </OnLeftClick>\
 
  </OnLeftClick>\
 
  </button>\
 
  </button>\
Line 236: Line 164:
 
  <Height>16</Height>\
 
  <Height>16</Height>\
 
  <OnLeftClick>\
 
  <OnLeftClick>\
<![CDATA[\
+
relay \"other Boxers\" \"press =\"\
CBH:RelayToBoxers\[\"press =\"\]\
 
]]>\
 
 
  </OnLeftClick>\
 
  </OnLeftClick>\
 +
</button>\
 +
<button name='frostnova'>\
 +
<Text>Frost Nova</Text>\
 +
<X>150</X>\
 +
<Y>2</Y>\
 +
<Width>48</Width>\
 +
<Height>16</Height>\
 +
<OnLeftClick>\
 +
relay \"other Boxers\" \"press 3\"\
 +
</OnLeftClick>\
 
  </button>\
 
  </button>\
 
  </Children>\
 
  </Children>\
 
  </Frame>", WoWSkin]
 
  </Frame>", WoWSkin]
 
  }
 
  }
  }
+
  }
  
 
=== Tweaking and Customizing ===
 
=== Tweaking and Customizing ===
Line 267: Line 203:
  
 
So on. Customize to your heart's content. I am using my right monitor as my main monitor with WoW fake fullscreened, and windowsnapper snapping windows to the left monitor (hence the negative point). You will most likely wish to change this. I am also using a very tweaked ClickBoxer named ClickerBoxer, you will want to change it to clickboxer if using that.
 
So on. Customize to your heart's content. I am using my right monitor as my main monitor with WoW fake fullscreened, and windowsnapper snapping windows to the left monitor (hence the negative point). You will most likely wish to change this. I am also using a very tweaked ClickBoxer named ClickerBoxer, you will want to change it to clickboxer if using that.
 +
 +
== Using RelayGroup to relay ==
 +
Using RelayGroups to relay is very easy. This script joins a pre-defined relay group ("Boxers") for us. To relay to all sessions in a group, you would use relay groupname command, ex.
 +
relay Boxers "press F2; press 1; press tab"
 +
Relaying to "all other" sessions in a group (all sessions in the group excluding you), you would use relay "all other <group>" "command", ex.
 +
relay "all other Boxers" "press 3"
  
 
=== Launching and Using ClickBoxerHelper ===
 
=== Launching and Using ClickBoxerHelper ===
Line 274: Line 216:
 
  run multi Pyro
 
  run multi Pyro
 
This will start the script, which will eventually check <charactername> (Pyro) against the entries in the switch block. In my case, it finds one and calls that method (LoadPyroXML).
 
This will start the script, which will eventually check <charactername> (Pyro) against the entries in the switch block. In my case, it finds one and calls that method (LoadPyroXML).
With ClickBoxerHelper running, you can use CBH:RelayToBoxers["<command>"] to relay a command to all multiboxing sessions running ClickBoxerHelper. Example: In one of pyro's xml buttons, I use:
 
CBH:RelayToBoxers\[\"press tab\"\]\
 
This is the character-escaped equivalent of:
 
CBH:RelayToBoxers["press tab"]
 
which, as you can guess, relays "press tab" to all multiboxing sessions. You can use this in any bind for that session so long as ClickBoxerHelper is running.
 
You could even use something like:
 
CBH:RelayToBoxers["press f1;press alt+a;press escape"]
 
to target a party member, follow, then clear target, though this would break the "one repeated action per hardware action" rule.
 

Revision as of 05:15, 31 October 2008

What is ClickBoxerHelper?

ClickBoxerHelper is a tweakable lavishscript object designed to overcome a few of the flaws in the current set of multiboxing tools as well as making things a bit more dynamic. After the introduction of RelayGroups, ClickBoxerHelper was reworked and code was significantly reduced, but its main uses are still valid.

You need to customize a few things for use with this. Firstly, you need to make a method to load specific settings, and secondly you need to edit the switch block to call that method. I use two setups, one for Pyro and another for Blast, as such I have a switch block entry to check for Pyro and Blast as passed character names, and methods LoadPyroXML and LoadBlastXML to load their stuff. You will also want to change windowsnapper settings, as mine are set to tile onto a second monitor.

Features

  • More robust determining of multi-boxing sessions so as to enable these tools to work on other games (such as EVE Online) that have oddities to them in session number (EVE Online's loader is is1 and the actual game is is2).
  • Easy loading of separate settings, such as character-specific scripts and binds.
  • Automatically joins RelayGroup "Boxers"

Installing and Customizing ClickBoxerHelper

To obtain the code I use for ClickBoxerHelper, copy the following to a new ISS file (that is, make a new text file, save it as all files and .iss as the extension, and open that .iss file) and save it, in your InnerSpace\Scripts\ directory. I saved all of this as multi.iss. This is the up-to-date code I use.

/* Global instance of ClickBoxerHelper */
variable(global) ClickBoxerHelper CBH
function main(string Character)
{
	/* Join the "Boxers" relaygroup */
	uplink relaygroup -join "Boxers"
	
	/* Wait a second because this breaks otherwise (Probably trying to use the relaygroup too soon after creation */
	wait 10
 
	/ * Update the number of Sessions */
	relay Boxers "relay ${Session} CBH.Number:Inc"
	while (${LavishScript.RunningTime} < ${CBH.LoadTimer})

{ echo "Loading ClickerBoxer and WindowSnapper in ${Math.Calc[(${CBH.LoadTimer} - ${LavishScript.RunningTime}) / 1000]} seconds"

		wait 10
	}

	/* Launch all the scripts minus repeater */
	run windowsnapper -size 400x300 -pos -400,${Math.Calc[(${CBH.Number} - 1) * 300]}
	windowpos -viewable ${Display.DesktopX},${Display.DesktopY}
	windowsize -viewable 1280x960
	ui -load Interface/WoWSkin/WoWSkin
	ui -load -skin WoWSkin ClickerBoxer

	/* Character switch block for determining which settings to load */
	switch ${Character}
	{
		case Pyro
			echo "Loading Pyro XML"
			CBH:LoadPyroXML
			break
		case Blast
			echo "Loading Blast XML"
			CBH:LoadBlastXML
			break
		default
			echo "Unrecognized character, returning"
			return
	}

	/* Infinite loop to prevent script exit, so I can access CBH */
	while (1==1)
	{
		waitframe
	}
}

/* At exit, kill clickboxer */
atom atexit()
{
	UIElement -kill clickerboxer
}

/* The ClickBoxerHelper object */
objectdef ClickBoxerHelper
{
	/* The "number" used for determining WindowSnapper positioning */
	variable int Number = 0

	/* Our load timer */
	variable int LoadTimer = ${Math.Calc[${LavishScript.RunningTime} + 5000]}

	/* Load the ClickBoxer row for Pyro */
	method LoadPyroXML()
	{
		proc 1 only
		run repeater "mouse5"
		UIElement[clickerboxer]:AddChild[frame, Pyro,\
			"<Frame name='Pyro'>\
				<Texture/>\
				<BackgroundColor/>\
				<Y>34</Y>\
				<Width>100%</Width>\
				<Height>20</Height>\
				<Children>\
					<text name='Pyro'>\
						<Text>Pyro</Text>\
						<Y>4</Y>\
						<Width>48</Width>\
						<Height>12</Height>\
						<Alignment>Right</Alignment>\
					</text>\
					<button name='tab'>\
						<Text>Tab</Text>\
						<X>50</X>\
						<Y>2</Y>\
						<Width>48</Width>\
						<Height>16</Height>\
						<OnLeftClick>\
								relay \"other Boxers\" \"press tab\"\
						</OnLeftClick>\
					</button>\
					<button name='poly'>\
						<Text>Polymorph</Text>\
						<X>100</X>\
						<Y>2</Y>\
						<Width>48</Width>\
						<Height>16</Height>\
						<OnLeftClick>\
								relay \"other Boxers\" \"press =\"\
						</OnLeftClick>\
					</button>\
					<button name='frostnova'>\
						<Text>Frost Nova</Text>\
						<X>150</X>\
						<Y>2</Y>\
						<Width>48</Width>\
						<Height>16</Height>\
						<OnLeftClick>\
								relay \"other Boxers\" \"press 3\"\
						</OnLeftClick>\
					</button>\
				</Children>\
			</Frame>", WoWSkin]
	}

	/* Load the ClickBoxer row for Blast */
	method LoadBlastXML()
	{
		proc 2 only
		UIElement[clickerboxer]:AddChild[frame, Blast,\
			"<Frame name='Blast'>\
				<Texture/>\
				<BackgroundColor/>\
				<Y>34</Y>\
				<Width>100%</Width>\
				<Height>20</Height>\
				<Children>\
					<text name='Blast'>\
						<Text>Blast</Text>\
						<Y>4</Y>\
						<Width>48</Width>\
						<Height>16</Height>\
						<Alignment>Right</Alignment>\
					</text>\
					<button name='tab'>\
						<Text>Tab</Text>\
						<X>50</X>\
						<Y>2</Y>\
						<Width>48</Width>\
						<Height>16</Height>\
						<OnLeftClick>\
								relay \"other Boxers\" \"press tab\"\
						</OnLeftClick>\
					</button>\
					<button name='poly'>\
						<Text>Polymorph</Text>\
						<X>100</X>\
						<Y>2</Y>\
						<Width>48</Width>\
						<Height>16</Height>\
						<OnLeftClick>\
								relay \"other Boxers\" \"press =\"\
						</OnLeftClick>\
					</button>\
					<button name='frostnova'>\
						<Text>Frost Nova</Text>\
						<X>150</X>\
						<Y>2</Y>\
						<Width>48</Width>\
						<Height>16</Height>\
						<OnLeftClick>\ 
								relay \"other Boxers\" \"press 3\"\

</OnLeftClick>\

					</button>\
				</Children>\
			</Frame>", WoWSkin]
	}	
}	

Tweaking and Customizing

Make your own Load methods and update the switch block to use them. Example: The switch block:

	switch ${Character}
	{
		case Sephiroph:
			echo "Loading Sephiroph settings"
			CBH:LoadSephirophSetting
	}

The method:

	method LoadSephirophSetting()
	{
		/* Set processor affinity to 1 so this session only uses core 1 of the cpu */
		proc 1 only
		/* Start repeater with mouse4 as the toggle bind */
		run repeater "mouse4"
		/* I don't need any custom xml, so I'm done */
	}

So on. Customize to your heart's content. I am using my right monitor as my main monitor with WoW fake fullscreened, and windowsnapper snapping windows to the left monitor (hence the negative point). You will most likely wish to change this. I am also using a very tweaked ClickBoxer named ClickerBoxer, you will want to change it to clickboxer if using that.

Using RelayGroup to relay

Using RelayGroups to relay is very easy. This script joins a pre-defined relay group ("Boxers") for us. To relay to all sessions in a group, you would use relay groupname command, ex.

relay Boxers "press F2; press 1; press tab"

Relaying to "all other" sessions in a group (all sessions in the group excluding you), you would use relay "all other <group>" "command", ex.

relay "all other Boxers" "press 3"

Launching and Using ClickBoxerHelper

For ClickBoxerHelper to work, you need an instance of it. The code I have above already has an instance we can use. To start this script (after tweaking and customizing, mind you) type:

run <scriptname> <charactername>

Example:

run multi Pyro

This will start the script, which will eventually check <charactername> (Pyro) against the entries in the switch block. In my case, it finds one and calls that method (LoadPyroXML).