Need assistance with simple loop script

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

Need assistance with simple loop script

Postby Gorphius » Wed Feb 24, 2021 5:54 pm

Hello im trying to get this script below working but no action is occurring when triggering it please let me know if you can assist with this,
Code: Select all
 
#define    LOOP    7 // loop 7 times
uint8    iLoop;
 
main {
  if (event_active(BUTTON_13)) iLoop = LOOP; // initiate loop
 
  if (iLoop) { // iLoop is not 0
    if (!cLoop) { // combo is not running at the moment
      iLoop--; // iLoop - 1
      printf("starting combo cLoop, loops left: %d",iLoop); // write text to the Output Panel
      combo_run(cLoop);
    }
  }
}
 
combo cLoop {
  set_val(BUTTON_13,100);   // press button 13
  wait(50);              // (press) for 50ms
  set_val(BUTTON_13,0); // release button 13
  wait(50);              // (release) for 50ms
User avatar
Gorphius
Master Sergeant
Master Sergeant
 
Posts: 26
Joined: Tue Nov 13, 2018 7:54 pm

Re: Need assistance with simple loop script

Postby Scachi » Wed Feb 24, 2021 8:21 pm

its working for me. the device monitor show the button pressed and the output panel is showing the text.
User avatar
Scachi
Brigadier General
Brigadier General
 
Posts: 3044
Joined: Wed May 11, 2016 6:25 am
Location: Germany


Return to GPC2 Script Programming

Who is online

Users browsing this forum: midg3t2, trezor and 138 guests