Developer Getting Started

This guide is designed to help developers get started in building Agents for Joe Multiboxer and provides an example repository.

Installing Joe Multiboxer

Download the executable and install it. Run "JoeMultiboxer" (As Administrator).

Install the basic Agents from LavishSoftware/JMB-Basic-Core-Agents. To do so, download the .zip file under "Assets" (https://github.com/LavishSoftware/JMB-Basic-Core-Agents/releases/latest), extract the folders within it into a folder called "Agents" in the Joe Multiboxer folder. So, for example, you will have a file at C:\Program Files (x86)\Joe Multiboxer\Agents\Basic Window Layout/agent.json

You will be somewhat familiar with adding a game to JMB using Add Game from its menu. Current tests involve adding wow.exe or wowclassic.exe (as opposed to the launchers). The example Agent (think of like a WoW Addon, but for JMB) defaults to using a game called "WoW Classic" with a "WoW Classic Default Profile", or can be modified to use whatever you're adding.

At this point, launch JMB and open the main window; if it is not already open, you can double-click the JMB icon in the system tray. This window may always show by default later on. The example agent provides a basic GUI with a Launch button, and a handful of others. Click the Launch button one time to launch 3 game instances.

Focusing a game window will swap windows in a basic 3-window layout. Ctrl+Alt+1, Ctrl+Alt+2, Ctrl+Alt+3 can be used to switch windows. Each game window (by default) will have some overlay GUI in the way, click the X to get them out of the way.

From there, we recommend customizing the example Agent. It can be reloaded with the "Reload Agent" button in the default GUI. We recommend using Visual Studio Code for LavishScript syntax highlighting and auto-complete features; see https://github.com/LavishSoftware/LERN to get started with VS Code, LavishScript and LavishGUI 2.

We will continue to work on the documentation for the Joe Multiboxer API at Developer Launchpad as we finish completing and testing various new pieces.


Example Agent

The folder structure of our example "My Agent" folder structure can be found in c:\Program Files (x86)\Joe Multiboxer\Agents. You may create the Agents folder if needed.

|____My Agent
| |____agent.json
| |____test.Session.iss
| |____test.Session.lgui2Package.json
| |____test.Uplink.iss
| |____test.Uplink.lgui2Package.json

agent.json defines the "Agent" itself. An Agent is a component which controls the loading of a set of scripts and GUI. It also specifies what to load on each platform, in this case between joe multiboxer uplink and joe multiboxer session. For complete details: agent.json schema.

test.SetSession.iss is used to assign the session names. Names will be assigned only when this script runs.

test.Uplink.iss configures the primary uplink, or control source of the Agent. The open command in LaunchSingleInstance tells Joe Multiboxer to launch a specific instance.


Launching Games

From LavishScript / LavishGUI2

JMB Slot launching is used to launch slots tied to characters. The session names will be based on slot number (jmb1, jmb2, etc).

File: Basic Launcher\BasicLauncher.Uplink.iss

...
method Launch()
{
    if ${ReplaceSlots}
        JMB:ClearSlots

    This:InstallCharacters

    variable uint Slot
    variable uint NumAdded
    for (NumAdded:Set[1] ; ${NumAdded}<=${LaunchSlots} ; NumAdded:Inc)
    {
        Slot:Set["${JMB.AddSlot.ID}"]
        JMB.Slot[${Slot}]:SetCharacter[1]
        JMB.Slot[${Slot}]:Launch
    }
}
...

File: Basic Launcher\BasicLauncher.Uplink.lgui2Package.json

...
{
    "type":"stackpanel",
    "margin":[5,5,5,0],
    "orientation":"horizontal",                        
    "children":[
        {
            "type":"textbox",
            "textBinding":"BasicLauncher.LaunchSlots",
            "minSize":[30,0],
            "margin":[0,0,5,0]
        },
        { 
            "type":"button",
            "jsonTemplate":"bl.button",
            "_dock":"bottom",
            "horizontalAlignment":"center",
            "content":"🚀 Launch",
            "font":{
                "bold":true
            },
            "eventHandlers":{
                "onPress":{
                    "type":"method",
                    "object":"BasicLauncher",
                    "method":"Launch"
                }
            }
        }
    ]
},
...

Starting and Stopping Agents

To restart an Agent (for Debugging purposes):

JMB.Agent[My Agent]:Stop:Start

Window Layout

Window layouts can be created by using WindowCharacteristics to set the position and properties of session windows.

WindowCharacteristics -stealth -pos -viewable 0,0 -size -viewable 320x240 -frame none

-stealth does not tell the game the characteristics are changing. This is how to keep the game resolution the same while changing the window size.

-pos -viewable 0,0 Sets the window position while -viewable flag modifies -pos to use the window client position instead of the top left corner of the border

-size -viewable 320x240 Sets the window size while -viewable flag modifies -size to use 320x240 format instead of 320,240.

-frame none Removes borders and can also be thin or thick.

To hardcode a layout which can be applied once sessions have been launched refer to ApplyWindowLayout().

File: My Agent\test.Uplink.iss

...
method ApplyWindowLayout()
{
    echo JMBLauncher:ApplyWindowLayout
    relay jmb1 "WindowCharacteristics -pos -viewable 0,0 -size -viewable 1920x840 -frame none"
    relay jmb2 "WindowCharacteristics -stealth -pos -viewable 0,840 -size -viewable 320x240 -frame none"
    relay jmb3 "WindowCharacteristics -stealth -pos -viewable 320,840 -size -viewable 320x240 -frame none"
    relay jmb4 "WindowCharacteristics -stealth -pos -viewable 640,840 -size -viewable 320x240 -frame none"
    relay jmb5 "WindowCharacteristics -stealth -pos -viewable 960,840 -size -viewable 320x240 -frame none"
}
...

To create a button to run the ApplyWindowLayout method we can add an element.

...
{
    "type":"button",
    "content":"Apply Window Layout",
    "margin":[5,5,0,5],
    "eventHandlers":{
        "onPress":{
            "type":"method",
            "object":"JMBLauncher",
            "method":"ApplyWindowLayout"
        }
    }
},
...

Global Hotkey Switching

globalbind focus "Ctrl+Alt+1" windowvisibility foreground each global bind has to be defined within the appropriate session.

...
method SetGlobalBindForEachSession()
{
    relay jmb1 "globalbind focus \"ctrl+alt+1\" windowvisibility foreground"
    relay jmb2 "globalbind focus \"ctrl+alt+2\" windowvisibility foreground"
    relay jmb3 "globalbind focus \"ctrl+alt+3\" windowvisibility foreground"
    relay jmb4 "globalbind focus \"ctrl+alt+4\" windowvisibility foreground"
    relay jmb5 "globalbind focus \"ctrl+alt+5\" windowvisibility foreground"
}
...

Virtual Files