MULTIBOXING COMMANDS

Defaults

You can use Defaults to set Foreground and Sendto properties for all hotkeys that follow in the script. This can save you a lot of typing and make the script easier to change.

For example, suppose you have these three hotkeys and you want to set Sendto ( local ) and Foreground ( daoc ) for all of them.

Hotkey(1) { Sendto(local)
   Foreground (daoc) { Key(1) }
Hotkey(2) { Sendto(local)
   Foreground(daoc) { Key(2) }
Hotkey(3) { Sendto(local)
   Foreground(daoc) { Key(3) }

You can either type Sendto and Foreground over and over, as shown above, or you can do it once with Defaults like this:

Defaults
{
   Sendto(local)
   Foreground(daoc)   
}

Hotkey(1) { Key(1) }
Hotkey(2) { Key(2) }
Hotkey(3) { Key(3) }

In this short example it doesn’t make much difference, but it can be a big help with long scripts. Also, it makes the script much easier to modify since you only need to change Sendto and Foreground in a single place. And as you can see it makes the script easier to read.

You can change defaults at any place in your script or override them inside hotkeys as shown below.

Defaults
{
   Sendto(local)
   Foreground(daoc)   
}

Hotkey(1) { Sendto(remote) Key(1) }
Hotkey(2) { Key(2) }
Hotkey(3) { Foreground(any) Key(3) }

Defaults
{
   Sendto ( remote )
   Foreground ( any )   
}

Hotkey(4) { Sendto(Jupiter) Key(4) }
Hotkey(5) { Key(5) }
Hotkey(6) { Foreground(daoc) Key(6) }

This page was first published on November 10, 2017 and last modified on November 10, 2017