Page 1 of 1

a basic script i can't make it to work

PostPosted: Sun Dec 22, 2019 10:34 am
by sporat2012
hi, i can't figure out how to make this code, all i want it to do when i press left on D-pad (PS4):

    hold triangle for 1 second
    press R1 once
    wait two seconds
    press triangle once
    repeat



here's my failed attempt:

Code: Select all
#pragma METAINFO("Destiny 2 melee", 1, 0, " ")
#include <titanone.gph>
 
int onoff;
 
main
{
if(event_press(PS4_LEFT))
{onoff = !onoff;}
if(onoff){combo_run(melee);
}
}
 
combo melee
{
set_val(PS4_TRIANGLE, 100);
wait(1000);
set_val(PS4_R1, 100);
wait(1000);
set_val(PS4_TRIANGLE, 0);
wait(1000);
set_val(PS4_R1, 0);
wait(1000);
}

Re: a basic script i can't make it to work

PostPosted: Sun Dec 22, 2019 11:24 am
by Mad
Are you trying to compile this for the titan one?

Remove this:
Code: Select all
#pragma METAINFO("Destiny 2 melee", 1, 0, " ")
#include <titanone.gph>

Re: a basic script i can't make it to work

PostPosted: Sun Dec 22, 2019 11:25 am
by sporat2012
i'm not sure what that is but i was trying to modify an existing code i have, i have titan two though

Re: a basic script i can't make it to work

PostPosted: Sun Dec 22, 2019 11:41 am
by Mad
Try this:
Code: Select all
#pragma METAINFO("Destiny 2 melee", 1, 0, " ")
 
#include <ps4.gph>
 
bool onoff;
 
main {
    if(event_active(PS4_LEFT)) { onoff = !onoff; }
    if(onoff) { combo_run(melee); }
}
 
combo melee {
    set_val(PS4_TRIANGLE, 100); // hold triangle for 1 second
    wait(1000);
    set_val(PS4_R1, 100); // press R1
    wait(60);
    wait(2000); // wait two seconds
    set_val(PS4_TRIANGLE, 100); // press triangle
    wait(60);
    set_val(PS4_TRIANGLE, 0);
    wait(0);
}

Re: a basic script i can't make it to work

PostPosted: Sun Dec 22, 2019 8:11 pm
by sporat2012
it didn't work the way i wanted, thanks though