Where is the script ERROR? How do i FIX IT?

Gtuner Pro general support. Operation, questions, updates, feature request.

Moderator: The_Rabid_Taco

Where is the script ERROR? How do i FIX IT?

Postby CYI30RG » Fri Apr 12, 2019 8:15 pm

define RATE_OF_FIRE=20; //Range: 1 to 25 RPS (Round/s)
define SPOT=900; //auto-spot modifier
define SPOT_BUTTON=3; //XB1_RB - PS4_R1


define CROUCH_SPAM_SPEED = 93;

int rapid_onoff=TRUE;
int fire_button;
int scope_button;
int hold_time;
int rest_time;
int autospot=FALSE;


init {
if(get_console() == PIO_PS3) {
fire_button = 3;
scope_button = 6;}
else { // Natural Trigger & Bumper
fire_button = 4;
scope_button = 7;}
hold_time = 500 / RATE_OF_FIRE;
rest_time = hold_time - 20;
if(rest_time < 0) rest_time=0;
}

main {
set_led(LED_1, 1);
set_led(LED_3, 0);
set_led(LED_4, 0);


if(get_val(XB1_VIEW) && event_press(XB1_MENU)) {
rapid_onoff = !rapid_onoff;
}
if(rapid_onoff) {
set_led(LED_1, 0);
set_led(LED_4, 1);
}
if(get_val(fire_button) && rapid_onoff) {combo_run(RAPID_FIRE);}
else if(combo_running(RAPID_FIRE)) {combo_stop(RAPID_FIRE);}

if(get_val(12) < -20) {set_val(8, 100)}
else if(get_val(12) > -20) { set_val(8, 0)}
// AUTOSPOT tap (XB360 BACK -PS3_SELECT ) to turn on/off AutoSpot
if(event_release(3) && get_ptime(3) < 1000) {autospot = !autospot;set_val(1,0);}
if ((autospot && !get_val(SPOT_BUTTON)) && (SPOT > 0 )) combo_run(AutoSpot);
if(get_val(7) > 10) {combo_run(AutoBreath);}
if(get_val(7) < 10) {combo_stop(AutoBreath);}

if(!ONLY_WITH_SCOPE || get_val(scope_button)) {combo_run(AntiRecoil);}
if(get_val(XB1_LT) && get_val(XB1_RT)) {
combo_run(CrouchSpam);
}

combo RAPID_FIRE {
set_val(fire_button, 100);}

wait(hold_time);
set_val(fire_button, 0);
wait(rest_time);
set_val(fire_button, 0);
}

combo AutoSpot {
set_led(LED_3, 0);
set_val(SPOT_BUTTON, 100);
wait(50);
set_led(LED_3, 1);
set_val(SPOT_BUTTON, 0);
wait(SPOT);
}

combo AutoBreath {
wait(200);
set_val(8, 100);
wait(4000);

combo CrouchSpam {
set_val(XB1_B, 100);
wait(40);
wait(CROUCH_SPAM_SPEED) }
}
User avatar
CYI30RG
Staff Sergeant
Staff Sergeant
 
Posts: 10
Joined: Tue Apr 09, 2019 5:58 pm

Re: Where is the script ERROR? How do i FIX IT?

Postby CYI30RG » Sat Apr 13, 2019 12:49 pm

apparently there is no-one competent enough to find the error so i can fix this?????

surely someone can help
User avatar
CYI30RG
Staff Sergeant
Staff Sergeant
 
Posts: 10
Joined: Tue Apr 09, 2019 5:58 pm

Re: Where is the script ERROR? How do i FIX IT?

Postby Scachi » Sat Apr 13, 2019 3:46 pm

If you do small changes each time only and hit compile often to check for errors you are able to spot them easier..if you made the changes yourself.

looks like a wrong position of }

the combo AutoBreath has no closing }

the combo CrouchSpam has two of them } }

One or more missing ; too but the T1 may be able to run the code without them.
User avatar
Scachi
Colonel
Colonel
 
Posts: 1939
Joined: Wed May 11, 2016 6:25 am
Location: Germany

Re: Where is the script ERROR? How do i FIX IT?

Postby CYI30RG » Sun Apr 14, 2019 8:52 am

Scachi wrote:If you do small changes each time only and hit compile often to check for errors you are able to spot them easier..if you made the changes yourself.

looks like a wrong position of }

the combo AutoBreath has no closing }

the combo CrouchSpam has two of them } }

One or more missing ; too but the T1 may be able to run the code without them.



the open and closing brackets confuse me. sometimes i see double closing brackets. i dont know the rules of scripting but i have been able to see a pattern and replicate it to a degree for SMALL modifications only. I will try smaller changes at a time like you suggest. thank you for that :)

@Scachi the only parts of this script i would like are: 1)adjustable rapid fire for m16 but with 3 round burst, autospot and crouchfire. that's it. but all three have an on/off feature. no led's lit for on/off.

would you be willing to extract that from this faulty script and write me a working one with the 3 i listed?
User avatar
CYI30RG
Staff Sergeant
Staff Sergeant
 
Posts: 10
Joined: Tue Apr 09, 2019 5:58 pm

Re: Where is the script ERROR? How do i FIX IT?

Postby Scachi » Sun Apr 14, 2019 9:48 am

No sorry, I have no T1 anymore, only owning T2 and am busy with my own stuff.
User avatar
Scachi
Colonel
Colonel
 
Posts: 1939
Joined: Wed May 11, 2016 6:25 am
Location: Germany

Re: Where is the script ERROR? How do i FIX IT?

Postby J2Kbr » Tue Apr 16, 2019 9:30 am

Compiling errors fixed:
Code: Select all
define RATE_OF_FIRE=20; //Range: 1 to 25 RPS (Round/s)
define SPOT=900; //auto-spot modifier
define SPOT_BUTTON=3; //XB1_RB - PS4_R1
 
define CROUCH_SPAM_SPEED = 93;
 
int rapid_onoff=TRUE;
int fire_button;
int scope_button;
int hold_time;
int rest_time;
int autospot=FALSE;
 
 
init {
    if(get_console() == PIO_PS3) {
    fire_button = 3;
    scope_button = 6;}
    else { // Natural Trigger & Bumper
    fire_button = 4;
    scope_button = 7;}
    hold_time = 500 / RATE_OF_FIRE;
    rest_time = hold_time - 20;
    if(rest_time < 0) rest_time=0;
}
 
main {
    set_led(LED_1, 1);
    set_led(LED_3, 0);
    set_led(LED_4, 0);
 
 
    if(get_val(XB1_VIEW) && event_press(XB1_MENU)) {
    rapid_onoff = !rapid_onoff;
    }
    if(rapid_onoff) {
    set_led(LED_1, 0);
    set_led(LED_4, 1);
    }
    if(get_val(fire_button) && rapid_onoff) {combo_run(RAPID_FIRE);}
    else if(combo_running(RAPID_FIRE)) {combo_stop(RAPID_FIRE);}
 
    if(get_val(12) < -20) {set_val(8, 100)}
    else if(get_val(12) > -20) { set_val(8, 0)}
    // AUTOSPOT tap (XB360 BACK -PS3_SELECT ) to turn on/off AutoSpot
    if(event_release(3) && get_ptime(3) < 1000) {autospot = !autospot;set_val(1,0);}
    if ((autospot && !get_val(SPOT_BUTTON)) && (SPOT > 0 )) combo_run(AutoSpot);
    if(get_val(7) > 10) {combo_run(AutoBreath);}
    if(get_val(7) < 10) {combo_stop(AutoBreath);}
 
    if(get_val(XB1_LT) && get_val(XB1_RT)) {
    combo_run(CrouchSpam);
    }
}
 
combo RAPID_FIRE {
set_val(fire_button, 100);
 
wait(hold_time);
set_val(fire_button, 0);
wait(rest_time);
set_val(fire_button, 0);
}
 
combo AutoSpot {
set_led(LED_3, 0);
set_val(SPOT_BUTTON, 100);
wait(50);
set_led(LED_3, 1);
set_val(SPOT_BUTTON, 0);
wait(SPOT);
}
 
combo AutoBreath {
wait(200);
set_val(8, 100);
wait(4000);
}
combo CrouchSpam {
set_val(XB1_B, 100);
wait(40);
wait(CROUCH_SPAM_SPEED) }
 
ConsoleTuner Support Team
User avatar
J2Kbr
General of the Army
General of the Army
 
Posts: 17313
Joined: Tue Mar 18, 2014 1:39 pm


Return to Gtuner Pro Support (Titan One)

Who is online

Users browsing this forum: Raxeal and 1 guest