RCXD Script Request

GPC2 script programming for Titan Two. Code examples, questions, requests.

RCXD Script Request

Postby zerocool99 » Sun Oct 17, 2021 8:52 am

Looking for to make a really simple script

xbox one

LEFT ON THE DPAD AND THEN PRESS Y , (need to be able to adjust timing between pressing left on the dpad and pressing y)

need to start at about 1/2 second between the presses

Left on the dpad to start and stop script

hope someone can help me

thnak you
User avatar
zerocool99
Private First Class
Private First Class
 
Posts: 3
Joined: Sat Mar 20, 2021 12:50 pm

Re: RCXD Script Request

Postby Haures » Sun Oct 17, 2021 11:55 am

Here, i hope it helps.
Code: Select all
 
#pragma METAINFO("RCXD Script Request", 1, 00, "Haures")
/* 
Script Version 1.0
Controller tested: Xbox Elite Version 1 (the old one)
Author: Haures
 
       ██    ██   ██████   ██    ██  ███████   ████████  ████████
       ██    ██  ██    ██  ██    ██  ██    ██  ██        ██
       ████████  ████████  ██    ██  ███████   ██████    ████████
       ██    ██  ██    ██  ██    ██  ██    ██  ██              ██
       ██    ██  ██    ██    ████    ██    ██  ████████  ████████
*/

 
//NOTE: this combo wont loop so it only happens when you press/tap the DPAD_LEFT
 
 
 
int time = 500;    //adjust your time between the presses here (in this example 500ms)
 
 
 
main {
if (event_active(BUTTON_12)) { //BUTTON_12 = DPAD_LEFT
    combo_run(LEFT_Y); }
}
 
combo LEFT_Y {
    set_val(BUTTON_12, 100);     //DPAD_LEFT pressed(100) for 100ms(tap)
    set_val(BUTTON_14, 0);        //Y is NOT pressed(0)
    wait(100);    //(100ms)(tap)
    set_val(BUTTON_12, 0);        //DPAD_LEFT is NOT pressed(0)
    set_val(BUTTON_14, 0);        //Y is NOT pressed(0)
    wait(time); //adjustable time between DPAD_LEFT pressed and Y pressed
    set_val(BUTTON_12, 0);        //DPAD_LEFT is NOT pressed(0)
    set_val(BUTTON_14, 100);    //Y is pressed(100) for 100ms (tap)
    wait(100);    //(100ms)(tap)
    set_val(BUTTON_12, 0);        //DPAD_LEFT is NOT pressed(0)
    set_val(BUTTON_14, 0);        //Y is NOT pressed(0)
    wait(100);
}
 
Haures
Sergeant First Class
Sergeant First Class
 
Posts: 16
Joined: Thu Sep 16, 2021 2:59 pm
Location: Germany


Return to GPC2 Script Programming

Who is online

Users browsing this forum: No registered users and 143 guests