Jump to content
Sign in to follow this  
TRiLeZ

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
Guest
This topic is now closed to further replies.
Sign in to follow this  

  • Recently Browsing   0 members

    No registered users viewing this page.

×