Conversão de script

GPC1 script programming for Titan One. Code examples, questions, requests.

Conversão de script

Postby Alef03 » Sat Feb 23, 2019 3:49 pm

Saudações a todos do forum, comprei um Titã one alguém poderia converter este para T1, desde

Code: Select all
#include <xb1.gph>
#//       To Activate or Deactivate: Double Tap the Left Bumper.
main{
  bool spam;
  (event_active(XB1_LB) && time_release(XB1_LB) < 250) ? spam = !spam : (spam = spam);
  if(spam) Spam_A = 1;
}
combo Spam_A {
  set_val(XB1_A, 100);
  wait(200); // A held for 200ms.
  wait(4800); // A released, and combo will repeat in 4800ms.
}
User avatar
Alef03
Corporal
Corporal
 
Posts: 5
Joined: Wed Apr 04, 2018 1:08 pm

Re: Conversão de script

Postby J2Kbr » Mon Feb 25, 2019 10:19 am

Script converted to the Titan One:
Code: Select all
// To Activate or Deactivate: Double Tap the Left Bumper. 
 
int toggle;
int time_release;
 
main {
    if(event_release(XB1_LB)) {
        time_release = 0;
    } else if(time_release < 30000) {
        time_release = time_release + get_rtime();
    }
    if(event_press(XB1_LB) && time_release < 250) {
        toggle = !toggle;
    }
    if(toggle) {
        combo_run(Spam_A);
    }
}
 
combo Spam_A {
    set_val(XB1_A, 100);
    wait(200)// A held for 200ms.
    wait(4000); // A released, and combo
    wait(800)// will repeat in 4800ms.
}
 
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: Conversão de script

Postby Alef03 » Tue Oct 27, 2020 9:59 pm

Obrigado General J2Kbr.
User avatar
Alef03
Corporal
Corporal
 
Posts: 5
Joined: Wed Apr 04, 2018 1:08 pm


Return to GPC1 Script Programming

Who is online

Users browsing this forum: No registered users and 55 guests