Combat action bars

From A KoL Wiki

Combat Action Bars are a graphical way to interface with monster combat and to provide consistent keyboard shortcuts for in-combat actions.

How To Enable

Go to Options and click on Combat. There will be an option "Enable Combat Action Bar". Click it and the bar will load on your next combat.

How To Use

When you first load combat with the combat action bar enabled, you will be greeted with an empty action bar. <img>

If you'd like to add additional skills or items to the bar, open the skills menu or items menu. <img>

From here, you can drag a skill, item, or other action onto the bar wherever you wish.

First we'll add a skill... <img> And then an item... <img>

And one more for running away. This Very Mad Scientist looks especially fierce! We may need it. <img>

Then, when you've populated your bar, you can click on the button or push a key on your keyboard corresponding to the button to use whatever item, skill, or other action you've bound it to. <img>

Also, notice the arrows on the right. <img> These can be used to change the current "page" of the action bar. <img> Note that the number has changed, and the bar is blank again. A page can hold a separate set of buttons. There are twelve pages in total, so there are a total of 144 buttons to bind! Bind them in a way that makes sense for you.

If you don't feel like binding every single item or skill that you own, you can still use them from the menus. Just click on the item or skill to use it.

Your button assignments will be remembered between logins.

Special note for people who have Ambidextrous Funkslinging: Funkslinging works a little differently. In order to funksling two items, you need to left click on the first item and right click on the second. If you only want to use one item, simply left click on the item twice. You can left click and right click on the same item twice to use two of the same item.

If you are using keyboard shortcuts to use items and you have Ambidextrous Funkslinging, the method for using items is also a little different, even compared to the way that it works when you click on the button. If you have funkslinging, pressing a button with an item bound to it will put it "on deck", as indicated by blue marching ants. <img> If you hit Enter, this item will be used by itself. If you hit a keybind for a second item, it will be funkslung with the first item.

In either case, if you start to funksling one item, and then decide you don't want to use items, you can cancel a pending funksling by hitting the Escape button on your keyboard.

Additionally, you can funksling items from the items menu, but you will have to do it by left and right clicking on them.

Keybinds

Note: If you have a browser feature that allows you to search for text as soon as you start typing, keybinds will not work. You will have to disable this feature in order to use keybinds.

Combat

  • 1, 2, 3, 4, 5, 6, 7, 8, 9, 0, -, =: Activate the corresponding button on the action bar.
  • Shift + 1, 2, ..., =: Change the current page.
  • Up Arrow, Page Up: Go to the previous page.
  • Down Arrow, Page Down: Go to the next page.
  • Shift + S: Open the skills menu.
  • Shift + I: Open the items menu.
  • ` (backtick, it's to the left of the 1 key): Repeat last action (in combat), or adventure again (out of combat.)
  • \ (backslash): Repeat last action (in combat), or adventure again (out of combat.)
  • Enter: When funkslinging, only use one of the selected item.
  • Escape: Close menus, or cancel a pending funksling.
  • Control + /: Switch the window focus from chat to the main pane (and vice versa.) This may not work everywhere.
  • Command + / (for mac users): Switch the window focus from chat to the main pane (and vice versa.) This may not work everywhere. If you use a mac, try both of these; one is bound to work.

Noncombat

  • ` (backtick): Adventure again.
  • \ (backslash): Adventure again.
  • 1, 2, 3, 4: In a choice adventure, pick the first, second, third, or fourth choice.

Known Technical Issues

The combat action bar has been tested and is known to function properly in Firefox and Internet Explorer (and the number of Unholy Rites I've had to perform to ensure the cooperation of the latter will surely earn my soul a place in Hell).

Mac users will suffer some small visual and usability problems due to outstanding browser bugs, most of which are completely out of my control. However, the script should still remain very usable.

  • In Mac Firefox, scrollbars on the menus will not appear. You can use your mousewheel to navigate these menus.
  • In Safari, attempting to drag an item over a scroll bar will cause it to get "stuck". To correct this, let go of the mouse button, which will "unstuck" the item you're dragging. To place the item into the action bar, hover over the button you want to assign the item to and click.

Tidbits for programmers

Combat Action Bars use a script, actionbar.php, to store and retrieve action bar configuration data. actionbar.php?action=fetch outputs a JSON object describing the configuration data. actionbar.php?action=set&bar=[json string] sets the configuration data and saves it on the server (and should always be called using a POST request, and, yes, you can do this with AJAX). This information is loaded using AJAX as needed when the combat action bars are initialized.

Of note is the fact that the server does not modify the JSON object in any way when it stores it. Because of this, any of you intrepid third party application developers can use this function to store arbitrary string data for users of your scripts or programs, providing you heed the following caveats:

  1. There is an internal 65535 character limit on the storage. Play nice and be frugal in what you store; you have to share this with everyone.
  2. You must not modify the variables "whichpage" and "buttoncache" in any way. The Combat Action Bars script subjects the values of this data to very stringent syntax checking, and if the data is not syntactically correct, the script will completely destroy the entire JSON object, both server side and client side. Similarly, if the string that you store is not a legal JSON object, aforementioned clobbering will occur, so be careful how you interface with the script.
  3. Don't call actionbar.php excessively. There's no hard or fast rule here; just use common sense. Try to group together individual changes as best you can.

Notes

  • This page was sourced from the official forum post.
  • Using actionbar.php correctly in programming requires understanding the potential for race-conditions in updating actionbar data. Further details can be found in this forum thread.