Difference between revisions of "Client Key Bindings"

From Wurmpedia
Jump to navigation Jump to search
Line 15: Line 15:
 
==Wurm Commands==
 
==Wurm Commands==
 
<font color="#FF0000">
 
<font color="#FF0000">
===Weather (OUTDATED!)===
+
===Weather [OUTDATED]===
 
* weather.bolt()
 
* weather.bolt()
 
* weather.showConsole()
 
* weather.showConsole()
Line 21: Line 21:
  
 
===Renderer===
 
===Renderer===
 
 
* renderer.dumpPerf()
 
* renderer.dumpPerf()
 
* renderer.lock()  
 
* renderer.lock()  
Line 30: Line 29:
  
 
===Console===
 
===Console===
 
 
* console.toggle()
 
* console.toggle()
 
* console.toggleFullscreen()  
 
* console.toggleFullscreen()  
Line 39: Line 37:
  
 
===Wurm Movement Commands===
 
===Wurm Movement Commands===
 
 
* wurm.toggleWalkProtection()
 
* wurm.toggleWalkProtection()
  
Line 55: Line 52:
 
* Keys.KEY_TURN_UP
 
* Keys.KEY_TURN_UP
 
* Keys.KEY_TURN_DOWN  
 
* Keys.KEY_TURN_DOWN  
 
===Key Events===
 
  
 
===Letter Keys===
 
===Letter Keys===
 +
KeyEvent.VK_A ... KeyEvent.VK_Z
  
KeyEvent.VK_A ... KeyEvent.VK_Z
+
===Function Keys===
[edit]
+
KeyEvent.VK_F1 ... KeyEvent.VK_F12
Number Pad / Arrow keys
 
  
* KeyEvent.VK_BACK_SPACE
+
===Arrow keys===
 
* KeyEvent.VK_UP
 
* KeyEvent.VK_UP
 
* KeyEvent.VK_DOWN
 
* KeyEvent.VK_DOWN
 
* KeyEvent.VK_LEFT
 
* KeyEvent.VK_LEFT
 
* KeyEvent.VK_RIGHT
 
* KeyEvent.VK_RIGHT
 +
 +
===Other keys===
 +
* KeyEvent.VK_BACK_SPACE
 +
* KeyEvent.VK_END
 +
* KeyEvent.VK_INSERT
 
* KeyEvent.VK_PAGE_UP
 
* KeyEvent.VK_PAGE_UP
 
* KeyEvent.VK_PAGE_DOWN
 
* KeyEvent.VK_PAGE_DOWN
* KeyEvent.VK_END
 
* KeyEvent.VK_INSERT
 
 
===Function Keys===
 
 
KeyEvent.VK_F1 ... KeyEvent.VK_F12
 
  
 
==Miscellaneous==
 
==Miscellaneous==

Revision as of 21:32, 31 January 2006

Introduction

The autorun.bsh fine defines the key bindings used by Wurm. The file should be in the directory you specified when you ran wurm for the first time. This is the directory containing the packs directory. Everything in the autorun.bsh file will be automatically executed when Wurm is started. If you ever mess up this file and need to reset it to the default values, just delete it and restart wurm.

How to bind a command to a key

Open the autorun.bsh in your favorite text editer. Add a line in the following format: keys.bind(<key event>, "<command>"); where <key event> is the key event and <command> is the command as defined below.

for example: keys.bind(KeyEvent.VK_BACK_SPACE, "wurm.rebuildTextures()");

Wurm Commands

Weather [OUTDATED]

  • weather.bolt()
  • weather.showConsole()

Renderer

  • renderer.dumpPerf()
  • renderer.lock()
  • renderer.rebuildTextures()
  • renderer.screenshot()
  • renderer.toggleHud()
  • renderer.toggleTorch()

Console

  • console.toggle()
  • console.toggleFullscreen()

In-Game Windows

  • wurm.showInventory()
  • wurm.showSkills()

Wurm Movement Commands

  • wurm.toggleWalkProtection()

Note that although these are called Keys they are actually commands.

  • Keys.KEY_MOVE_FRONT
  • Keys.KEY_MOVE_LEFT
  • Keys.KEY_MOVE_BACK
  • Keys.KEY_MOVE_RIGHT
  • Keys.KEY_TURN_LEFT
  • Keys.KEY_TURN_RIGHT
  • Keys.KEY_AUTO_RUN
  • Keys.KEY_CENTER_VIEW
  • Keys.KEY_STRAFE
  • Keys.KEY_TURN_UP
  • Keys.KEY_TURN_DOWN

Letter Keys

KeyEvent.VK_A ... KeyEvent.VK_Z

Function Keys

KeyEvent.VK_F1 ... KeyEvent.VK_F12

Arrow keys

  • KeyEvent.VK_UP
  • KeyEvent.VK_DOWN
  • KeyEvent.VK_LEFT
  • KeyEvent.VK_RIGHT

Other keys

  • KeyEvent.VK_BACK_SPACE
  • KeyEvent.VK_END
  • KeyEvent.VK_INSERT
  • KeyEvent.VK_PAGE_UP
  • KeyEvent.VK_PAGE_DOWN

Miscellaneous

From a comment in the wurm forums: For those of you having problems with textures getting broken: When 1.0.5a comes out, add the following to your autorun.bsh:

keys.bind(KeyEvent.VK_BACK_SPACE, "wurm.rebuildTextures()");

that way you can press backspace to force all textures to get rebuilt

Sample autorun.bsh

/**
 * Everything in this file will be automatically executed when Wurm is started.
 * If you ever mess up this file and need to reset it to the default values,
 * just delete it and restart wurm.
 */

import com.wurmonline.client.api.*;

System.out.println("Running autorun.bsh");


// WASD movement

keys.bind(KeyEvent.VK_W, Keys.KEY_MOVE_FRONT);
keys.bind(KeyEvent.VK_A, Keys.KEY_MOVE_LEFT);
keys.bind(KeyEvent.VK_S, Keys.KEY_MOVE_BACK);
keys.bind(KeyEvent.VK_D, Keys.KEY_MOVE_RIGHT);
keys.bind(KeyEvent.VK_Q, Keys.KEY_TURN_LEFT);
keys.bind(KeyEvent.VK_E, Keys.KEY_TURN_RIGHT);
keys.bind(KeyEvent.VK_X, Keys.KEY_AUTO_RUN);
keys.bind(KeyEvent.VK_C, Keys.KEY_CENTER_VIEW);

// Numpad/arrow movement

keys.bind(KeyEvent.VK_UP, Keys.KEY_MOVE_FRONT);
keys.bind(KeyEvent.VK_DOWN, Keys.KEY_MOVE_BACK);
keys.bind(KeyEvent.VK_LEFT, Keys.KEY_TURN_LEFT);
keys.bind(KeyEvent.VK_RIGHT, Keys.KEY_TURN_RIGHT);
keys.bind(KeyEvent.VK_PAGE_UP, Keys.KEY_AUTO_RUN);
keys.bind(KeyEvent.VK_PAGE_DOWN, Keys.KEY_CENTER_VIEW);
keys.bind(KeyEvent.VK_HOME, Keys.KEY_TURN_UP);
keys.bind(KeyEvent.VK_END, Keys.KEY_TURN_DOWN);
keys.bind(KeyEvent.VK_INSERT, Keys.KEY_STRAFE);

// For those of you having problems with textures getting broken:
// you can press F7 to force all textures to get rebuilt
keys.bind(KeyEvent.VK_F7, "renderer.rebuildTextures()");

keys.bind(KeyEvent.VK_B, "weather.bolt()");
keys.bind(KeyEvent.VK_F8, "console.toggleFullscreen()");
keys.bind(KeyEvent.VK_F9, "weather.showConsole()");
keys.bind(KeyEvent.VK_F10, "renderer.toggleHud()");
keys.bind(KeyEvent.VK_F11, "renderer.screenshot()");