Special Anti-Recoil for XIM4 and XIM Apex

Documentation, usage tips and configuration guides for Titan Two scripts and bytecodes published by the community users.

Re: Special Anti-Recoil for XIM4 and XIM Apex

Postby alanmcgregor » Tue Jul 02, 2019 7:07 pm

OK tried raw key_status (keyboard.gph) with a flag, didn't work. XIN.gph got purple offsyncs too at 1000Hz, testing now at 500Hz
User avatar
alanmcgregor
Major
Major
 
Posts: 988
Joined: Tue Mar 27, 2018 8:38 am

Re: Special Anti-Recoil for XIM4 and XIM Apex

Postby alanmcgregor » Tue Jul 02, 2019 7:19 pm

All right, yep. 1000Hz a no go. 500Hz works OK as far I tested no USB offsyncs purple lights.

Scachi So XIN is a more optimized than XKEYS?, I only need a event_active "key"

Or should I go with a custom function for this, like you mention?
User avatar
alanmcgregor
Major
Major
 
Posts: 988
Joined: Tue Mar 27, 2018 8:38 am

Re: Special Anti-Recoil for XIM4 and XIM Apex

Postby Scachi » Tue Jul 02, 2019 7:48 pm

alanmcgregor wrote:All right, yep. 1000Hz a no go. 500Hz works OK as far I tested no USB offsyncs purple lights.

Scachi So XIN is a more optimized than XKEYS?, I only need a event_active "key"

Or should I go with a custom function for this, like you mention?

Xin is using less cpu power but it is not really tested and event_release isn't as fast as with xkeys I think

yes, I would try to do this with custom code for best performance.
If only one key at a time will be pressed you can run this code:
Code: Select all
#include "keyboard.gph"
 
uint8 key_check_val;
 
main {
    if(elapsed_time()) {
        key_check_val = key_check();
        if(key_event_active(KEY_PAD0)) printf("KEY_PAD0");
        if(key_event_active(KEY_PAD1)) printf("KEY_PAD1");
        if(key_event_active(KEY_PAD2)) printf("KEY_PAD2");
        if(key_event_active(KEY_PAD3)) printf("KEY_PAD3");
        if(key_event_active(KEY_PAD4)) printf("KEY_PAD4");
        if(key_event_active(KEY_PAD5)) printf("KEY_PAD5");
        if(key_event_active(KEY_PAD6)) printf("KEY_PAD6");
        if(key_event_active(KEY_PAD7)) printf("KEY_PAD7");
        if(key_event_active(KEY_PAD8)) printf("KEY_PAD8");
        if(key_event_active(KEY_PAD9)) printf("KEY_PAD9");
    }
}
 
bool key_event_active(uint8 cur_key){
    static uint8 prev_key;
    if(cur_key == key_check_val && prev_key != cur_key) {
        prev_key = cur_key;
        return TRUE;
    } else if(prev_key != key_check_val) prev_key = 0;
    return FALSE;
}
User avatar
Scachi
Brigadier General
Brigadier General
 
Posts: 3044
Joined: Wed May 11, 2016 6:25 am
Location: Germany

Re: Special Anti-Recoil for XIM4 and XIM Apex

Postby alanmcgregor » Tue Jul 02, 2019 9:00 pm

Thank you very much Scachi :)

Yep these keys are used only one at time. For selecting/loading a specific value key_status() does the job, but in case like toggles, I need more like an event_active for keys to flip/flop the flag.

For this script maybe only a key for toggle ON/OFF the script might be suitable but I will keep the regular controller combo toggle.

Even though the latest code you share uses very little CPU, I going to go very CPU frugal with this script, won't use it for one key but I certainly will, if more mods are added for in-game toggle ON/OFF :D.

You're the man :smile0517:
User avatar
alanmcgregor
Major
Major
 
Posts: 988
Joined: Tue Mar 27, 2018 8:38 am

Re: Special Anti-Recoil for XIM4 and XIM Apex

Postby alanmcgregor » Tue Jul 02, 2019 9:17 pm

UPDATE ver 3.2
+ Numeric Key Pad Support Added

Key 1 = Slot 1 - Red LED
Key 2 = Slot 2 - Green LED
Key 3 = Slot 3 - Sky Blue LED
Key 4 = Slot 4 - Orange LED
User avatar
alanmcgregor
Major
Major
 
Posts: 988
Joined: Tue Mar 27, 2018 8:38 am

Re: Special Anti-Recoil for XIM4 and XIM Apex

Postby gasknr » Wed Jul 03, 2019 3:16 am

alanmcgregor wrote:UPDATE ver 3.2
+ Numeric Key Pad Support Added

Key 1 = Slot 1 - Red LED
Key 2 = Slot 2 - Green LED
Key 3 = Slot 3 - Sky Blue LED
Key 4 = Slot 4 - Orange LED


Awesome work and almost perfect. The only thing for me now is in PUBG, the on the fly slot changes for the controller is the same as an in-game feature, namely changing the reticle colour and shape for sights/scopes. With the script running, you are no longer able to use the in-game feature, the slot change command overrides it or something. Might I suggest to be able to disable the controller on the fly slot change feature, allowing only the numpad. Its not a huge deal but perhaps something to address further down the line.
User avatar
gasknr
Sergeant First Class
Sergeant First Class
 
Posts: 20
Joined: Sun Dec 03, 2017 12:29 am

Re: Special Anti-Recoil for XIM4 and XIM Apex

Postby passmyclass » Thu Jul 04, 2019 5:51 am

Exactly. This and why can't I drive vehicles while using the script. Gasknr how do you manage to drive cars?
User avatar
passmyclass
Corporal
Corporal
 
Posts: 4
Joined: Sun Jun 30, 2019 5:40 pm

Re: Special Anti-Recoil for XIM4 and XIM Apex

Postby Tahsin » Thu Jul 04, 2019 5:07 pm

passmyclass wrote:Exactly. This and why can't I drive vehicles while using the script. Gasknr how do you manage to drive cars?

Set it to ADS only
User avatar
Tahsin
Sergeant Major
Sergeant Major
 
Posts: 100
Joined: Wed May 15, 2019 7:57 am

Re: Special Anti-Recoil for XIM4 and XIM Apex

Postby passmyclass » Fri Jul 05, 2019 3:36 am

I tried bro it does not work.
User avatar
passmyclass
Corporal
Corporal
 
Posts: 4
Joined: Sun Jun 30, 2019 5:40 pm

Re: Special Anti-Recoil for XIM4 and XIM Apex

Postby passmyclass » Sun Jul 07, 2019 3:34 am

Another big issue is if you have rapid fire on, when shooting automatic guns in pubg, it completely ruins the flow of them. It’s almost as if it’s treating already auto guns like they are single fire and it just ruins the use of this script on pubg.

Things to fix:
- still unable to drive vehicles with rapid fire enabled. Even if it’s set to ADS only.
- Rapid Fire is messing up ability to shoot already automatic guns.

Please look into this because at the moment this script is not useful for pubg.
User avatar
passmyclass
Corporal
Corporal
 
Posts: 4
Joined: Sun Jun 30, 2019 5:40 pm

PreviousNext

Return to User's Script Documentation

Who is online

Users browsing this forum: No registered users and 139 guests