WarFace Script???

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

Re: WarFace Script???

Postby bonefisher » Sat Aug 24, 2019 5:46 am

So you want to aim and have fire trigger set it off
bonefisher
Lieutenant General
Lieutenant General
 
Posts: 5413
Joined: Thu Jan 29, 2015 10:49 am

Re: WarFace Script???

Postby Shthappensbro » Sat Aug 24, 2019 5:49 am

bonefisher wrote:So you want to aim and have fire trigger set it off



no no like u have to have ads plus fire to spam it if u do ads it doesnt spam it only when u fire but u can have ads pressed u know maybe tap ads twice turn it off ??
User avatar
Shthappensbro
Major
Major
 
Posts: 754
Joined: Wed Aug 16, 2017 4:55 pm

Re: WarFace Script???

Postby bonefisher » Sat Aug 24, 2019 5:53 am

Code: Select all
 
#pragma METAINFO("Warface Special", 1, 0, "bonefisher")
/* Special credits goes out to DrNefario for a awesome anti-recoil function!*/
 
/* *****************************************************************************
<cfgdesc>
[Warface Special]
color          = #008000
shortdesc      = Primary/ Secondary switching enabled. If you get on wrong side just hold switch button pass 250 ms to line up class. Runtime operations for manual overrides. <br /><br /> <b><u>Runtime Operations</b></u>  <br /><br />Hold <b>[L2|LT] + </b><br /><br />Press <b>[Touch-Click|View] + [CROSS|A]</b> to quickly enable/disable the mod.
control        = info
 
[WEAPON SETTINGS:]
color          = #008000
collapsible    = 2
shortdesc      = <font color="brown">PRIMARY WEAPON ENABLE:</font> <font color="green"> Rapid Fire?</font>
byteoffset     = 0
bitsize        = 1
bitoffset      = 7
control        = checkbox
default        = 0
item           = Rapidfire ON
 
[Primary Hold Time Setting]
group          = true
shortdesc      = <font color="brown">PRIMARY ROUNDS PER MINUTE:</font> <font color="green">   Set to desired rpm setting.</font>
byteoffset     = 1
bitsize        = 32
control        = spinboxf
default        = 7500
minimum        = 0
maximum        = 12000
step           = 10
decimals       = 1
 
[Secondary Weapon Setting]
color          = #008000
group          = true
shortdesc      = <font color="brown">SECONDARY WEAPON ENABLE:</font> <font color="green"> Rapid Fire?</font>
byteoffset     = 9
bitsize        = 1
bitoffset      = 7
control        = checkbox
default        = 0
item           = Rapidfire ON
 
[Secondary Hold Time Setting]
group          = true
shortdesc      = <font color="brown">SECONDARY ROUNDS PER MINUTE:</font> <font color="green">   Set to desired rpm setting.</font>
byteoffset     = 10
bitsize        = 32
control        = spinboxf
default        = 7500
minimum        = 0
maximum        = 12000
step           = 10
decimals       = 1
 
[ANTI RECOIL SETTINGS:]
color          = #008000
collapsible    = 2
 
[Stick Noise Remover]
group          = true
shortdesc      = <font color="brown">STICK NOISE:</font> <font color="green"> Set to the resting dead zone values for your right stick.</font>
byteoffset     = 18
bitsize        = 32
control        = spinboxf
default        = 1000
minimum        = 0
maximum        = 10000
step           = 100
decimals       = 2
 
[PRIMARY ANTI RECOIL SETTINGS:]
group          = true
shortdesc      = <font color="brown">PRIMARY WEAPON:</font> <font color="green"> Anti Recoil?</font>
byteoffset     = 22
bitsize        = 1
bitoffset      = 7
control        = checkbox
default        = 1
item           = Anti Recoil ON
 
[Primary Anti Recoil Settings]
group          = true
shortdesc      = <font color="brown">PRIMARY:</font> <font color="green"> Anti Recoil Delay (In MS) after fire button is pressed.</font>
byteoffset     = 23
bitsize        = 16
control        = slider
default        = 75
minimum        = 0
maximum        = 1000
step           = 5
 
[Primary Anti Recoil]
group          = true
shortdesc      = <font color="brown">PRIMARY:</font> <font color="green"> Anti Recoil vertical pull force compensation.</font>
byteoffset     = 25
bitsize        = 32
control        = spinboxf
default        = 1600
minimum        = -10000
maximum        = 10000
step           = 50
decimals       = 2
 
[SECONDARY ANTI RECOIL SETTINGS:]
group          = true
shortdesc      = <font color="brown">SECONDARY WEAPON:</font> <font color="green"> Anti Recoil?</font>
byteoffset     = 29
bitsize        = 1
bitoffset      = 7
control        = checkbox
default        = 1
item           = Anti Recoil ON
 
[Secondary Anti Recoil Settings]
group          = true
shortdesc      = <font color="brown">SECONDARY:</font> <font color="green"> Anti Recoil Delay (In MS) after fire button is pressed.</font>
byteoffset     = 30
bitsize        = 16
control        = slider
default        = 75
minimum        = 0
maximum        = 1000
step           = 5
 
[Secondary Anti Recoil]
group          = true
shortdesc      = <font color="brown">SECONDARY:</font> <font color="green"> Anti Recoil vertical pull force compensation.</font>
byteoffset     = 32
bitsize        = 32
control        = spinboxf
default        = 1400
minimum        = -10000
maximum        = 10000
step           = 50
decimals       = 2
 
[AIM ABUSE SETTINGS:]
color          = #008000
collapsible    = 2
byteoffset     = 56
bitsize        = 1
bitoffset      = 7
control        = checkbox
default        = 0
item           = Aim Abuse
 
[Auto Aim Hold Time]
group          = true
shortdesc      = <font color="brown">Auto Aim Hold Time:</font> <font color="green"> Configure the time period, in milli-seconds, of which the ADS(Scope) button should be pressed when the aim-assist abuse is activated.
byteoffset     = 57
bitsize        = 16
control        = spinbox
default        = 350
minimum        = 20
maximum        = 5000
step           = 50
 
[Auto Aim Release Time]
group          = true
shortdesc      = <font color="brown">Auto Aim Release Time:</font> <font color="green"> Configure the time period, in milli-seconds, of which the ADS(Scope) button should be released when the aim-assist abuse is activated.
byteoffset     = 59
bitsize        = 16
control        = spinbox
default        = 80
minimum        = 10
maximum        = 5000
step           = 5
 
[Auto Aim Fire Pre Pause Time]
group          = true
shortdesc      = <font color="brown">Auto Aim Fire Pre Pause Time:</font> <font color="green"> Configure the time period, in milli-seconds, to pause rapid fire for given time before ads release.
byteoffset     = 61
bitsize        = 16
control        = spinbox
default        = 10
minimum        = 0
maximum        = 5000
step           = 5
 
[Auto Aim Fire Post Pause Time]
group          = true
shortdesc      = <font color="brown">Auto Aim Fire Post Pause Time:</font> <font color="green"> Configure the time period, in milli-seconds, to pause rapid fire for given time after ads release.
byteoffset     = 63
bitsize        = 16
control        = spinbox
default        = 10
minimum        = 0
maximum        = 5000
step           = 5
 
[STRAFE SETTINGS:]
color       = #008000
collapsible = 2
 
[Strafe MODz]
group       = true
shortdesc   = <font color="green">Strafe option.</font>
byteoffset  = 115
bitsize     = 8
control     = radiobox
default     = 0
item        = Disabled
item        = Enabled Strafe (Adjustable)
item        = Enabled Strafe(Hip only)(Adjustable)
item        = Enabled Strafe On single press ads and double press ads Off.
 
[Strafe Adjustable Setting]
group       = true
shortdesc   = <br><b><font color="green">Strafe Adjustable Setting:</font></b>
byteoffset  = 116
bitsize     = 32
control     = spinbox
default     = 400
minimum     = 0
maximum     = 2000
step        = 10
 
[CROUCH SPAM SETTINGS:]
color       = #008000
collapsible = 2
 
[Crouch Spam MODz]
group       = true
shortdesc   = <font color="green">Crouch Spam option.</font>
byteoffset  = 120
bitsize     = 8
control     = radiobox
default     = 0
item        = Disabled
item        = Enabled Crouch Spam ADS only(Adjustable)
item        = Enabled Crouch Spam Hip only(Adjustable)
item        = Enabled Crouch Spam on ADS or Fire(Adjustable).
item        = Enabled Crouch Spam while ADS + Fire(Adjustable).
 
[Crouch Spam Adjustable Setting]
group       = true
shortdesc   = <br><b><font color="green">Crouch Spam Adjustable Setting:</font></b>
byteoffset  = 121
bitsize     = 32
control     = spinbox
default     = 30
minimum     = 0
maximum     = 1000
step        = 5
</cfgdesc>
***************************************************************************** */

 
#include <display.gph>
#define wait(a)  wait((int)a);
#define WEAPON_0   0
#define WEAPON_1   1
bool modz = 1;
fix32 prpm;
fix32 psps;
fix32 phold_time, prest_time;
fix32 srpm;
fix32 ssps;
fix32 shold_time, srest_time;
bool pUseRapidFire;
bool sUseRapidFire;
uint8  weapon = 0;
fix32 StickNoise;
bool pUseAntiRecoil;
uint16 pARecoilDelay;
fix32 pARecoil_V;
bool sUseAntiRecoil;
uint16 sARecoilDelay;
fix32 sARecoil_V;
fix32 ARecoil_V_ToUse;
uint16 ARecoilDelay_ToUse;
//Aim Abuse
bool bUseAimAbuse = FALSE;
bool bAutoAimPauseFire;
int AutoAimHoldTime = 650;
int AutoAimReleaseTime = 50;
int AutoAimFirePrePauseTime = 10;
int AutoAimFirePostPauseTime = 10;
uint8 STRAFE_MODz;
uint32 STRAFE_SHUFFLE;
uint8 CROUCH_SPAM;
uint32 CROUCH_SHUFFLE;
uint32    IND[] = {
    _0_,         // 0
    _1_,         // 1
    _2_,         // 2
    _3_,         // 3
    _P_,         // 4
    _S_          // 5
};
init
{
    pmem_load();
    pUseRapidFire = (pmem_read(0) >> 7) & 0b1;
  pmem_read(1, &prpm);
    sUseRapidFire = (pmem_read(9) >> 7) & 0b1;
  pmem_read(10, &srpm);
  pmem_read(18, &StickNoise);
    pUseAntiRecoil = (pmem_read(22) >> 7) & 0b1;
  pmem_read(23, &pARecoilDelay);
  pmem_read(25, &pARecoil_V);
    sUseAntiRecoil = (pmem_read(29) >> 7) & 0b1;
  pmem_read(30, &sARecoilDelay);
  pmem_read(32, &sARecoil_V);
    bUseAimAbuse = (pmem_read(56) >> 7) & 0b1;
  pmem_read(57, &AutoAimHoldTime);
  pmem_read(59, &AutoAimReleaseTime);
  pmem_read(61, &AutoAimFirePrePauseTime);
  pmem_read(63, &AutoAimFirePostPauseTime);
    STRAFE_MODz = pmem_read(115);
  pmem_read(116, &STRAFE_SHUFFLE);
    CROUCH_SPAM = pmem_read(120);
  pmem_read(121, &CROUCH_SHUFFLE);
    set_weapon(weapon);
    p_update_rapidfire();
    s_update_rapidfire();
}
 
main
{
    if(get_actual(BUTTON_8)){
        set_val(BUTTON_2, 0.0);
        if(get_actual(BUTTON_2) && event_active(BUTTON_16)){
            modz = !modz;
        }
    }
    if(modz==1){
    //--------------------------WEAPON-SWITCHING----------------------------------//
  if(event_release(BUTTON_14) && time_active(BUTTON_14) < 250){
    if(weapon == WEAPON_0) set_weapon(WEAPON_1);
    else if(weapon == WEAPON_1) set_weapon(WEAPON_0);
    }
 
    switch(weapon) {
    case WEAPON_0: {
    if(pUseRapidFire == 0)
    {
        set_val(BUTTON_5, 0.0);
        if (get_actual(BUTTON_5))
        {
        if (bAutoAimPauseFire == FALSE)
        {
            set_val(BUTTON_5, 100.0);
        }
        }
    }
    if(pUseRapidFire == 1)
    {
        if (get_actual(BUTTON_5))
        {
        if (bAutoAimPauseFire == FALSE)
        {
            combo_run(pRapidFire);
        }
        }
    }
    if(pUseAntiRecoil == 1)
    {
        ARecoilDelay_ToUse = pARecoilDelay;
        ARecoil_V_ToUse = pARecoil_V;
    }
    } break;
    case WEAPON_1: {
    if(sUseRapidFire == 0)
    {
        set_val(BUTTON_5, 0.0);
        if (get_actual(BUTTON_5))
        {
        if (bAutoAimPauseFire == FALSE)
        {
            set_val(BUTTON_5, 100.0);
        }
        }
    }
    if(sUseRapidFire == 1)
    {
      if (get_actual(BUTTON_5))
        {
      if (bAutoAimPauseFire == FALSE)
        {
          combo_run(sRapidFire);
        }
        }
    }
    if(sUseAntiRecoil == 1)
    {
        ARecoilDelay_ToUse = sARecoilDelay;
        ARecoil_V_ToUse = sARecoil_V;
    }
    } break;
  }
 
    if (get_actual(BUTTON_5) && time_active(BUTTON_5) >= ARecoilDelay_ToUse)
    {
      if (abs(get_actual(STICK_1_X)) < StickNoise) set_val(STICK_1_X, 0.0);
        if (abs(get_actual(STICK_1_Y)) < StickNoise) set_val(STICK_1_Y, 0.0);
        if (abs(get_actual(STICK_2_X)) < StickNoise) set_val(STICK_2_X, 0.0);
        if (abs(get_actual(STICK_2_Y)) < StickNoise) set_val(STICK_2_Y, 0.0);
        //We currently only want shoot to be on during the hold phase of rapid fire
        if (get_actual(BUTTON_8)&& get_actual(BUTTON_5))
        {
          AntiRecoil(ARecoil_V_ToUse);
        }
    }
    if (bUseAimAbuse == 1)
    {
        if (get_actual(BUTTON_8) && get_actual(BUTTON_5))
        {
            combo_run(AimAbuse);
        }
        else
        {
            bAutoAimPauseFire = FALSE;
            combo_stop(AimAbuse);
        }
    }
    if(STRAFE_MODz == 1) {
    if(get_val(BUTTON_5)) {
        combo_run(super_strafe);
    }else if(event_release(BUTTON_5)) {
        combo_stop(super_strafe);
    }
    if(is_active(STICK_2_X) || is_active(STICK_2_Y)) {
        combo_stop(super_strafe);
    }
    }
    if(STRAFE_MODz == 2) {
    if((!get_val(BUTTON_8) && get_val(BUTTON_5)) || (event_release(BUTTON_8) && get_val(BUTTON_5))) {
        combo_run(super_strafe);
    }else if(event_release(BUTTON_5)) {
        combo_stop(super_strafe);
    }
    if(is_active(STICK_2_X) || is_active(STICK_2_Y)) {
        combo_stop(super_strafe);
    }
    }
    if(STRAFE_MODz == 3) {
        #define STRAFE_OFF   0
    #define STRAFE_ON    1
    static uint8 strafe;
    if(event_active(BUTTON_8)) {
        strafe = STRAFE_ON;
        display_overlay(_1_, 500);
    } else if(is_active(BUTTON_8) && time_release(BUTTON_8) <= 200) {
        strafe = STRAFE_OFF;
        display_overlay(_0_, 500);
    }
    if(strafe == STRAFE_ON){
        combo_run(super_strafe);
    }else combo_stop(super_strafe);
    if(is_active(STICK_2_Y)){combo_stop(super_strafe);}
    if(is_active(STICK_2_X)){combo_stop(super_strafe);}
    }
    if(CROUCH_SPAM == 1)
    {
        if(get_actual(BUTTON_8) && !get_actual(BUTTON_5))
        {
            combo_run(c_spam);
        }
    }
    if(CROUCH_SPAM == 2)
    {
        if(!get_actual(BUTTON_8) && get_actual(BUTTON_5))
        {
            combo_run(c_spam);
        }
    }
    if(CROUCH_SPAM == 3)
    {
        if(get_actual(BUTTON_8) || get_actual(BUTTON_5))
        {
            combo_run(c_spam);
        }
    }
    if(CROUCH_SPAM == 4)
    {
        if(get_actual(BUTTON_8) && get_actual(BUTTON_5))
        {
            combo_run(c_spam);
        }
    }
}
}
 
combo pRapidFire
{
    set_val(BUTTON_5, 100);
    wait(phold_time);
    set_val(BUTTON_5, 0);
    wait(prest_time);
      set_val(BUTTON_5, 0);
}
 
combo sRapidFire
{
    set_val(BUTTON_5, 100);
    wait(shold_time);
    set_val(BUTTON_5, 0);
    wait(srest_time);
      set_val(BUTTON_5, 0);
}
 
combo AimAbuse
{
    bAutoAimPauseFire = FALSE;
    set_val(BUTTON_8, 100);
    wait(AutoAimHoldTime - AutoAimFirePrePauseTime);
    bAutoAimPauseFire = TRUE;
    wait(AutoAimFirePrePauseTime);
    set_val(BUTTON_8, 0.0);
    wait(AutoAimReleaseTime);
    set_val(BUTTON_8, 100);
    wait(AutoAimFirePostPauseTime);   
}
 
combo super_strafe
{
    set_val(STICK_2_X, -100);
    wait(STRAFE_SHUFFLE/2);
    set_val(STICK_2_X, 100);
    wait(STRAFE_SHUFFLE);
    set_val(STICK_2_X, 100);
    set_val(STICK_2_X, -100);
    wait(STRAFE_SHUFFLE);
    set_val(STICK_2_X, 100);
    wait(STRAFE_SHUFFLE);
    set_val(STICK_2_X, 100);
    set_val(STICK_2_X, -100);
    wait(STRAFE_SHUFFLE/2);
    set_val(STICK_2_X, 100);
}
 
combo c_spam
{
    set_val(BUTTON_15, 100.0);
    wait(CROUCH_SHUFFLE);
    set_val(BUTTON_15, 0.0);
    wait(CROUCH_SHUFFLE);
}
 
void p_update_rapidfire()
{
    printf("<center><font style='color:blue;font-size:14px;',><br>ROUNDS PER MINUTE: %.04f", prpm);
    psps = prpm/ 60.0;
    phold_time = 500.0 / psps;
    prest_time = phold_time - 1.0;
    if(prest_time < 0.0) prest_time = 0.0;   
 
    return;
}
 
void s_update_rapidfire()
{
    printf("<center><font style='color:red;font-size:14px;',><br>ROUNDS PER MINUTE: %.04f", srpm);
    ssps = srpm/ 60.0;
    shold_time = 500.0 / ssps;
    srest_time = shold_time - 1.0;
    if(srest_time < 0.0) srest_time = 0.0;   
 
    return;
}
 
void AntiRecoil(fix32 recoil) {
  fix32 RY = get_actual(22);
  fix32 RX = get_actual(21);
  fix32 modifiedRY;
 
  fix32 trueRY = (sqrt(RY*RY+(RY*RY+RX*RX))-StickNoise)/sqrt(RY*RY+RX*RX)*RY*.8;
  fix32 trueRX = (sqrt(RY*RY+(RY*RY+RX*RX))-StickNoise)/sqrt(RY*RY+RX*RX)*RX*.9;
 
  if (RY > 0.0) modifiedRY = (100.0-StickNoise-recoil)/(100.0-StickNoise)*trueRY + recoil;
  if (RY < 0.0) modifiedRY = (100.0-StickNoise+recoil)/(100.0-StickNoise)*trueRY + recoil;
 
  fix32 altradius = sqrt(trueRX*trueRX + modifiedRY*modifiedRY);
 
  fix32 finalRX = trueRX * (altradius + StickNoise)/altradius;
  fix32 finalRY = modifiedRY * (altradius + StickNoise)/altradius;
 
  if (RX*RX+RY*RY <= StickNoise*StickNoise) set_val(22,(StickNoise+recoil));
 
  if (RX*RX+RY*RY > StickNoise*StickNoise) {
    set_val(22,clamp(finalRY, -100f, 100f));
    set_val(21,clamp(finalRX, -100f, 100f));
  }
}
 
void set_weapon(uint8 new_weapon)
{
  static uint8 old_weapon;
 
    if(new_weapon == old_weapon) return;
      old_weapon = new_weapon;
      weapon = new_weapon;
 
    static uint32 timestamp;
    uint32 elapsed = system_time() - timestamp;
 
    if(!elapsed || elapsed >= 10) {
    // Set LED
    switch(weapon) {
    case WEAPON_0: { // BLUE LED
      led_set(LED_1, 100.0, 0);
      led_set(LED_2, 0.0, 0);
      led_set(LED_3, 0.0, 0);
      led_set(LED_4, 0.0, 0);
            display (4);
    } break;
    case WEAPON_1: { // RED LED
      led_set(LED_1, 0.0, 0);
      led_set(LED_2, 100.0, 0);
      led_set(LED_3, 0.0, 0);
      led_set(LED_4, 0.0, 0);
            display (5);
    } break;
    }
    timestamp = system_time();
    }
    return;
}
 
 // Display Numbers
void display (uint8 indc)
{
    uint8 VIE;
    VIE = IND[indc];
    display_overlay(VIE, 2000 );
}
 
 

TRy!
bonefisher
Lieutenant General
Lieutenant General
 
Posts: 5413
Joined: Thu Jan 29, 2015 10:49 am

Re: WarFace Script???

Postby Shthappensbro » Sat Aug 24, 2019 5:59 am

bonefisher wrote:
Code: Select all
 
#pragma METAINFO("Warface Special", 1, 0, "bonefisher")
/* Special credits goes out to DrNefario for a awesome anti-recoil function!*/
 
/* *****************************************************************************
<cfgdesc>
[Warface Special]
color          = #008000
shortdesc      = Primary/ Secondary switching enabled. If you get on wrong side just hold switch button pass 250 ms to line up class. Runtime operations for manual overrides. <br /><br /> <b><u>Runtime Operations</b></u>  <br /><br />Hold <b>[L2|LT] + </b><br /><br />Press <b>[Touch-Click|View] + [CROSS|A]</b> to quickly enable/disable the mod.
control        = info
 
[WEAPON SETTINGS:]
color          = #008000
collapsible    = 2
shortdesc      = <font color="brown">PRIMARY WEAPON ENABLE:</font> <font color="green"> Rapid Fire?</font>
byteoffset     = 0
bitsize        = 1
bitoffset      = 7
control        = checkbox
default        = 0
item           = Rapidfire ON
 
[Primary Hold Time Setting]
group          = true
shortdesc      = <font color="brown">PRIMARY ROUNDS PER MINUTE:</font> <font color="green">   Set to desired rpm setting.</font>
byteoffset     = 1
bitsize        = 32
control        = spinboxf
default        = 7500
minimum        = 0
maximum        = 12000
step           = 10
decimals       = 1
 
[Secondary Weapon Setting]
color          = #008000
group          = true
shortdesc      = <font color="brown">SECONDARY WEAPON ENABLE:</font> <font color="green"> Rapid Fire?</font>
byteoffset     = 9
bitsize        = 1
bitoffset      = 7
control        = checkbox
default        = 0
item           = Rapidfire ON
 
[Secondary Hold Time Setting]
group          = true
shortdesc      = <font color="brown">SECONDARY ROUNDS PER MINUTE:</font> <font color="green">   Set to desired rpm setting.</font>
byteoffset     = 10
bitsize        = 32
control        = spinboxf
default        = 7500
minimum        = 0
maximum        = 12000
step           = 10
decimals       = 1
 
[ANTI RECOIL SETTINGS:]
color          = #008000
collapsible    = 2
 
[Stick Noise Remover]
group          = true
shortdesc      = <font color="brown">STICK NOISE:</font> <font color="green"> Set to the resting dead zone values for your right stick.</font>
byteoffset     = 18
bitsize        = 32
control        = spinboxf
default        = 1000
minimum        = 0
maximum        = 10000
step           = 100
decimals       = 2
 
[PRIMARY ANTI RECOIL SETTINGS:]
group          = true
shortdesc      = <font color="brown">PRIMARY WEAPON:</font> <font color="green"> Anti Recoil?</font>
byteoffset     = 22
bitsize        = 1
bitoffset      = 7
control        = checkbox
default        = 1
item           = Anti Recoil ON
 
[Primary Anti Recoil Settings]
group          = true
shortdesc      = <font color="brown">PRIMARY:</font> <font color="green"> Anti Recoil Delay (In MS) after fire button is pressed.</font>
byteoffset     = 23
bitsize        = 16
control        = slider
default        = 75
minimum        = 0
maximum        = 1000
step           = 5
 
[Primary Anti Recoil]
group          = true
shortdesc      = <font color="brown">PRIMARY:</font> <font color="green"> Anti Recoil vertical pull force compensation.</font>
byteoffset     = 25
bitsize        = 32
control        = spinboxf
default        = 1600
minimum        = -10000
maximum        = 10000
step           = 50
decimals       = 2
 
[SECONDARY ANTI RECOIL SETTINGS:]
group          = true
shortdesc      = <font color="brown">SECONDARY WEAPON:</font> <font color="green"> Anti Recoil?</font>
byteoffset     = 29
bitsize        = 1
bitoffset      = 7
control        = checkbox
default        = 1
item           = Anti Recoil ON
 
[Secondary Anti Recoil Settings]
group          = true
shortdesc      = <font color="brown">SECONDARY:</font> <font color="green"> Anti Recoil Delay (In MS) after fire button is pressed.</font>
byteoffset     = 30
bitsize        = 16
control        = slider
default        = 75
minimum        = 0
maximum        = 1000
step           = 5
 
[Secondary Anti Recoil]
group          = true
shortdesc      = <font color="brown">SECONDARY:</font> <font color="green"> Anti Recoil vertical pull force compensation.</font>
byteoffset     = 32
bitsize        = 32
control        = spinboxf
default        = 1400
minimum        = -10000
maximum        = 10000
step           = 50
decimals       = 2
 
[AIM ABUSE SETTINGS:]
color          = #008000
collapsible    = 2
byteoffset     = 56
bitsize        = 1
bitoffset      = 7
control        = checkbox
default        = 0
item           = Aim Abuse
 
[Auto Aim Hold Time]
group          = true
shortdesc      = <font color="brown">Auto Aim Hold Time:</font> <font color="green"> Configure the time period, in milli-seconds, of which the ADS(Scope) button should be pressed when the aim-assist abuse is activated.
byteoffset     = 57
bitsize        = 16
control        = spinbox
default        = 350
minimum        = 20
maximum        = 5000
step           = 50
 
[Auto Aim Release Time]
group          = true
shortdesc      = <font color="brown">Auto Aim Release Time:</font> <font color="green"> Configure the time period, in milli-seconds, of which the ADS(Scope) button should be released when the aim-assist abuse is activated.
byteoffset     = 59
bitsize        = 16
control        = spinbox
default        = 80
minimum        = 10
maximum        = 5000
step           = 5
 
[Auto Aim Fire Pre Pause Time]
group          = true
shortdesc      = <font color="brown">Auto Aim Fire Pre Pause Time:</font> <font color="green"> Configure the time period, in milli-seconds, to pause rapid fire for given time before ads release.
byteoffset     = 61
bitsize        = 16
control        = spinbox
default        = 10
minimum        = 0
maximum        = 5000
step           = 5
 
[Auto Aim Fire Post Pause Time]
group          = true
shortdesc      = <font color="brown">Auto Aim Fire Post Pause Time:</font> <font color="green"> Configure the time period, in milli-seconds, to pause rapid fire for given time after ads release.
byteoffset     = 63
bitsize        = 16
control        = spinbox
default        = 10
minimum        = 0
maximum        = 5000
step           = 5
 
[STRAFE SETTINGS:]
color       = #008000
collapsible = 2
 
[Strafe MODz]
group       = true
shortdesc   = <font color="green">Strafe option.</font>
byteoffset  = 115
bitsize     = 8
control     = radiobox
default     = 0
item        = Disabled
item        = Enabled Strafe (Adjustable)
item        = Enabled Strafe(Hip only)(Adjustable)
item        = Enabled Strafe On single press ads and double press ads Off.
 
[Strafe Adjustable Setting]
group       = true
shortdesc   = <br><b><font color="green">Strafe Adjustable Setting:</font></b>
byteoffset  = 116
bitsize     = 32
control     = spinbox
default     = 400
minimum     = 0
maximum     = 2000
step        = 10
 
[CROUCH SPAM SETTINGS:]
color       = #008000
collapsible = 2
 
[Crouch Spam MODz]
group       = true
shortdesc   = <font color="green">Crouch Spam option.</font>
byteoffset  = 120
bitsize     = 8
control     = radiobox
default     = 0
item        = Disabled
item        = Enabled Crouch Spam ADS only(Adjustable)
item        = Enabled Crouch Spam Hip only(Adjustable)
item        = Enabled Crouch Spam on ADS or Fire(Adjustable).
item        = Enabled Crouch Spam while ADS + Fire(Adjustable).
 
[Crouch Spam Adjustable Setting]
group       = true
shortdesc   = <br><b><font color="green">Crouch Spam Adjustable Setting:</font></b>
byteoffset  = 121
bitsize     = 32
control     = spinbox
default     = 30
minimum     = 0
maximum     = 1000
step        = 5
</cfgdesc>
***************************************************************************** */

 
#include <display.gph>
#define wait(a)  wait((int)a);
#define WEAPON_0   0
#define WEAPON_1   1
bool modz = 1;
fix32 prpm;
fix32 psps;
fix32 phold_time, prest_time;
fix32 srpm;
fix32 ssps;
fix32 shold_time, srest_time;
bool pUseRapidFire;
bool sUseRapidFire;
uint8  weapon = 0;
fix32 StickNoise;
bool pUseAntiRecoil;
uint16 pARecoilDelay;
fix32 pARecoil_V;
bool sUseAntiRecoil;
uint16 sARecoilDelay;
fix32 sARecoil_V;
fix32 ARecoil_V_ToUse;
uint16 ARecoilDelay_ToUse;
//Aim Abuse
bool bUseAimAbuse = FALSE;
bool bAutoAimPauseFire;
int AutoAimHoldTime = 650;
int AutoAimReleaseTime = 50;
int AutoAimFirePrePauseTime = 10;
int AutoAimFirePostPauseTime = 10;
uint8 STRAFE_MODz;
uint32 STRAFE_SHUFFLE;
uint8 CROUCH_SPAM;
uint32 CROUCH_SHUFFLE;
uint32    IND[] = {
    _0_,         // 0
    _1_,         // 1
    _2_,         // 2
    _3_,         // 3
    _P_,         // 4
    _S_          // 5
};
init
{
    pmem_load();
    pUseRapidFire = (pmem_read(0) >> 7) & 0b1;
  pmem_read(1, &prpm);
    sUseRapidFire = (pmem_read(9) >> 7) & 0b1;
  pmem_read(10, &srpm);
  pmem_read(18, &StickNoise);
    pUseAntiRecoil = (pmem_read(22) >> 7) & 0b1;
  pmem_read(23, &pARecoilDelay);
  pmem_read(25, &pARecoil_V);
    sUseAntiRecoil = (pmem_read(29) >> 7) & 0b1;
  pmem_read(30, &sARecoilDelay);
  pmem_read(32, &sARecoil_V);
    bUseAimAbuse = (pmem_read(56) >> 7) & 0b1;
  pmem_read(57, &AutoAimHoldTime);
  pmem_read(59, &AutoAimReleaseTime);
  pmem_read(61, &AutoAimFirePrePauseTime);
  pmem_read(63, &AutoAimFirePostPauseTime);
    STRAFE_MODz = pmem_read(115);
  pmem_read(116, &STRAFE_SHUFFLE);
    CROUCH_SPAM = pmem_read(120);
  pmem_read(121, &CROUCH_SHUFFLE);
    set_weapon(weapon);
    p_update_rapidfire();
    s_update_rapidfire();
}
 
main
{
    if(get_actual(BUTTON_8)){
        set_val(BUTTON_2, 0.0);
        if(get_actual(BUTTON_2) && event_active(BUTTON_16)){
            modz = !modz;
        }
    }
    if(modz==1){
    //--------------------------WEAPON-SWITCHING----------------------------------//
  if(event_release(BUTTON_14) && time_active(BUTTON_14) < 250){
    if(weapon == WEAPON_0) set_weapon(WEAPON_1);
    else if(weapon == WEAPON_1) set_weapon(WEAPON_0);
    }
 
    switch(weapon) {
    case WEAPON_0: {
    if(pUseRapidFire == 0)
    {
        set_val(BUTTON_5, 0.0);
        if (get_actual(BUTTON_5))
        {
        if (bAutoAimPauseFire == FALSE)
        {
            set_val(BUTTON_5, 100.0);
        }
        }
    }
    if(pUseRapidFire == 1)
    {
        if (get_actual(BUTTON_5))
        {
        if (bAutoAimPauseFire == FALSE)
        {
            combo_run(pRapidFire);
        }
        }
    }
    if(pUseAntiRecoil == 1)
    {
        ARecoilDelay_ToUse = pARecoilDelay;
        ARecoil_V_ToUse = pARecoil_V;
    }
    } break;
    case WEAPON_1: {
    if(sUseRapidFire == 0)
    {
        set_val(BUTTON_5, 0.0);
        if (get_actual(BUTTON_5))
        {
        if (bAutoAimPauseFire == FALSE)
        {
            set_val(BUTTON_5, 100.0);
        }
        }
    }
    if(sUseRapidFire == 1)
    {
      if (get_actual(BUTTON_5))
        {
      if (bAutoAimPauseFire == FALSE)
        {
          combo_run(sRapidFire);
        }
        }
    }
    if(sUseAntiRecoil == 1)
    {
        ARecoilDelay_ToUse = sARecoilDelay;
        ARecoil_V_ToUse = sARecoil_V;
    }
    } break;
  }
 
    if (get_actual(BUTTON_5) && time_active(BUTTON_5) >= ARecoilDelay_ToUse)
    {
      if (abs(get_actual(STICK_1_X)) < StickNoise) set_val(STICK_1_X, 0.0);
        if (abs(get_actual(STICK_1_Y)) < StickNoise) set_val(STICK_1_Y, 0.0);
        if (abs(get_actual(STICK_2_X)) < StickNoise) set_val(STICK_2_X, 0.0);
        if (abs(get_actual(STICK_2_Y)) < StickNoise) set_val(STICK_2_Y, 0.0);
        //We currently only want shoot to be on during the hold phase of rapid fire
        if (get_actual(BUTTON_8)&& get_actual(BUTTON_5))
        {
          AntiRecoil(ARecoil_V_ToUse);
        }
    }
    if (bUseAimAbuse == 1)
    {
        if (get_actual(BUTTON_8) && get_actual(BUTTON_5))
        {
            combo_run(AimAbuse);
        }
        else
        {
            bAutoAimPauseFire = FALSE;
            combo_stop(AimAbuse);
        }
    }
    if(STRAFE_MODz == 1) {
    if(get_val(BUTTON_5)) {
        combo_run(super_strafe);
    }else if(event_release(BUTTON_5)) {
        combo_stop(super_strafe);
    }
    if(is_active(STICK_2_X) || is_active(STICK_2_Y)) {
        combo_stop(super_strafe);
    }
    }
    if(STRAFE_MODz == 2) {
    if((!get_val(BUTTON_8) && get_val(BUTTON_5)) || (event_release(BUTTON_8) && get_val(BUTTON_5))) {
        combo_run(super_strafe);
    }else if(event_release(BUTTON_5)) {
        combo_stop(super_strafe);
    }
    if(is_active(STICK_2_X) || is_active(STICK_2_Y)) {
        combo_stop(super_strafe);
    }
    }
    if(STRAFE_MODz == 3) {
        #define STRAFE_OFF   0
    #define STRAFE_ON    1
    static uint8 strafe;
    if(event_active(BUTTON_8)) {
        strafe = STRAFE_ON;
        display_overlay(_1_, 500);
    } else if(is_active(BUTTON_8) && time_release(BUTTON_8) <= 200) {
        strafe = STRAFE_OFF;
        display_overlay(_0_, 500);
    }
    if(strafe == STRAFE_ON){
        combo_run(super_strafe);
    }else combo_stop(super_strafe);
    if(is_active(STICK_2_Y)){combo_stop(super_strafe);}
    if(is_active(STICK_2_X)){combo_stop(super_strafe);}
    }
    if(CROUCH_SPAM == 1)
    {
        if(get_actual(BUTTON_8) && !get_actual(BUTTON_5))
        {
            combo_run(c_spam);
        }
    }
    if(CROUCH_SPAM == 2)
    {
        if(!get_actual(BUTTON_8) && get_actual(BUTTON_5))
        {
            combo_run(c_spam);
        }
    }
    if(CROUCH_SPAM == 3)
    {
        if(get_actual(BUTTON_8) || get_actual(BUTTON_5))
        {
            combo_run(c_spam);
        }
    }
    if(CROUCH_SPAM == 4)
    {
        if(get_actual(BUTTON_8) && get_actual(BUTTON_5))
        {
            combo_run(c_spam);
        }
    }
}
}
 
combo pRapidFire
{
    set_val(BUTTON_5, 100);
    wait(phold_time);
    set_val(BUTTON_5, 0);
    wait(prest_time);
      set_val(BUTTON_5, 0);
}
 
combo sRapidFire
{
    set_val(BUTTON_5, 100);
    wait(shold_time);
    set_val(BUTTON_5, 0);
    wait(srest_time);
      set_val(BUTTON_5, 0);
}
 
combo AimAbuse
{
    bAutoAimPauseFire = FALSE;
    set_val(BUTTON_8, 100);
    wait(AutoAimHoldTime - AutoAimFirePrePauseTime);
    bAutoAimPauseFire = TRUE;
    wait(AutoAimFirePrePauseTime);
    set_val(BUTTON_8, 0.0);
    wait(AutoAimReleaseTime);
    set_val(BUTTON_8, 100);
    wait(AutoAimFirePostPauseTime);   
}
 
combo super_strafe
{
    set_val(STICK_2_X, -100);
    wait(STRAFE_SHUFFLE/2);
    set_val(STICK_2_X, 100);
    wait(STRAFE_SHUFFLE);
    set_val(STICK_2_X, 100);
    set_val(STICK_2_X, -100);
    wait(STRAFE_SHUFFLE);
    set_val(STICK_2_X, 100);
    wait(STRAFE_SHUFFLE);
    set_val(STICK_2_X, 100);
    set_val(STICK_2_X, -100);
    wait(STRAFE_SHUFFLE/2);
    set_val(STICK_2_X, 100);
}
 
combo c_spam
{
    set_val(BUTTON_15, 100.0);
    wait(CROUCH_SHUFFLE);
    set_val(BUTTON_15, 0.0);
    wait(CROUCH_SHUFFLE);
}
 
void p_update_rapidfire()
{
    printf("<center><font style='color:blue;font-size:14px;',><br>ROUNDS PER MINUTE: %.04f", prpm);
    psps = prpm/ 60.0;
    phold_time = 500.0 / psps;
    prest_time = phold_time - 1.0;
    if(prest_time < 0.0) prest_time = 0.0;   
 
    return;
}
 
void s_update_rapidfire()
{
    printf("<center><font style='color:red;font-size:14px;',><br>ROUNDS PER MINUTE: %.04f", srpm);
    ssps = srpm/ 60.0;
    shold_time = 500.0 / ssps;
    srest_time = shold_time - 1.0;
    if(srest_time < 0.0) srest_time = 0.0;   
 
    return;
}
 
void AntiRecoil(fix32 recoil) {
  fix32 RY = get_actual(22);
  fix32 RX = get_actual(21);
  fix32 modifiedRY;
 
  fix32 trueRY = (sqrt(RY*RY+(RY*RY+RX*RX))-StickNoise)/sqrt(RY*RY+RX*RX)*RY*.8;
  fix32 trueRX = (sqrt(RY*RY+(RY*RY+RX*RX))-StickNoise)/sqrt(RY*RY+RX*RX)*RX*.9;
 
  if (RY > 0.0) modifiedRY = (100.0-StickNoise-recoil)/(100.0-StickNoise)*trueRY + recoil;
  if (RY < 0.0) modifiedRY = (100.0-StickNoise+recoil)/(100.0-StickNoise)*trueRY + recoil;
 
  fix32 altradius = sqrt(trueRX*trueRX + modifiedRY*modifiedRY);
 
  fix32 finalRX = trueRX * (altradius + StickNoise)/altradius;
  fix32 finalRY = modifiedRY * (altradius + StickNoise)/altradius;
 
  if (RX*RX+RY*RY <= StickNoise*StickNoise) set_val(22,(StickNoise+recoil));
 
  if (RX*RX+RY*RY > StickNoise*StickNoise) {
    set_val(22,clamp(finalRY, -100f, 100f));
    set_val(21,clamp(finalRX, -100f, 100f));
  }
}
 
void set_weapon(uint8 new_weapon)
{
  static uint8 old_weapon;
 
    if(new_weapon == old_weapon) return;
      old_weapon = new_weapon;
      weapon = new_weapon;
 
    static uint32 timestamp;
    uint32 elapsed = system_time() - timestamp;
 
    if(!elapsed || elapsed >= 10) {
    // Set LED
    switch(weapon) {
    case WEAPON_0: { // BLUE LED
      led_set(LED_1, 100.0, 0);
      led_set(LED_2, 0.0, 0);
      led_set(LED_3, 0.0, 0);
      led_set(LED_4, 0.0, 0);
            display (4);
    } break;
    case WEAPON_1: { // RED LED
      led_set(LED_1, 0.0, 0);
      led_set(LED_2, 100.0, 0);
      led_set(LED_3, 0.0, 0);
      led_set(LED_4, 0.0, 0);
            display (5);
    } break;
    }
    timestamp = system_time();
    }
    return;
}
 
 // Display Numbers
void display (uint8 indc)
{
    uint8 VIE;
    VIE = IND[indc];
    display_overlay(VIE, 2000 );
}
 
 

TRy!




yes i think thats it ill try her out
User avatar
Shthappensbro
Major
Major
 
Posts: 754
Joined: Wed Aug 16, 2017 4:55 pm

Re: WarFace Script???

Postby Shthappensbro » Sat Aug 24, 2019 6:15 am

Mine adding a future where if u tap rs twice it turns it off tell u tap it again?? so u can fire over cover ? or something??
User avatar
Shthappensbro
Major
Major
 
Posts: 754
Joined: Wed Aug 16, 2017 4:55 pm

Re: WarFace Script???

Postby Shthappensbro » Sat Aug 24, 2019 8:13 pm

bonefisher wrote:So you want to aim and have fire trigger set it off



Hey anyway u can probably add why crouch spamming it keeps press LS Down too ? So I dont get stuck in crouch mode after firing?
User avatar
Shthappensbro
Major
Major
 
Posts: 754
Joined: Wed Aug 16, 2017 4:55 pm

Re: WarFace Script???

Postby bonefisher » Sat Aug 24, 2019 9:41 pm

JamesCaywood wrote:
bonefisher wrote:So you want to aim and have fire trigger set it off



Hey anyway u can probably add why crouch spamming it keeps press LS Down too ? So I dont get stuck in crouch mode after firing?

That isn't going to help....so how do you like getting push out in open when a player of your own comes up behind you while your in a gun fight pushing you out and nothing you can do or when the aim sticky locks in on your to hold you there for a second to get you shot....lol! Game needs some serious help!
bonefisher
Lieutenant General
Lieutenant General
 
Posts: 5413
Joined: Thu Jan 29, 2015 10:49 am

Re: WarFace Script???

Postby Shthappensbro » Sat Aug 24, 2019 10:11 pm

bonefisher wrote:
JamesCaywood wrote:
bonefisher wrote:So you want to aim and have fire trigger set it off



Hey anyway u can probably add why crouch spamming it keeps press LS Down too ? So I dont get stuck in crouch mode after firing?

That isn't going to help....so how do you like getting push out in open when a player of your own comes up behind you while your in a gun fight pushing you out and nothing you can do or when the aim sticky locks in on your to hold you there for a second to get you shot....lol! Game needs some serious help!



yes it sucks i hate it lol they need to fix it ppl need to start putting in feed back for that u know and u think that wont help?? since u sprint with it??
User avatar
Shthappensbro
Major
Major
 
Posts: 754
Joined: Wed Aug 16, 2017 4:55 pm

Re: WarFace Script???

Postby Shthappensbro » Sat Aug 24, 2019 10:37 pm

bonefisher wrote:So you want to aim and have fire trigger set it off




https://support.my.com/games/kbPage/1758/


ill subment one too :D u playing on xbox?

about to stream watch me go off

https://mixer.com/ScaryFawn631545?vod=- ... hJ99Lc6t9w
User avatar
Shthappensbro
Major
Major
 
Posts: 754
Joined: Wed Aug 16, 2017 4:55 pm

Re: WarFace Script???

Postby bonefisher » Sat Aug 24, 2019 10:44 pm

On the aim abuse try these settings 320, 15, 15, 15.....
bonefisher
Lieutenant General
Lieutenant General
 
Posts: 5413
Joined: Thu Jan 29, 2015 10:49 am

PreviousNext

Return to GPC2 Script Programming

Who is online

Users browsing this forum: No registered users and 85 guests