WarFace Script???

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

Re: WarFace Script???

Postby Mad » Sun Aug 11, 2019 6:54 am

Not at all.
ConsoleTuner Support Team || Discord
Mad
Major
Major
 
Posts: 1157
Joined: Wed May 22, 2019 5:39 am

Re: WarFace Script???

Postby bonefisher » Sun Aug 11, 2019 6:57 am

Code: Select all
 
/*
ADS +
DPAD UP to toggle rapidfire
DPAD DOWN to toggle strafe
DPAD LEFT to toggle crouch spam
DPAD RIGHT to toggle ADS Spam
*/

 
#pragma METAINFO("Warface", 1, 0, "Mad")
 
#define RF_HOLD     33
#define RF_RELEASE  64
#define AIM_HOLD    150
#define AIM_RELEASE 50
#define STRAFE_TIME 350
#define AA_VALUE    16f
#define AA_DELAY    40
 
fix32 AR = 15f; // Anti Recoil Value
 
bool rapidfire;
bool strafe;
bool cspam;
bool aspam;
bool aa     = TRUE; // Enable aim assist.
bool recoil = FALSE; // Enable anti-recoil
 
init {
  led(255,0,0);
}   
 
main {
  if (is_active(7)) {
    if (event_active(9)) Toggle(1);
    if (event_active(10)) Toggle(2);
    if (event_active(11)) Toggle(3);
    if (event_active(12)) Toggle(4);
  }
 
  if (is_active(4) && aa) combo_run(AimAssist);
 
  //if (is_active(21) || is_active(22)) combo_stop(AimAssist);
 
  if (get_actual(4)) {
    if (recoil) AntiRecoil(22, AR);
    if (rapidfire) combo_run(RapidFire);
  }
 
  if (strafe) {
    if(is_active(23) || is_active(24))  combo_stop(Strafe);
    else if(get_actual(7) || get_actual(4)) combo_run(Strafe);
  }
 
  if (cspam && get_actual(4)) combo_run(Crouch);
 
  if (aspam && get_actual(7) && !get_actual(4)) combo_run(AimAbuse);
}
 
combo RapidFire {
  set_val(4, 100);
  wait(RF_HOLD);
  set_val(4, 0);
  wait(RF_RELEASE);
}
 
combo Strafe {
  set_val(23, -100.0);
  wait(STRAFE_TIME);
  set_val(23, 100.0);;
  wait(STRAFE_TIME);
}
 
combo Crouch {
  set_val(14, 100);
  wait(30);
  set_val(14, 0);
  wait(30);
}
 
combo AimAbuse {
  set_val(7, 100);
  wait(AIM_HOLD);
  set_val(7, 0.0);
  wait(AIM_RELEASE);
}
 
combo AimAssist {
    AntiRecoil (22, AA_VALUE);
  wait(AA_DELAY);
    AntiRecoil (21, -AA_VALUE);
  wait(AA_DELAY);
    AntiRecoil (22, -AA_VALUE);
    wait(AA_DELAY);
    AntiRecoil (21, AA_VALUE);
    wait(AA_DELAY);
}
 
void AntiRecoil (uint8 axis, fix32 recoil){
  if (sqrt(sq(get_actual(21)) + sq(get_actual(22))) < abs(recoil)) {
    set_val(axis,(recoil * (100.0 - abs(get_val(axis)))) / 100.0 + get_actual(axis));
  }
}
 
void Toggle(int id) {
  do{
    switch(id){
      case 1: {
        rapidfire = !rapidfire;
        if (rapidfire){ led(0, 255, 0); return; }
        else continue;
      }
      case 2: {
        strafe = !strafe;
        if (strafe){ led(0, 0, 255); return; }
        else continue;
      }
      case 3: {
        cspam = !cspam;
        if (cspam){ led(0, 255, 255); return; }
        else continue;
      }
      case 4: {
        aspam = !aspam;
        if (aspam){ led(255, 255, 0); return; }             
        else continue;
      }
    }
  }
  while(0);
  led(255, 0, 0);
}
 
void led(int8 r, int8 g, int8 b) {
    led_set(LED_1, (fix32)b, 0);
    led_set(LED_2, (fix32)r, 0);
    led_set(LED_3, (fix32)g, 0);
    return;
}
 

Try this!
bonefisher
Lieutenant General
Lieutenant General
 
Posts: 5344
Joined: Thu Jan 29, 2015 10:49 am

Re: WarFace Script???

Postby Shthappensbro » Sun Aug 11, 2019 7:10 am

bonefisher wrote:
Code: Select all
 
/*
ADS +
DPAD UP to toggle rapidfire
DPAD DOWN to toggle strafe
DPAD LEFT to toggle crouch spam
DPAD RIGHT to toggle ADS Spam
*/

 
#pragma METAINFO("Warface", 1, 0, "Mad")
 
#define RF_HOLD     33
#define RF_RELEASE  64
#define AIM_HOLD    150
#define AIM_RELEASE 50
#define STRAFE_TIME 350
#define AA_VALUE    16f
#define AA_DELAY    40
 
fix32 AR = 15f; // Anti Recoil Value
 
bool rapidfire;
bool strafe;
bool cspam;
bool aspam;
bool aa     = TRUE; // Enable aim assist.
bool recoil = FALSE; // Enable anti-recoil
 
init {
  led(255,0,0);
}   
 
main {
  if (is_active(7)) {
    if (event_active(9)) Toggle(1);
    if (event_active(10)) Toggle(2);
    if (event_active(11)) Toggle(3);
    if (event_active(12)) Toggle(4);
  }
 
  if (is_active(4) && aa) combo_run(AimAssist);
 
  //if (is_active(21) || is_active(22)) combo_stop(AimAssist);
 
  if (get_actual(4)) {
    if (recoil) AntiRecoil(22, AR);
    if (rapidfire) combo_run(RapidFire);
  }
 
  if (strafe) {
    if(is_active(23) || is_active(24))  combo_stop(Strafe);
    else if(get_actual(7) || get_actual(4)) combo_run(Strafe);
  }
 
  if (cspam && get_actual(4)) combo_run(Crouch);
 
  if (aspam && get_actual(7) && !get_actual(4)) combo_run(AimAbuse);
}
 
combo RapidFire {
  set_val(4, 100);
  wait(RF_HOLD);
  set_val(4, 0);
  wait(RF_RELEASE);
}
 
combo Strafe {
  set_val(23, -100.0);
  wait(STRAFE_TIME);
  set_val(23, 100.0);;
  wait(STRAFE_TIME);
}
 
combo Crouch {
  set_val(14, 100);
  wait(30);
  set_val(14, 0);
  wait(30);
}
 
combo AimAbuse {
  set_val(7, 100);
  wait(AIM_HOLD);
  set_val(7, 0.0);
  wait(AIM_RELEASE);
}
 
combo AimAssist {
    AntiRecoil (22, AA_VALUE);
  wait(AA_DELAY);
    AntiRecoil (21, -AA_VALUE);
  wait(AA_DELAY);
    AntiRecoil (22, -AA_VALUE);
    wait(AA_DELAY);
    AntiRecoil (21, AA_VALUE);
    wait(AA_DELAY);
}
 
void AntiRecoil (uint8 axis, fix32 recoil){
  if (sqrt(sq(get_actual(21)) + sq(get_actual(22))) < abs(recoil)) {
    set_val(axis,(recoil * (100.0 - abs(get_val(axis)))) / 100.0 + get_actual(axis));
  }
}
 
void Toggle(int id) {
  do{
    switch(id){
      case 1: {
        rapidfire = !rapidfire;
        if (rapidfire){ led(0, 255, 0); return; }
        else continue;
      }
      case 2: {
        strafe = !strafe;
        if (strafe){ led(0, 0, 255); return; }
        else continue;
      }
      case 3: {
        cspam = !cspam;
        if (cspam){ led(0, 255, 255); return; }
        else continue;
      }
      case 4: {
        aspam = !aspam;
        if (aspam){ led(255, 255, 0); return; }             
        else continue;
      }
    }
  }
  while(0);
  led(255, 0, 0);
}
 
void led(int8 r, int8 g, int8 b) {
    led_set(LED_1, (fix32)b, 0);
    led_set(LED_2, (fix32)r, 0);
    led_set(LED_3, (fix32)g, 0);
    return;
}
 

Try this!



whatever u did worked a little better only thing is it doesnt lock on to them like that at all so thats not helping the aim assist in the game hmm this game is weird lol like i said for some reason the spam crouch has a little bit of aim assist idk why but it does
Last edited by Shthappensbro on Sun Aug 11, 2019 7:17 am, edited 1 time in total.
User avatar
Shthappensbro
Captain
Captain
 
Posts: 738
Joined: Wed Aug 16, 2017 4:55 pm

Re: WarFace Script???

Postby Shthappensbro » Sun Aug 11, 2019 7:15 am

Mad wrote:Not at all.



how do i speed up the strafing back and forth and make it a little wider ???
User avatar
Shthappensbro
Captain
Captain
 
Posts: 738
Joined: Wed Aug 16, 2017 4:55 pm

Re: WarFace Script???

Postby Mad » Sun Aug 11, 2019 7:50 am

Adjust the time, lower will be faster, higher will be wider.
Code: Select all
#define STRAFE_TIME 350
ConsoleTuner Support Team || Discord
Mad
Major
Major
 
Posts: 1157
Joined: Wed May 22, 2019 5:39 am

Re: WarFace Script???

Postby bonefisher » Sun Aug 11, 2019 7:51 am

Downloading game to check it out!
bonefisher
Lieutenant General
Lieutenant General
 
Posts: 5344
Joined: Thu Jan 29, 2015 10:49 am

Re: WarFace Script???

Postby Shthappensbro » Sun Aug 11, 2019 3:33 pm

bonefisher wrote:Downloading game to check it out!



sweet its pretty fun i do play with the xim apex tho
User avatar
Shthappensbro
Captain
Captain
 
Posts: 738
Joined: Wed Aug 16, 2017 4:55 pm

Re: WarFace Script???

Postby Shthappensbro » Sun Aug 11, 2019 3:34 pm

Mad wrote:Adjust the time, lower will be faster, higher will be wider.
Code: Select all
#define STRAFE_TIME 350


what about the wideness of strafe??
User avatar
Shthappensbro
Captain
Captain
 
Posts: 738
Joined: Wed Aug 16, 2017 4:55 pm

Re: WarFace Script???

Postby bonefisher » Sun Aug 11, 2019 4:37 pm

Whatever I build will be for everything!
bonefisher
Lieutenant General
Lieutenant General
 
Posts: 5344
Joined: Thu Jan 29, 2015 10:49 am

Re: WarFace Script???

Postby Shthappensbro » Sun Aug 11, 2019 4:38 pm

User avatar
Shthappensbro
Captain
Captain
 
Posts: 738
Joined: Wed Aug 16, 2017 4:55 pm

PreviousNext

Return to GPC2 Script Programming

Who is online

Users browsing this forum: ebling100, FunkyNeurons and 14 guests