Basic GPC Scripting

Tutorials, How-tos and FAQs for the Titan One device.

Basic GPC Scripting

Postby Sitava » Mon Aug 04, 2014 7:20 pm

Below is a simple script that combines a few common tools many will use often. I've tried to comment what I've done so anyone can replicate or adapt bits of this script for themselves. If anyone wants me to explain it more, please ask.

Code: Select all
// Basic Turbo Tutorial Script

                                                                             
define speed=80;            // This number denotes both how long the button is held as well as how long of a pause is in-between button presses.
                            // Larger numbers slow the speed of turbo whereas smaller numbers increase the speed.

define button=4;            // 4 is the identifier for the RT on the XB1 and 360 and R2 on the PS3/4. Auto-fire of a weapon makes things easier,
                            // and this is the most common button used to fire. For a complete list of identifiers see section 12 (bottom):
                            // http://goo.gl/sQ2lcg

int loop;                   // Initialize keyword for our switch to turn this script on and off at will.

main {

    if (event_press(8)) {loop=!loop;}          // Press LS/L3 (identifier 8) to enable/disable this combo.
    if (loop) {combo_run(switch);}             // If the loop is active, run the combo 'switch'.
    if (!loop) {combo_stop(switch);}           // If the loop is inactive, stop combo.
                                               // Since this command resides in the MAIN area of the script, it is always running.
                                               // You can start and stop this at will by pressing LS/L3.

}

combo switch {

    if (get_val(button)) {combo_run (turbofire);}    // This runs the combo whenever the button (RT/R2 in this case) is pressed.
                                                       
}

combo turbofire {                          // Turbofire combo
       
        set_val(button,100);               // This tells the Titan One to press the button.
        wait (speed);                      // This tells the Titan One to wait the amount of milliseconds defined by speed above.
        set_val(button,0);                 // This tells the Titan One to release the button.
        wait (speed);                      // ... and one more wait to pause between button presses

}
Last edited by Sitava on Mon Aug 04, 2014 9:27 pm, edited 1 time in total.
User avatar
Sitava
Corporal
Corporal
 
Posts: 5
Joined: Sat Jul 19, 2014 9:41 am

Re: Basic GPC Scripting

Postby J2Kbr » Mon Aug 04, 2014 8:10 pm

Very nice tutorial!! :smile0517:
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: Basic GPC Scripting

Postby HardcoreGamer » Tue Aug 05, 2014 4:15 am

Very useful, thanks for the tut. :smile0203:
Titan One User's Manual:

http://www.consoletuner.com/kbase/
User avatar
HardcoreGamer
Command Sergeant Major
Command Sergeant Major
 
Posts: 117
Joined: Sun Aug 03, 2014 9:28 pm

Re: Basic GPC Scripting

Postby Benci76 » Thu Jan 29, 2015 5:32 pm

:joia: :joia: :joia: :joia:
User avatar
Benci76
Corporal
Corporal
 
Posts: 4
Joined: Sun Dec 07, 2014 6:47 pm


Return to Tutorials and FAQs

Who is online

Users browsing this forum: No registered users and 111 guests