Mojo

Panel Example 4

Create clickable buttons with Mojo for Dark Age of Camelot (DAOC).

To create this panel, put the blue text shown below in your script. You must also define the hotkeys in your script (in other words, include a separate Hotkey() block for every DoHotkey() in the script below), otherwise nothing will happen when you click the buttons.

Hotkeys and scripts are explained in the multiboxing section of this website, but you don’t need to be a multiboxer to use them.

This panel uses Mojo’s Tile keyword to display some of the game’s icons, which are contained on bmp files in your DAOC folder. The script below is an example of how to use this keyword.

If you open one of those bmp files (for example, cbt_500.bmp) with a paint program, you'll see that it contains lots of icons in a grid. The Tile command tells Mojo which icon from that grid you want to use for a particular button.

Here’s an explanation of Tile’s syntax:

Tile ( Path Width Height X-Index Y-Index )

Replace Path with the location of the image file on your hard disk. If the path contains one or more spaces, enclose the path in quotation marks.

Width is the width in pixels of an individual icon in the source file. For DAOC’s icons, the correct number is 32.

Height is the height in pixels of an individual icon in the source file. For DAOC’s icons, the correct number is 32.

X-Index is how far from left to right the icon is located on the image in the file. There’s one tricky thing about this: you have to start counting with zero. For example, if an icon is located in the third column, you would write 2.

Y-Index is how far from top to bottom the icon is located on the whole image in the file. There’s one tricky thing about this: you have to start counting with zero. For example, if an icon is located in the fourth row, you would write 3.

Panel
{
  ButtonSize ( 72 72 )
  QtyColumns(3)
  Button { DoHotkey (F1) 
    Tile ( "cbt_500.bmp" 32 32 0 0 ) }
  Button { DoHotkey (F2) 
    Tile ( "cbt_500.bmp" 32 32 0 1 ) }
  Button { DoHotkey (F3) 
    Tile ( "cbt_500.bmp" 32 32 0 2 ) }
  Button { DoHotkey (F4) 
    Tile ( "cbt_500.bmp" 32 32 0 3 ) }
  Button { DoHotkey (F5) 
    Tile ( "cbt_500.bmp" 32 32 0 4 ) }
  Button { DoHotkey (F6) 
    Tile ( "cbt_500.bmp" 32 32 0 5 ) }
  Button { DoHotkey (F7) 
    Tile ( "cbt_500.bmp" 32 32 0 6 ) }
  Button { DoHotkey (F8) 
    Tile ( "cbt_500.bmp" 32 32 0 7 ) }

  Button { DoHotkey (Shift F1) 
    Tile ( "spl_0.bmp" 32 32 5 1 ) }
  Button { DoHotkey (Shift F2) 
    Tile ( "spl_0.bmp" 32 32 5 2 ) }
  Button { DoHotkey (Shift F3) 
    Tile ( "spl_0.bmp" 32 32 5 3 ) }
  Button { DoHotkey (Shift F4) 
    Tile ( "spl_0.bmp" 32 32 5 4 ) }
  Button { DoHotkey (Shift F5) 
    Tile ( "spl_0.bmp" 32 32 5 5 ) }
  Button { DoHotkey (Shift F6) 
    Tile ( "spl_0.bmp" 32 32 5 6 ) }
  Button { DoHotkey (Shift F7) 
    Tile ( "spl_0.bmp" 32 32 5 7 ) }
  Button { DoHotkey (Shift F8) 
    Tile ( "spl_0.bmp" 32 32 5 8 ) }

  Button { DoHotkey (Alt F1) 
    Tile ( "spl_0.bmp" 32 32 3 1 ) }
  Button { DoHotkey (Alt F2) 
    Tile ( "spl_0.bmp" 32 32 3 2 ) }
  Button { DoHotkey (Alt F3) 
    Tile ( "spl_0.bmp" 32 32 3 3 ) }
  Button { DoHotkey (Alt F4) 
    Tile ( "spl_0.bmp" 32 32 3 4 ) }
  Button { DoHotkey (Alt F5) 
    Tile ( "spl_0.bmp" 32 32 3 5 ) }
  Button { DoHotkey (Alt F6) 
    Tile ( "spl_0.bmp" 32 32 3 6 ) }
  Button { DoHotkey (Alt F7) 
    Tile ( "spl_0.bmp" 32 32 3 7 ) }
  Button { DoHotkey (Alt F8) 
    Tile ( "spl_0.bmp" 32 32 3 8 ) }
}

More pages about buttons and panels

This page was first published on March 4, 2020 and last modified on March 4, 2020

Comments