Please Help convert for Titan One
2 posts
• Page 1 of 1
Please Help convert for Titan One
- Code: Select all
// Define the refresh rate of the combo
// Big value --> effect not perceived
// Small value --> cause aim jitter
//
define Sampling_Time = 10;
//
//#################################################################################################
//
// Add speed boost to initial joystick movement
// Big value --> you loose sticky aim bubble
//
define Aim_Boost = 7;
//
//#################################################################################################
//
// Compensate the acceleration of the movement introduced by the boost by reducing this value
//
define Aim_Correction = 12;
//
//#################################################################################################
//
// the algorithm saves two movements positions. the current position and the previous position.
// sampling frequency is defined by Sampling_Time.
// if the difference between the current value and the preceding value doesn't exceeds Aim_Perfection_Limit.
// the aimbot algorithm will execute
// i add this parameter to avoid floaty movement when you try to track a target
//
define Aim_Perfection_Limit = 30;
//
//#################################################################################################
//
//operating aim perfection interval
//
define POS_Aim_Limit = 70;
define NEG_Aim_Limit = -70;
//
//#################################################################################################
//
//operating spiroide aim assist interval
//
define POS_Micro_MVT_Limit = 25;
define NEG_Micro_MVT_Limit = -25;
//
define SPOT = 100; //auto-spot modifier
define SPOT_BUTTON = PS4_R1; //tap RB to turn on/off AutoSpot
//
//#################################################################################################
//######################################### Script variable #######################################
//#################################################################################################
//
// Dont't change!
//
int X_Last_Value = 0;
int Y_Last_Value = 0;
int X_Current_Value = 0;
int Y_Current_Value = 0;
int Sampling_Done = FALSE;
//
int spiroide_pulse = 0;
int fine_pulse = 0;
int d_tap;
int RF_KS=FALSE;
int Anti_Recoil_Value = 15;
//
// Joystick calibration value
int Joystick_calibration = FALSE;
int RX_Axis_Joystick_calibrate = 0;
int RY_Axis_Joystick_calibrate = 0;
//
//#################################################################################################
//############################################# MAIN ##############################################
//#################################################################################################
//
main {
//--this order to eliminate need for else (saves 3 bytes)
if(get_val (7) && event_press(16)){
RF_KS=!RF_KS;
}
if(event_press(19) && !d_tap)
d_tap = 250; //--max ms between taps
if(d_tap)
d_tap -= 10;
// AUTOSPOT
if (get_val(PS4_R2))combo_run(AutoSpot);
if (Joystick_calibration == FALSE)
{
RX_Axis_Joystick_calibrate = get_val(PS4_RX);
RY_Axis_Joystick_calibrate = get_val(PS4_RY);
Joystick_calibration = TRUE;
}
X_Last_Value = X_Current_Value;
Y_Last_Value = Y_Current_Value;
X_Current_Value = get_lval(PS4_RX)- RX_Axis_Joystick_calibrate;
Y_Current_Value = get_lval(PS4_RY)- RY_Axis_Joystick_calibrate;
//--LT pulled
if(get_val(PS4_L2))
{
//--current & last value less than limit
if(abs(X_Current_Value) <= POS_Micro_MVT_Limit && abs(Y_Current_Value) <= POS_Micro_MVT_Limit)
{
//--both have a value
//if(X_Last_Value && X_Current_Value)
//{
//--difference between the 2 values less than 15
if(abs(X_Last_Value - X_Current_Value) < 15)
{
combo_stop(Aim_Assist_Perfection);
Sampling_Done = FALSE;
//--RT pulled more than 95%
if(get_val(PS4_R2) > 95)
{
combo_stop(Fine_Tune_Aim);
fine_pulse = 0;
combo_run(spiroide_Aim_Assit);
}
else
{
combo_stop(spiroide_Aim_Assit);
spiroide_pulse = 0;
combo_run(Fine_Tune_Aim);
}
}
//}
}
//--current and last greater than limit
else if(abs(X_Current_Value) <= POS_Aim_Limit && abs(Y_Current_Value) <= POS_Aim_Limit)
{
combo_stop(Fine_Tune_Aim);
combo_stop(spiroide_Aim_Assit);
spiroide_pulse = 0;
fine_pulse = 0;
combo_run(Aim_Assist_Perfection);
}
}
else //--LT not pulled
{
combo_stop(Fine_Tune_Aim);
combo_stop(spiroide_Aim_Assit);
combo_stop(Aim_Assist_Perfection);
spiroide_pulse = 0;
fine_pulse = 0;
Sampling_Done = FALSE;
}
{
vm_tctrl(+7); // 17ms update time - Matches frame rate better, more inputs per second
if(get_val(XB1_LT)) // LT Hair Trigger
set_val(XB1_LT,100);
if(get_val(XB1_RT)) // RT Hair Trigger
set_val(XB1_RT,100);
if(get_val(XB1_RT) && get_val(XB1_RY) < Anti_Recoil_Value && get_val(XB1_RY) > -15) // Anti-Recoil
set_val(XB1_RY,Anti_Recoil_Value);
}
if (RF_KS && get_val(4))combo_run (RAPID_FIRE);
}
//
//#################################################################################################
//############################################ COMBO ##############################################
//#################################################################################################
//
combo Aim_Assist_Perfection
{
// Save the first joystick position
X_Last_Value = X_Current_Value
Y_Last_Value = Y_Current_Value
// Sampling frequency
wait(Sampling_Time);
// Save the second joystick position
X_Current_Value = get_lval(PS4_RX)- RX_Axis_Joystick_calibrate;
Y_Current_Value = get_lval(PS4_RY)- RY_Axis_Joystick_calibrate;
if (Sampling_Done == TRUE )
{
//Applying BOOST
//Aim_Perfection(Last_Value, Current_Value, Boost, Correction, X_AXIS, Y_AXIS )
Aim_Perfection(X_Last_Value, X_Current_Value, 1, 0, 1, 0 );
Aim_Perfection(Y_Last_Value, Y_Current_Value, 1, 0, 0, 1 );
}
X_Last_Value = X_Current_Value;
Y_Last_Value = Y_Current_Value;
// Sampling frequency
wait(Sampling_Time);
// Save the second joystick position
X_Current_Value = get_lval(PS4_RX)- RX_Axis_Joystick_calibrate;
Y_Current_Value = get_lval(PS4_RY)- RX_Axis_Joystick_calibrate;
if (Sampling_Done == TRUE )
{
//Applying CORRECTION
//Aim_Perfection(Last_Value, Current_Value, Boost, Correction, X_AXIS, Y_AXIS )
Aim_Perfection(X_Last_Value, X_Current_Value, 0, 1, 1, 0 );
Aim_Perfection(Y_Last_Value, Y_Current_Value, 0, 1, 0, 1 );
}
Sampling_Done = TRUE;
wait(Sampling_Time);
}
combo Fine_Tune_Aim {
set_val(PS4_RX,(15 - fine_pulse));//right
set_val(PS4_LX,(-15 + fine_pulse));//move left
wait(Sampling_Time);
wait(Sampling_Time);
wait(Sampling_Time);
set_val(PS4_RX,(15 - fine_pulse));//right+down
set_val(PS4_RY,(10 - fine_pulse));
set_val(PS4_LX,(-5 + fine_pulse));//move left
wait(Sampling_Time);
wait(Sampling_Time);
wait(Sampling_Time);
set_val(PS4_RY,(10 - fine_pulse));// down
wait(Sampling_Time);
wait(Sampling_Time);
wait(Sampling_Time);
wait(Sampling_Time);
set_val(PS4_RX,(-15 + fine_pulse));//left+down
set_val(PS4_RY,(10 - fine_pulse));
set_val(PS4_LX,(5 - fine_pulse))//move right
wait(Sampling_Time);
wait(Sampling_Time)
wait(Sampling_Time)
set_val(PS4_RX,(-15 + fine_pulse));// left
set_val(PS4_LX,(15 - fine_pulse))//move right
wait(Sampling_Time);
wait(Sampling_Time);
wait(Sampling_Time);
set_val(PS4_RX,(-15 + fine_pulse)); //left + up
set_val(PS4_RY,(-10 + fine_pulse));
set_val(PS4_LX,(5 - fine_pulse))//move right
wait(Sampling_Time);
wait(Sampling_Time);
wait(Sampling_Time);
set_val(PS4_RY,(-10 + fine_pulse)); //up
wait(Sampling_Time);
wait(Sampling_Time);
wait(Sampling_Time);
wait(Sampling_Time);
set_val(PS4_RX,(15 - fine_pulse));//right+up
set_val(PS4_RY,(-10 + fine_pulse));
set_val(PS4_LX,(-5 + fine_pulse))//move left
wait(Sampling_Time);
wait(Sampling_Time);
fine_pulse = fine_pulse + 2;
if ( fine_pulse >10)
{
fine_pulse = 0;
}
}
combo spiroide_Aim_Assit {
set_val(PS4_RX,(4 + spiroide_pulse));//right
set_val(PS4_LX,(-15+ spiroide_pulse));//move left
wait(Sampling_Time);
wait(Sampling_Time);
set_val(PS4_RY,(5 + spiroide_pulse));// down
wait(Sampling_Time);
wait(Sampling_Time);
wait(Sampling_Time);
wait(Sampling_Time);
set_val(PS4_RX,(-4 - spiroide_pulse));//left
set_val(PS4_LX,15 - spiroide_pulse );//move right
wait(Sampling_Time);
wait(Sampling_Time)
set_val(PS4_RY,(5 + spiroide_pulse));// down
wait(Sampling_Time);
wait(Sampling_Time);
wait(Sampling_Time);
wait(Sampling_Time);
spiroide_pulse = spiroide_pulse + 2;
if ( spiroide_pulse >10)
{
spiroide_pulse = 0;
}
}
combo RAPID_FIRE {
set_val(4,100);
wait(12);
set_val(4, 0);
wait(18);
}
//Autospot
combo AutoSpot {//begin
set_val(SPOT_BUTTON, 100);
wait(150);
set_val(SPOT_BUTTON, 0);
wait(SPOT);
}//end
function Aim_Perfection(Last_Value, Current_Value, Boost, Correction, X_AXIS, Y_AXIS )
{
// Thanks Batts for help <img src="images/smilies/animated/smile_20_anim.gif" border="0" alt="" title="Smile" class="inlineimg" />
if(abs(Last_Value - Current_Value) < Aim_Perfection_Limit)
{
//--moving right
if(Last_Value < Current_Value)
{
if (Boost)
{
if (X_AXIS)
set_val(PS4_RX, (Current_Value + Aim_Boost));
if (Y_AXIS)
set_val(PS4_RY, (Current_Value + Aim_Boost));
}
else if(Correction)
{
if (X_AXIS)
set_val(PS4_RX, (Current_Value - Aim_Correction));
if (Y_AXIS)
set_val(PS4_RY, (Current_Value - Aim_Correction));
}
}
else //--moving left
{
if (Boost)
{
if (X_AXIS)
set_val(PS4_RX, (Current_Value - Aim_Boost));
if (Y_AXIS)
set_val(PS4_RY, (Current_Value - Aim_Boost));
}
else if(Correction)
{
if (X_AXIS)
set_val(PS4_RX, (Current_Value + Aim_Correction));
if (Y_AXIS)
set_val(PS4_RY, (Current_Value + Aim_Correction));
}
}
}
}
//
//#################################################################################################
//############################################# END ###############################################
//#################################################################################################
-
sebascu - Sergeant Major
- Posts: 68
- Joined: Sat Aug 03, 2019 5:32 pm
Re: Please Help convert for Titan One
Converted:
- Code: Select all
// Define the refresh rate of the combo
// Big value --> effect not perceived
// Small value --> cause aim jitter
//
define Sampling_Time = 10;
//
//#################################################################################################
//
// Add speed boost to initial joystick movement
// Big value --> you loose sticky aim bubble
//
define Aim_Boost = 7;
//
//#################################################################################################
//
// Compensate the acceleration of the movement introduced by the boost by reducing this value
//
define Aim_Correction = 12;
//
//#################################################################################################
//
// the algorithm saves two movements positions. the current position and the previous position.
// sampling frequency is defined by Sampling_Time.
// if the difference between the current value and the preceding value doesn't exceeds Aim_Perfection_Limit.
// the aimbot algorithm will execute
// i add this parameter to avoid floaty movement when you try to track a target
//
define Aim_Perfection_Limit = 30;
//
//#################################################################################################
//
//operating aim perfection interval
//
define POS_Aim_Limit = 70;
int NEG_Aim_Limit = -70;
//
//#################################################################################################
//
//operating spiroide aim assist interval
//
define POS_Micro_MVT_Limit = 25;
int NEG_Micro_MVT_Limit = -25;
//
define SPOT = 100; //auto-spot modifier
define SPOT_BUTTON = PS4_R1; //tap RB to turn on/off AutoSpot
//
//#################################################################################################
//######################################### Script variable #######################################
//#################################################################################################
//
// Dont't change!
//
int X_Last_Value = 0;
int Y_Last_Value = 0;
int X_Current_Value = 0;
int Y_Current_Value = 0;
int Sampling_Done = FALSE;
//
int spiroide_pulse = 0;
int fine_pulse = 0;
int d_tap;
int RF_KS=FALSE;
int Anti_Recoil_Value = 15;
//
// Joystick calibration value
int Joystick_calibration = FALSE;
int RX_Axis_Joystick_calibrate = 0;
int RY_Axis_Joystick_calibrate = 0;
//
//#################################################################################################
//############################################# MAIN ##############################################
//#################################################################################################
//
main {
//--this order to eliminate need for else (saves 3 bytes)
if(get_val (7) && event_press(16)){
RF_KS=!RF_KS;
}
if(event_press(19) && !d_tap)
d_tap = 250; //--max ms between taps
if(d_tap)
d_tap = d_tap - 10;
// AUTOSPOT
if (get_val(PS4_R2))combo_run(AutoSpot);
if (Joystick_calibration == FALSE)
{
RX_Axis_Joystick_calibrate = get_val(PS4_RX);
RY_Axis_Joystick_calibrate = get_val(PS4_RY);
Joystick_calibration = TRUE;
}
X_Last_Value = X_Current_Value;
Y_Last_Value = Y_Current_Value;
X_Current_Value = get_lval(PS4_RX)- RX_Axis_Joystick_calibrate;
Y_Current_Value = get_lval(PS4_RY)- RY_Axis_Joystick_calibrate;
//--LT pulled
if(get_val(PS4_L2))
{
//--current & last value less than limit
if(abs(X_Current_Value) <= POS_Micro_MVT_Limit && abs(Y_Current_Value) <= POS_Micro_MVT_Limit)
{
//--both have a value
//if(X_Last_Value && X_Current_Value)
//{
//--difference between the 2 values less than 15
if(abs(X_Last_Value - X_Current_Value) < 15)
{
combo_stop(Aim_Assist_Perfection);
Sampling_Done = FALSE;
//--RT pulled more than 95%
if(get_val(PS4_R2) > 95)
{
combo_stop(Fine_Tune_Aim);
fine_pulse = 0;
combo_run(spiroide_Aim_Assit);
}
else
{
combo_stop(spiroide_Aim_Assit);
spiroide_pulse = 0;
combo_run(Fine_Tune_Aim);
}
}
//}
}
//--current and last greater than limit
else if(abs(X_Current_Value) <= POS_Aim_Limit && abs(Y_Current_Value) <= POS_Aim_Limit)
{
combo_stop(Fine_Tune_Aim);
combo_stop(spiroide_Aim_Assit);
spiroide_pulse = 0;
fine_pulse = 0;
combo_run(Aim_Assist_Perfection);
}
}
else //--LT not pulled
{
combo_stop(Fine_Tune_Aim);
combo_stop(spiroide_Aim_Assit);
combo_stop(Aim_Assist_Perfection);
spiroide_pulse = 0;
fine_pulse = 0;
Sampling_Done = FALSE;
}
vm_tctrl(+7); // 17ms update time - Matches frame rate better, more inputs per second
if(get_val(XB1_LT)) // LT Hair Trigger
set_val(XB1_LT,100);
if(get_val(XB1_RT)) // RT Hair Trigger
set_val(XB1_RT,100);
if(get_val(XB1_RT) && get_val(XB1_RY) < Anti_Recoil_Value && get_val(XB1_RY) > -15) // Anti-Recoil
set_val(XB1_RY,Anti_Recoil_Value);
if (RF_KS && get_val(4))combo_run (RAPID_FIRE);
}
//
//#################################################################################################
//############################################ COMBO ##############################################
//#################################################################################################
//
combo Aim_Assist_Perfection
{
// Save the first joystick position
X_Last_Value = X_Current_Value
Y_Last_Value = Y_Current_Value
// Sampling frequency
wait(Sampling_Time);
// Save the second joystick position
X_Current_Value = get_lval(PS4_RX)- RX_Axis_Joystick_calibrate;
Y_Current_Value = get_lval(PS4_RY)- RY_Axis_Joystick_calibrate;
if (Sampling_Done == TRUE )
{
//Applying BOOST
//Aim_Perfection(Last_Value, Current_Value, Boost, Correction, X_AXIS, Y_AXIS )
Aim_Perfection(X_Last_Value, X_Current_Value, 1, 0, 1, 0 );
Aim_Perfection(Y_Last_Value, Y_Current_Value, 1, 0, 0, 1 );
}
X_Last_Value = X_Current_Value;
Y_Last_Value = Y_Current_Value;
// Sampling frequency
wait(Sampling_Time);
// Save the second joystick position
X_Current_Value = get_lval(PS4_RX)- RX_Axis_Joystick_calibrate;
Y_Current_Value = get_lval(PS4_RY)- RX_Axis_Joystick_calibrate;
if (Sampling_Done == TRUE )
{
//Applying CORRECTION
//Aim_Perfection(Last_Value, Current_Value, Boost, Correction, X_AXIS, Y_AXIS )
Aim_Perfection(X_Last_Value, X_Current_Value, 0, 1, 1, 0 );
Aim_Perfection(Y_Last_Value, Y_Current_Value, 0, 1, 0, 1 );
}
Sampling_Done = TRUE;
wait(Sampling_Time);
}
combo Fine_Tune_Aim {
set_val(PS4_RX,(15 - fine_pulse));//right
set_val(PS4_LX,(-15 + fine_pulse));//move left
wait(Sampling_Time);
wait(Sampling_Time);
wait(Sampling_Time);
set_val(PS4_RX,(15 - fine_pulse));//right+down
set_val(PS4_RY,(10 - fine_pulse));
set_val(PS4_LX,(-5 + fine_pulse));//move left
wait(Sampling_Time);
wait(Sampling_Time);
wait(Sampling_Time);
set_val(PS4_RY,(10 - fine_pulse));// down
wait(Sampling_Time);
wait(Sampling_Time);
wait(Sampling_Time);
wait(Sampling_Time);
set_val(PS4_RX,(-15 + fine_pulse));//left+down
set_val(PS4_RY,(10 - fine_pulse));
set_val(PS4_LX,(5 - fine_pulse))//move right
wait(Sampling_Time);
wait(Sampling_Time)
wait(Sampling_Time)
set_val(PS4_RX,(-15 + fine_pulse));// left
set_val(PS4_LX,(15 - fine_pulse))//move right
wait(Sampling_Time);
wait(Sampling_Time);
wait(Sampling_Time);
set_val(PS4_RX,(-15 + fine_pulse)); //left + up
set_val(PS4_RY,(-10 + fine_pulse));
set_val(PS4_LX,(5 - fine_pulse))//move right
wait(Sampling_Time);
wait(Sampling_Time);
wait(Sampling_Time);
set_val(PS4_RY,(-10 + fine_pulse)); //up
wait(Sampling_Time);
wait(Sampling_Time);
wait(Sampling_Time);
wait(Sampling_Time);
set_val(PS4_RX,(15 - fine_pulse));//right+up
set_val(PS4_RY,(-10 + fine_pulse));
set_val(PS4_LX,(-5 + fine_pulse))//move left
wait(Sampling_Time);
wait(Sampling_Time);
fine_pulse = fine_pulse + 2;
if ( fine_pulse >10)
{
fine_pulse = 0;
}
}
combo spiroide_Aim_Assit {
set_val(PS4_RX,(4 + spiroide_pulse));//right
set_val(PS4_LX,(-15+ spiroide_pulse));//move left
wait(Sampling_Time);
wait(Sampling_Time);
set_val(PS4_RY,(5 + spiroide_pulse));// down
wait(Sampling_Time);
wait(Sampling_Time);
wait(Sampling_Time);
wait(Sampling_Time);
set_val(PS4_RX,(-4 - spiroide_pulse));//left
set_val(PS4_LX,15 - spiroide_pulse );//move right
wait(Sampling_Time);
wait(Sampling_Time)
set_val(PS4_RY,(5 + spiroide_pulse));// down
wait(Sampling_Time);
wait(Sampling_Time);
wait(Sampling_Time);
wait(Sampling_Time);
spiroide_pulse = spiroide_pulse + 2;
if ( spiroide_pulse >10)
{
spiroide_pulse = 0;
}
}
combo RAPID_FIRE {
set_val(4,100);
wait(12);
set_val(4, 0);
wait(18);
}
//Autospot
combo AutoSpot {//begin
set_val(SPOT_BUTTON, 100);
wait(150);
set_val(SPOT_BUTTON, 0);
wait(SPOT);
}//end
function Aim_Perfection(Last_Value, Current_Value, Boost, Correction, X_AXIS, Y_AXIS )
{
// Thanks Batts for help <img src="images/smilies/animated/smile_20_anim.gif" border="0" alt="" title="Smile" class="inlineimg" />
if(abs(Last_Value - Current_Value) < Aim_Perfection_Limit)
{
//--moving right
if(Last_Value < Current_Value)
{
if (Boost)
{
if (X_AXIS)
set_val(PS4_RX, (Current_Value + Aim_Boost));
if (Y_AXIS)
set_val(PS4_RY, (Current_Value + Aim_Boost));
}
else if(Correction)
{
if (X_AXIS)
set_val(PS4_RX, (Current_Value - Aim_Correction));
if (Y_AXIS)
set_val(PS4_RY, (Current_Value - Aim_Correction));
}
}
else //--moving left
{
if (Boost)
{
if (X_AXIS)
set_val(PS4_RX, (Current_Value - Aim_Boost));
if (Y_AXIS)
set_val(PS4_RY, (Current_Value - Aim_Boost));
}
else if(Correction)
{
if (X_AXIS)
set_val(PS4_RX, (Current_Value + Aim_Correction));
if (Y_AXIS)
set_val(PS4_RY, (Current_Value + Aim_Correction));
}
}
}
}
//
//#################################################################################################
//############################################# END ###############################################
//#################################################################################################
ConsoleTuner Support Team
-
J2Kbr - General of the Army
- Posts: 20323
- Joined: Tue Mar 18, 2014 1:39 pm
2 posts
• Page 1 of 1
Return to GPC1 Script Programming
Who is online
Users browsing this forum: No registered users and 83 guests