IS:ClickBoxerHelper

From Lavish Software Wiki
Jump to navigation Jump to search

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).