Jump to content
Sign in to follow this  

TRiBot Release 9.115_0

Recommended Posts

This release features:

  • Update to the Keyboard API
    • Ability to hold down keys.
    • Ability to press/release an array of keys by key code.
    • Improved key sending methods (old ones deprecated).
  • Update to the Keyboard Engine (see below).
  • Updated the Equipment API
    • Note: The Equipment tab must now be opened in order to get the worn equipment.
  • The Client Starter has been fixed.


Improved Keyboard Engine


Less than 24 hours ago, I noticed a flaw in the keyboard engine which made bot typing less than human-like. The problem was that:

  1. Incorrect key codes were being packed into the key events.
  2. When a human types, the JVM natively receives a raw code, a primary level unicode, a scancode, and an extended key code. These key even properties were not being sent because they were not part of the key event constructor, and there were no methods provided by the Java API to set the values of these properties.


When I noticed the properties specified in 2 weren't being set by the bot, I investigated how to artificially create values for these properties, and set the values using reflection.


I also fixed the incorrect key codes being packed into the key events.


After fixing those two bugs, TRiBot is now able to send key events exactly the way they are sent when a human presses those keys.


Along with those bug fixes, I have also improved how key holding is performed. When a key is held, an initial KEY_PRESSED event (and possibly also KEY_TYPED depending on the key character) is sent. While the key is being held, additional KEY_PRESSED/KEY_TYPED events are send until a KEY_RELEASE event is sent. The second event will be sent after a character randomized repeat delay. The following key events are sent at a character randomized repeat rate.


The character randomized repeat delay and character randomized repeat rate mimics the Keyboard Properties of the Windows Control Panel. Each different botter will have a unique repeat delay and rate. By doing so, we are able to make players using TRiBot stand out from each other, in turn making the players seem more human-like.


A Note to Scripters


If your scripts use custom key pressing/typing/releasing, then they may be detectable. One of the reasons why that may be is because your script doesn't send events properly. Here's how key events work:

  • KEY_PRESSED is sent. If the can not be typed (That is, when the key is pressed, a new character is written to the cursor (usually)), the keyChar is equal to KeyEvent.CHAR_UNDEFINED.
  • KEY_TYPED is sent immediately after if the can not be typed (That is, when the key is pressed, a new character is written to the cursor (usually)). The keyCode for this event should be equal to 0.
  • Time is waited while the key is pressed down.
  • KEY_RELEASED is sent signalling the release of the key. If the can not be typed (That is, when the key is pressed, a new character is written to the cursor (usually)), the keyChar is equal to KeyEvent.CHAR_UNDEFINED.

If your script sends events in a behavior different from this, then your script might be detectable.


You must also make sure to send additional KEY_PRESSED (and possibly also KEY_TYPED) events if your script holds down a key. The rate at which they should be sent should be constant, and not too high or low. I'd recommend to just use Keyboard.holdKey(..) to hold keys as the method takes advantage of the character randomized repeat delay and rate.


Scripters also need to make sure that keys aren't being held for nothing (some scripts do this). The correct key pressing manner as listed above should be used.


Some Keyboard API has also been deprecated. Included is:

  • Keyboard.pressKey(..)
  • Keyboard.releaseKey(..)
  • Keyboard.typeKey(..)

The reason being is that when using those methods, incorrect key codes are constructed. Instead, use:

  • Keyboard.sendPress(..)
  • Keyboard.sendType(..)
  • Keyboard.sendRelease(..)

Read the java docs to learn what to specify as the parameters.


I'd recommend avoiding the use of the above methods unless you are certain you know how to properly send press/type/release keys (and when to). If you really want to know, create a java application, implement a key listener, and debug all of the key events when you press individual keys.

  • Like 1

Share this post

Link to post
Share on other sites
This topic is now closed to further replies.
Sign in to follow this  

  • Our picks

    • This release will:

      Fix key event handling issue

      Fix other event handling issue

      Fix RSServer hook

      Update world hopper to have it use OCR, thanks to Todd

      Use proper disposal of old Graphics objects

      Reformat code

      Rearrange code

      Organize code imports

      Apply around 8000 automated code refactorings

      Make preparations for Java 9

      Fix 11 various bugs

      Add more reliable debugging support

      Fix mouseEntered/Exited event dispatching bug

      Fix minimap walking bug where it opens the map

      Fix broken hooks for today's game update
      • 55 replies
    • This update will:

      Fix GE inventory item positioning bug

      Fix broken object hooks
      • 27 replies
    • This release will:

      Fix some ClosedChannelException bug

      Fix bug in RSObject#getAllTiles

      Add game tab support for "Kourend Favour"
      • 15 replies
    • This release will:

      Fix Settings UI placement bug

      Fix game object location bug

      Fix small layout bug making the client shift up and down

      Fix client crashing bug where loading the client with a small display area will cause the client to crash

      Fix annoying Linux bug relating to painting events and peers

      Fix settings saving bug where settings are saved to disk more often than they should

      Fix RSInterface#isBeingDrawn bug affecting a limited amount of people

      Drop Java 1.7 bytecode version for 1.8

      Important: Since the downloadable RS client uses Java 7, it will no longer be compatible with Looking Glass. To make up for this, we will add support for using other clients such as RuneLite (at a later date).

      This change was necessary to allow us to use Java 8 syntax. It also paves the way for Java 9/10/11 support.
      • 40 replies
    • This update will:

      Fix the RSMenuNode bug which also fixes the bug with bank opening

      Fix the incorrect object positions bug

      Fix and re-enable the LG Objects API Accelerator

      Fix the RSObject#getAllTiles bug
      • 22 replies
  • Recently Browsing   0 members

    No registered users viewing this page.