Script assist.

Forum to discuss the scripts, configs and connection of XIM with the Titan devices.

Moderator: antithesis

Script assist.

Postby lokirevamped » Fri Feb 13, 2015 6:59 pm

I would like a script that did one thing only, allow me to toggle ADS (press LT and it stays in ADS mode, press a second time to exit ADS mode). I would really like it if I could have a two button config, one for ADS-No Toggle and one for ADS-Toggle (can there be a option to change which button to press for the toggle feature, I would like it to be mouse scroll button up). Thank You in advance.
User avatar
lokirevamped
Lieutenant
Lieutenant
 
Posts: 422
Joined: Tue Jul 29, 2014 8:00 pm

Re: Script assist.

Postby J2Kbr » Mon Feb 16, 2015 1:14 pm

The script below should do what you want!! :joia:

Bind the mouse scroll-up to the EXTRA 1 in the MaxAim button layout.

Code: Select all
int ads_hold_toggle_enabled = FALSE;
int hold_ads = FALSE;

main {
    if(event_press(CEMU_EXTRA1)) {
        ads_hold_toggle_enabled = !ads_hold_toggle_enabled;
    }
    if(ads_hold_toggle_enabled) {
        if(event_press(XB1_LT)) {
            hold_ads = !hold_ads;
        }
        if(hold_ads) {
            set_val(XB1_LT, 100);
        }
    }
}
ConsoleTuner Support Team
User avatar
J2Kbr
General of the Army
General of the Army
 
Posts: 20323
Joined: Tue Mar 18, 2014 1:39 pm

Re: Script assist.

Postby lokirevamped » Mon Feb 16, 2015 4:26 pm

J2Kbr wrote:The script below should do what you want!! :joia:

Bind the mouse scroll-up to the EXTRA 1 in the MaxAim button layout.

Code: Select all
int ads_hold_toggle_enabled = FALSE;
int hold_ads = FALSE;

main {
    if(event_press(CEMU_EXTRA1)) {
        ads_hold_toggle_enabled = !ads_hold_toggle_enabled;
    }
    if(ads_hold_toggle_enabled) {
        if(event_press(XB1_LT)) {
            hold_ads = !hold_ads;
        }
        if(hold_ads) {
            set_val(XB1_LT, 100);
        }
    }
}


I never had to bind a button before, would I have to stay connected to my PC for the bind key to work? If yes, could you configure me another script that would allow me to toggle ADS when the LT is pressed (Lock\unlock on LT Press). Being that I use a mouse, I don't have the benefits of half press.

Thanks in advance.
User avatar
lokirevamped
Lieutenant
Lieutenant
 
Posts: 422
Joined: Tue Jul 29, 2014 8:00 pm

Re: Script assist.

Postby J2Kbr » Wed Feb 18, 2015 11:53 am

I'm sorry. When I read "mouse scroll up" I automatically associated with MaxAim DI, but - of course- we are i the XIM sub-forum, so that is not the case.

Alright, the same script, but now using GUIDE + LT to enable/disable the ADS toggle.

Code: Select all
int ads_hold_toggle_enabled = FALSE;
int hold_ads = FALSE;

main {
    // GUIDE + LT to enable/disable the ADS toggle
    if(get_val(XB1_XBOX) && event_press(XB1_LT)) {
        ads_hold_toggle_enabled = !ads_hold_toggle_enabled;
        hold_ads = FALSE;
    } else if(ads_hold_toggle_enabled) {
        if(event_press(XB1_LT)) {
            hold_ads = !hold_ads;
        }
        if(hold_ads) {
            set_val(XB1_LT, 100);
        }
    }
}
ConsoleTuner Support Team
User avatar
J2Kbr
General of the Army
General of the Army
 
Posts: 20323
Joined: Tue Mar 18, 2014 1:39 pm

Re: Script assist.

Postby lokirevamped » Wed Feb 18, 2015 2:22 pm

J2Kbr wrote:I'm sorry. When I read "mouse scroll up" I automatically associated with MaxAim DI, but - of course- we are i the XIM sub-forum, so that is not the case.

Alright, the same script, but now using GUIDE + LT to enable/disable the ADS toggle.

Code: Select all
int ads_hold_toggle_enabled = FALSE;
int hold_ads = FALSE;

main {
    // GUIDE + LT to enable/disable the ADS toggle
    if(get_val(XB1_XBOX) && event_press(XB1_LT)) {
        ads_hold_toggle_enabled = !ads_hold_toggle_enabled;
        hold_ads = FALSE;
    } else if(ads_hold_toggle_enabled) {
        if(event_press(XB1_LT)) {
            hold_ads = !hold_ads;
        }
        if(hold_ads) {
            set_val(XB1_LT, 100);
        }
    }
}


Thank You, you are the best. Now question, it says Guide + LT, is the guide a button or is it just the title?
User avatar
lokirevamped
Lieutenant
Lieutenant
 
Posts: 422
Joined: Tue Jul 29, 2014 8:00 pm

Re: Script assist.

Postby J2Kbr » Wed Feb 18, 2015 4:15 pm

yes, GUIDE (or the Xbox Button) is the big button with the X ... same as the PS on the Dualshock.
ConsoleTuner Support Team
User avatar
J2Kbr
General of the Army
General of the Army
 
Posts: 20323
Joined: Tue Mar 18, 2014 1:39 pm

Re: Script assist.

Postby lokirevamped » Wed Feb 18, 2015 7:39 pm

J2Kbr wrote:yes, GUIDE (or the Xbox Button) is the big button with the X ... same as the PS on the Dualshock.


Thank You, that's perfect, I can set my Xim4 to press the Guide+LT at the same time when I scroll my mouse toggle up.
User avatar
lokirevamped
Lieutenant
Lieutenant
 
Posts: 422
Joined: Tue Jul 29, 2014 8:00 pm


Return to XIM Apex, XIM4, XIM Edge with Titan devices

Who is online

Users browsing this forum: No registered users and 53 guests