Fotnite macro help

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

Fotnite macro help

Postby ugr3 » Sun Sep 15, 2019 4:24 am

Hi all..I play fortnite and i use R2 spam and no longer works well from a long distances so i want the R2 spam when i am in building mode, and when i am in combat mode i want to active the R2 spam only when i double tap R2(right mouse button).
Therefore:
building mode ==> if i keep pressed L2 ==> L2 spam
combat mode ==> if i keep pressed L2 ==> not L2 spam
combat mode ==> if i double tap L2 ==> L2 spam
The problem is also the activation and deactivation of the building mode, it does not happen properly in the script, am not understanding why..
I tried to do it but not able, can anyone help me please?

Code: Select all
 
 
#pragma METAINFO("Macro", 1, 0, "Fortnite")
 
bool  auto_aim;
bool cost=FALSE;
 
main {
 
if(event_active(BUTTON_15)){
        cost=TRUE;
        }
if(cost){
    if(event_active(BUTTON_15) || event_active(BUTTON_14)){
        cost=FALSE;
        }}
 
if(get_val(BUTTON_8)) {
        auto_aim = TRUE;
        } else if(event_release(BUTTON_8)) {
        auto_aim = FALSE;
        }
if(auto_aim) {
        combo_run(AutoAim);
                }
}
 
combo AutoAim {
    set_val(BUTTON_8, 0.0);
    wait(34);
    set_val(BUTTON_8, 100.0);
    wait(142);
    set_val(BUTTON_8, 0.0);
        wait(42);
    set_val(BUTTON_8, 100.0);
    wait(144);
}
 
 
 
 
Last edited by ugr3 on Sun Sep 15, 2019 6:11 pm, edited 1 time in total.
User avatar
ugr3
Sergeant Major
Sergeant Major
 
Posts: 70
Joined: Wed Dec 19, 2018 4:30 pm

Re: Fotnite macro help

Postby DontAtMe » Sun Sep 15, 2019 5:17 am

Code: Select all
const bool cost = FALSE;
main {
  cost = cost ? !(event_active(BUTTON_15) || event_active(BUTTON_14)) : (event_active(BUTTON_15));
  AutoAim = cost ? FALSE : is_active(BUTTON_8);
}
combo AutoAim {
  wait(144);
  set_val(BUTTON_8, 0);
  wait(34);
  wait(142);
  set_val(BUTTON_8, 0);
  wait(42);
}
Hopefully I understood the request correctly. Try this,

Code: Select all
 
bool auto_aim;
bool cost = FALSE;
 
main {
 
  if(is_active(BUTTON_8)) auto_aim = TRUE;
  else if(event_release(BUTTON_8)) auto_aim = FALSE;
 
  if(cost){ // if cost == TRUE
    if(event_active(BUTTON_15) || event_active(BUTTON_14)) cost = FALSE;
  }
  else { // else cost == FALSE
    if(auto_aim) combo_run(AutoAim);
    if(event_active(BUTTON_15)) cost = TRUE;
  }
 
}
combo AutoAim {
  set_val(BUTTON_8, 0);
  wait(34);
  set_val(BUTTON_8, 100);
  wait(142);
  set_val(BUTTON_8, 0);
  wait(42);
  set_val(BUTTON_8, 100);
  wait(144);
}
Here is another version, equivalent to the one above, but more easier to follow/understand. :smile0517:
User avatar
DontAtMe
Captain
Captain
 
Posts: 502
Joined: Tue Oct 02, 2018 4:49 am

Re: Fotnite macro help

Postby ugr3 » Sun Sep 15, 2019 10:57 am

DontAtMe wrote:
Code: Select all
const bool cost = FALSE;
main {
  cost = cost ? !(event_active(BUTTON_15) || event_active(BUTTON_14)) : (event_active(BUTTON_15));
  AutoAim = cost ? FALSE : is_active(BUTTON_8);
}
combo AutoAim {
  wait(144);
  set_val(BUTTON_8, 0);
  wait(34);
  wait(142);
  set_val(BUTTON_8, 0);
  wait(42);
}
Hopefully I understood the request correctly. Try this,

Code: Select all
 
bool auto_aim;
bool cost = FALSE;
 
main {
 
  if(is_active(BUTTON_8)) auto_aim = TRUE;
  else if(event_release(BUTTON_8)) auto_aim = FALSE;
 
  if(cost){ // if cost == TRUE
    if(event_active(BUTTON_15) || event_active(BUTTON_14)) cost = FALSE;
  }
  else { // else cost == FALSE
    if(auto_aim) combo_run(AutoAim);
    if(event_active(BUTTON_15)) cost = TRUE;
  }
 
}
combo AutoAim {
  set_val(BUTTON_8, 0);
  wait(34);
  set_val(BUTTON_8, 100);
  wait(142);
  set_val(BUTTON_8, 0);
  wait(42);
  set_val(BUTTON_8, 100);
  wait(144);
}
Here is another version, equivalent to the one above, but more easier to follow/understand. :smile0517:


its's wrong.. does R2 spam when I'm in combat mode and not in building mode, and there is not the possibility when i am in combat to double tap to R2 spam.
User avatar
ugr3
Sergeant Major
Sergeant Major
 
Posts: 70
Joined: Wed Dec 19, 2018 4:30 pm

Re: Fotnite macro help

Postby ugr3 » Sun Sep 15, 2019 11:43 am

Pls a solution?
User avatar
ugr3
Sergeant Major
Sergeant Major
 
Posts: 70
Joined: Wed Dec 19, 2018 4:30 pm

Re: Fotnite macro help

Postby Scachi » Sun Sep 15, 2019 5:48 pm

The activation /deactivation in the code of your first post is caused by first checking to activate it and directly below that you check to deactivate it again when the code is still working on the same event_active.

L2 or R2 ? What to activate and what to spam ? You have written R2 in your description only.

Here the de-/activation is fixed by flipping the enable disable check order and adding an "else" to it so it will be processed on the next run of main for enable it again.

When in build mode double tap of R2 will enable L2 spam and run only when L2 is held down.
In fight mode just holding L2 & R2 down will run the l2 spam.

Code: Select all
 #pragma METAINFO("Fortnite", 1, 0, "ugr3")
 
bool  auto_aim;
bool cost=FALSE;
 
main {
 
    if (cost){ // build mode
        if (event_active(BUTTON_15) || event_active(BUTTON_14)){ // leave build
            cost=FALSE;
        }
        if (event_active(BUTTON_5) && time_release(BUTTON_5) < 250) auto_aim = TRUE; // double tap
 
    } else { // fight mode
        if (event_active(BUTTON_5)) auto_aim = TRUE;
        if (event_active(BUTTON_15)){ // enter build
            cost=TRUE;
        }
    }
 
    if (event_release(BUTTON_5)) auto_aim = FALSE; // release
 
    if(auto_aim && get_val(BUTTON_8)) {
        combo_run(AutoAim);
    }
}
 
combo AutoAim {
    set_val(BUTTON_8, 0.0);
    wait(34);
    set_val(BUTTON_8, 100.0);
    wait(142);
    set_val(BUTTON_8, 0.0);
        wait(42);
    set_val(BUTTON_8, 100.0);
    wait(144);
}
 
User avatar
Scachi
Brigadier General
Brigadier General
 
Posts: 3044
Joined: Wed May 11, 2016 6:25 am
Location: Germany

Re: Fotnite macro help

Postby ugr3 » Sun Sep 15, 2019 5:52 pm

Scachi wrote:The activation /deactivation in the code of your first post is caused by first checking to activate it and directly below that you check to deactivate it again when the code is still working on the same event_active.

L2 or R2 ? What to activate and what to spam ? You have written R2 in your description only.

Here the de-/activation is fixed by flipping the enable disable check order and adding an "else" to it so it will be processed on the next run of main for enable it again.

When in build mode double tap of R2 will enable L2 spam and run only when L2 is held down.
In fight mode just holding L2 & R2 down will run the l2 spam.

Code: Select all
 #pragma METAINFO("Fortnite", 1, 0, "ugr3")
 
bool  auto_aim;
bool cost=FALSE;
 
main {
 
    if (cost){ // build mode
        if (event_active(BUTTON_15) || event_active(BUTTON_14)){ // leave build
            cost=FALSE;
        }
        if (event_active(BUTTON_5) && time_release(BUTTON_5) < 250) auto_aim = TRUE; // double tap
 
    } else { // fight mode
        if (event_active(BUTTON_5)) auto_aim = TRUE;
        if (event_active(BUTTON_15)){ // enter build
            cost=TRUE;
        }
    }
 
    if (event_release(BUTTON_5)) auto_aim = FALSE; // release
 
    if(auto_aim && get_val(BUTTON_8)) {
        combo_run(AutoAim);
    }
}
 
combo AutoAim {
    set_val(BUTTON_8, 0.0);
    wait(34);
    set_val(BUTTON_8, 100.0);
    wait(142);
    set_val(BUTTON_8, 0.0);
        wait(42);
    set_val(BUTTON_8, 100.0);
    wait(144);
}
 

sorry i have wrong, its L2 spam, i have edit the topic.
User avatar
ugr3
Sergeant Major
Sergeant Major
 
Posts: 70
Joined: Wed Dec 19, 2018 4:30 pm

Re: Fotnite macro help

Postby ugr3 » Sun Sep 15, 2019 6:39 pm

solved, ty very much.. U're the best!
User avatar
ugr3
Sergeant Major
Sergeant Major
 
Posts: 70
Joined: Wed Dec 19, 2018 4:30 pm


Return to GPC2 Script Programming

Who is online

Users browsing this forum: No registered users and 62 guests