Pablo's Beginners Guide to Scripting for PC

Tutorials, How-tos and FAQs for the Titan Two device.

Re: Pablo's Beginners Guide to Scripting for PC

Postby pablosscripts » Fri Sep 13, 2019 4:54 pm

Bumping this as there might be people out there wanting to script for "PC" now that Modern Warfare supports native M&KB on PS4 / Xbox now. This is a perfect use case for it.
Setup: XIM Apex, T2, K780 keyboard, G Pro Wireless mouse, SteelSeries 4HD pad, DXRacer armrest, LucidSound LS30 headset, Netduma router, Ubiquiti UniFi AP LR

My R6 script: https://youtu.be/x-9NtxyySVM
User avatar
pablosscripts
Colonel
Colonel
 
Posts: 1961
Joined: Tue Nov 24, 2015 6:27 am

Re: Pablo's Beginners Guide to Scripting for PC

Postby GamingScene » Sun Apr 26, 2020 8:01 am

Is this no longer possible? As I've tried with no luck.

Is there a special setup?

Basically what I'm doing is my exact setup from console then unplugging the USB that goes to my console and plugging that USB into my PC. Then in Gtuner I go to the 'Device Configuration' tab and under 'Output Protocol' I select 'USB Multi Interface HID' Then I load the template script you have for us in this post into slot 1

Then I should be good to go but My PC doesn't detect the keyboard or mouse what am I doing wrong?
User avatar
GamingScene
Sergeant Major
Sergeant Major
 
Posts: 108
Joined: Sat May 26, 2018 6:17 pm

Re: Pablo's Beginners Guide to Scripting for PC

Postby DontAtMe » Sun Apr 26, 2020 8:16 am

This still works fine.

GamingScene wrote:Then I load the template script you have for us in this post into slot 1
Likely your script is missing something, or not set up correctly, To confirm can you post the exact script you are using.
User avatar
DontAtMe
Lieutenant
Lieutenant
 
Posts: 363
Joined: Tue Oct 02, 2018 4:49 am

Re: Pablo's Beginners Guide to Scripting for PC

Postby GamingScene » Sun Apr 26, 2020 8:24 am

DontAtMe wrote:This still works fine.

GamingScene wrote:Then I load the template script you have for us in this post into slot 1
Likely your script is missing something, or not set up correctly, To confirm can you post the exact script you are using.

Code: Select all
#pragma METAINFO("PC Script", 1, 0, "GamingScene")
 
#include <keyboard.gph>
#include <mouse.gph>
 
// SCRIPT START
//----------------------------------------------------------------------------------------------------------------------------------------------------------------
//----------------------------------------------------------------------------------------------------------------------------------------------------------------
// INIT START
// ADS BOOST START
#define HIP_SENS                                   1.00
#define ADS_BOOST_SENS                       1.00
#define ADS_BOOST_SENS1                     2.15
#define ADS_BOOST_DELAY                      200
#define DEADZONE_X                1
#define DEADZONE_Y                1
uint8   ads_delay_timer;
// ADS BOOST END
init {
port_connect(PORT_USB_C, PROTOCOL_HID);keymapping();mousemapping();}
 
// INIT END
//----------------------------------------------------------------------------------------------------------------------------------------------------------------
//----------------------------------------------------------------------------------------------------------------------------------------------------------------
// MAIN START
 
main {
 
// HID PASSTHROUGH START   
    key_passthru();
    mouse_passthru();
// HID PASSTHROUGH END
 
// RAPID FIRE START
if(mouse_status(MBUTTON_1)) {combo_run(RAPID_FIRE);}
// RAPID FIRE END
 
// ADS BOOST START
if(mouse_status(MBUTTON_2)) {
    if(ads_delay_timer < ADS_BOOST_DELAY) ads_delay_timer += elapsed_time();
    if (mouse_status(MREPORT_UPDATED)) {
 
        if (abs(mouse_get(MOUSE_X)) > DEADZONE_X) {
            printf("xorg: %d, xnew: %d",mouse_get(MOUSE_X),(int32)clamp((fix32)mouse_get(MOUSE_X) * (HIP_SENS + (ADS_BOOST_SENS  - HIP_SENS) * ((fix32)ads_delay_timer / (fix32)ADS_BOOST_DELAY)), -100.0, 100.0));
            mouse_set(MOUSE_X, (int32)clamp((fix32)mouse_get(MOUSE_X) * (HIP_SENS + (ADS_BOOST_SENS  - HIP_SENS) * ((fix32)ads_delay_timer / (fix32)ADS_BOOST_DELAY)), -100.0, 100.0));
        }
        if (abs(mouse_get(MOUSE_Y)) > DEADZONE_Y) {
            printf("yorg: %d, ynew: %d",mouse_get(MOUSE_Y),(int32)clamp((fix32)mouse_get(MOUSE_Y) * (HIP_SENS + (ADS_BOOST_SENS1 - HIP_SENS) * ((fix32)ads_delay_timer / (fix32)ADS_BOOST_DELAY)), -100.0, 100.0));
            mouse_set(MOUSE_Y, (int32)clamp((fix32)mouse_get(MOUSE_Y) * (HIP_SENS + (ADS_BOOST_SENS1 - HIP_SENS) * ((fix32)ads_delay_timer / (fix32)ADS_BOOST_DELAY)), -100.0, 100.0));
        }
 
    }
} else ads_delay_timer = 0;}
// ADS BOOST END
 
// MAIN END
//----------------------------------------------------------------------------------------------------------------------------------------------------------------
//----------------------------------------------------------------------------------------------------------------------------------------------------------------
// COMBO START
 
// RAPID PICKUP COMBO START   
combo RAPID_FIRE {   
    mouse_set(MBUTTON_1, 100);
    wait(irand(92));
    mouse_set(MBUTTON_1, 0);
    wait(irand(52));
    mouse_set(MBUTTON_1, 0);}
// RAPID PICKUP COMBO END
 
// COMBO END
//----------------------------------------------------------------------------------------------------------------------------------------------------------------
//----------------------------------------------------------------------------------------------------------------------------------------------------------------
// SCRIPT FUNCTIONS START
 
int irand(int scramble) {fix32 fraction = (fix32) scramble * 0.15;int vmin = scramble - (int) fraction;int vmax = scramble + (int) fraction;return(((int)(rand() * (fix32)(vmax + 1 - vmin))) + vmin);}
 
// SCRIPT FUNCTIONS END
//----------------------------------------------------------------------------------------------------------------------------------------------------------------
//----------------------------------------------------------------------------------------------------------------------------------------------------------------
// SCRIPT END
User avatar
GamingScene
Sergeant Major
Sergeant Major
 
Posts: 108
Joined: Sat May 26, 2018 6:17 pm

Re: Pablo's Beginners Guide to Scripting for PC

Postby DontAtMe » Sun Apr 26, 2020 9:28 am

The script is working fine here.

Try this script on your console,
Load up a crossplay M&k enabled game (Fortnite or COD will do)
See if the game is detecting mouse and keyboard.
User avatar
DontAtMe
Lieutenant
Lieutenant
 
Posts: 363
Joined: Tue Oct 02, 2018 4:49 am

Re: Pablo's Beginners Guide to Scripting for PC

Postby GamingScene » Sun Apr 26, 2020 9:48 am

DontAtMe wrote:The script is working fine here.

Try this script on your console,
Load up a crossplay M&k enabled game (Fortnite or COD will do)
See if the game is detecting mouse and keyboard.


So I'm misinterpreting what it means 'Guide to Scripting for PC'

I thought it meant I could use my mouse and keyboard as you do on PC. No???

I thought I could use the Titan Twos advance features that you cant do using you mouse software (macros - Like Logitech Game Software) a higher Y ratio when you ADS to counter Recoil

Is this not the case?
User avatar
GamingScene
Sergeant Major
Sergeant Major
 
Posts: 108
Joined: Sat May 26, 2018 6:17 pm

Re: Pablo's Beginners Guide to Scripting for PC

Postby GamingScene » Sun Apr 26, 2020 9:58 am

Doesn't matter its because I was running it through my Xim
User avatar
GamingScene
Sergeant Major
Sergeant Major
 
Posts: 108
Joined: Sat May 26, 2018 6:17 pm

Re: Pablo's Beginners Guide to Scripting for PC

Postby J2Kbr » Sun Apr 26, 2020 1:46 pm

GamingScene wrote:Doesn't matter its because I was running it through my Xim

I didn't read the latest posts, so apologize me if missed the discussion point.

This tutorial is not XIM related, but for the case of having the keyboard and mouse plugged to the Titan Two and the Titan Two outputting as keyboard and mouse. Basically the Titan Two works as hardware based macro engine for keyboards and mice.
ConsoleTuner Support Team
User avatar
J2Kbr
General of the Army
General of the Army
 
Posts: 19042
Joined: Tue Mar 18, 2014 1:39 pm

Re: Pablo's Beginners Guide to Scripting for PC

Postby GamingScene » Mon Apr 27, 2020 11:48 am

J2Kbr wrote:
GamingScene wrote:Doesn't matter its because I was running it through my Xim

I didn't read the latest posts, so apologize me if missed the discussion point.

This tutorial is not XIM related, but for the case of having the keyboard and mouse plugged to the Titan Two and the Titan Two outputting as keyboard and mouse. Basically the Titan Two works as hardware based macro engine for keyboards and mice.


My Script

Code: Select all
#pragma METAINFO("PC Script", 1, 0, "GamingScene")
 
#include <keyboard.gph>
#include <mouse.gph>
 
// SCRIPT START
//----------------------------------------------------------------------------------------------------------------------------------------------------------------
//----------------------------------------------------------------------------------------------------------------------------------------------------------------
// INIT START
// ADS BOOST START
#define HIP_SENS                             1.00
#define ADS_BOOST_SENS                       1.00
#define ADS_BOOST_SENS1                      1.50
#define ADS_BOOST_DELAY                      10
#define DEADZONE_X                1
#define DEADZONE_Y                1
uint8   ads_delay_timer;
// ADS BOOST END
init {
port_connect(PORT_USB_C, PROTOCOL_HID);keymapping();mousemapping();}
 
// INIT END
//----------------------------------------------------------------------------------------------------------------------------------------------------------------
//----------------------------------------------------------------------------------------------------------------------------------------------------------------
// MAIN START
 
main {
 
// HID PASSTHROUGH START   
    key_passthru();
    mouse_passthru();
// HID PASSTHROUGH END
 
// RAPID FIRE START
if(mouse_status(MBUTTON_1)) {combo_run(RAPID_FIRE);}
// RAPID FIRE END
 
// ADS BOOST START
if(mouse_status(MBUTTON_2)) {
    if(ads_delay_timer < ADS_BOOST_DELAY) ads_delay_timer += elapsed_time();
    if (mouse_status(MREPORT_UPDATED)) {
 
        if (abs(mouse_get(MOUSE_X)) > DEADZONE_X) {
            printf("xorg: %d, xnew: %d",mouse_get(MOUSE_X),(int32)clamp((fix32)mouse_get(MOUSE_X) * (HIP_SENS + (ADS_BOOST_SENS  - HIP_SENS) * ((fix32)ads_delay_timer / (fix32)ADS_BOOST_DELAY)), -100.0, 100.0));
            mouse_set(MOUSE_X, (int32)clamp((fix32)mouse_get(MOUSE_X) * (HIP_SENS + (ADS_BOOST_SENS  - HIP_SENS) * ((fix32)ads_delay_timer / (fix32)ADS_BOOST_DELAY)), -100.0, 100.0));
        }
        if (abs(mouse_get(MOUSE_Y)) > DEADZONE_Y) {
            printf("yorg: %d, ynew: %d",mouse_get(MOUSE_Y),(int32)clamp((fix32)mouse_get(MOUSE_Y) * (HIP_SENS + (ADS_BOOST_SENS1 - HIP_SENS) * ((fix32)ads_delay_timer / (fix32)ADS_BOOST_DELAY)), -100.0, 100.0));
            mouse_set(MOUSE_Y, (int32)clamp((fix32)mouse_get(MOUSE_Y) * (HIP_SENS + (ADS_BOOST_SENS1 - HIP_SENS) * ((fix32)ads_delay_timer / (fix32)ADS_BOOST_DELAY)), -100.0, 100.0));
        }
 
    }
} else ads_delay_timer = 0;}
// ADS BOOST END
 
// MAIN END
//----------------------------------------------------------------------------------------------------------------------------------------------------------------
//----------------------------------------------------------------------------------------------------------------------------------------------------------------
// COMBO START
 
// RAPID PICKUP COMBO START   
combo RAPID_FIRE {   
    mouse_set(MBUTTON_1, 100);
    wait(irand(95));
    mouse_set(MBUTTON_1, 0);
    wait(irand(45));
    mouse_set(MBUTTON_1, 0);}
// RAPID PICKUP COMBO END
 
// COMBO END
//----------------------------------------------------------------------------------------------------------------------------------------------------------------
//----------------------------------------------------------------------------------------------------------------------------------------------------------------
// SCRIPT FUNCTIONS START
 
int irand(int scramble) {
    fix32 fraction = (fix32) scramble * 0.10;
    int vmin = scramble - (int) fraction;
    int vmax = scramble + (int) fraction;
    return(((int)(rand() * (fix32)(vmax + 2 - vmin))) + vmin);
}
 
// SCRIPT FUNCTIONS END
//----------------------------------------------------------------------------------------------------------------------------------------------------------------
//----------------------------------------------------------------------------------------------------------------------------------------------------------------
// SCRIPT END


How do I make rapid fire more random? I'm scared of being banned!

Also how do I make this below:

When my ADS button (MBUTTON_2) isn't pressed my aim on the X AXIS is normal but my Y AXIS is reduced to like maybe 50% (Kinda like deadzone on Controller but the PC equivalent)

But when my ADS Button (MBUTTON_2) is pressed my aim is like what I have already this script

This bit is what I'm referring to here below

Code: Select all
#pragma METAINFO("PC Script", 1, 0, "GamingScene")
 
#include <keyboard.gph>
#include <mouse.gph>
 
// SCRIPT START
//----------------------------------------------------------------------------------------------------------------------------------------------------------------
//----------------------------------------------------------------------------------------------------------------------------------------------------------------
// INIT START
// ADS BOOST START
#define HIP_SENS                             1.00
#define ADS_BOOST_SENS                       1.00
#define ADS_BOOST_SENS1                      1.50
#define ADS_BOOST_DELAY                      10
#define DEADZONE_X                1
#define DEADZONE_Y                1
uint8   ads_delay_timer;
// ADS BOOST END
init {
port_connect(PORT_USB_C, PROTOCOL_HID);keymapping();mousemapping();}
 
// INIT END
//----------------------------------------------------------------------------------------------------------------------------------------------------------------
//----------------------------------------------------------------------------------------------------------------------------------------------------------------
// MAIN START
 
main {
 
// HID PASSTHROUGH START   
    key_passthru();
    mouse_passthru();
// HID PASSTHROUGH END
 
// ADS BOOST START
if(mouse_status(MBUTTON_2)) {
    if(ads_delay_timer < ADS_BOOST_DELAY) ads_delay_timer += elapsed_time();
    if (mouse_status(MREPORT_UPDATED)) {
 
        if (abs(mouse_get(MOUSE_X)) > DEADZONE_X) {
            printf("xorg: %d, xnew: %d",mouse_get(MOUSE_X),(int32)clamp((fix32)mouse_get(MOUSE_X) * (HIP_SENS + (ADS_BOOST_SENS  - HIP_SENS) * ((fix32)ads_delay_timer / (fix32)ADS_BOOST_DELAY)), -100.0, 100.0));
            mouse_set(MOUSE_X, (int32)clamp((fix32)mouse_get(MOUSE_X) * (HIP_SENS + (ADS_BOOST_SENS  - HIP_SENS) * ((fix32)ads_delay_timer / (fix32)ADS_BOOST_DELAY)), -100.0, 100.0));
        }
        if (abs(mouse_get(MOUSE_Y)) > DEADZONE_Y) {
            printf("yorg: %d, ynew: %d",mouse_get(MOUSE_Y),(int32)clamp((fix32)mouse_get(MOUSE_Y) * (HIP_SENS + (ADS_BOOST_SENS1 - HIP_SENS) * ((fix32)ads_delay_timer / (fix32)ADS_BOOST_DELAY)), -100.0, 100.0));
            mouse_set(MOUSE_Y, (int32)clamp((fix32)mouse_get(MOUSE_Y) * (HIP_SENS + (ADS_BOOST_SENS1 - HIP_SENS) * ((fix32)ads_delay_timer / (fix32)ADS_BOOST_DELAY)), -100.0, 100.0));
        }
 
    }
} else ads_delay_timer = 0;}
// ADS BOOST END
 
// MAIN END
//----------------------------------------------------------------------------------------------------------------------------------------------------------------
//----------------------------------------------------------------------------------------------------------------------------------------------------------------
// SCRIPT END


Also finally how do/ or what code do I use to check if the mouse button 1 has been pressed or release
here is an example for my use...

Basically here for CSGO I find it very unnatural to stop moving while shooting as I come from Apex Legends where moving, strafing, jumping, spam crouching and sliding is key to winning most gun fights or it at least gives you the edge of most casual players.

Code: Select all
if(mouse_status(MBUTTON_1)) {key_set(KEY_C, 100);mouse_set(KEY_W, 0);key_set(KEY_S, 0);key_set(KEY_A, 0);key_set(KEY_D, 0);}


So that code above stops me from moving while MBUTTON_1 is pressed and also crouches because shooting while crouched is more accurate I'm told...
but the problem is when I come to move after killing or shooting an enemy I'm still crouched and its stops me from running/sprinting to get to cover to reload or to advance further through the map!

1) So what I'm asking for here is for when I press MBUTTON_1 it holds down KEY_C for as long as I hold down MBUTTON_1
2) When I let go/or release MBUTTON_1 it presses KEY_C again to go back to standing so I'm ready to sprint again (I know in CSGO there isn't really a sprint but yous that have played the game I hope no what I mean.

Its very important when MBUTTON_1 is pressed to have a delay between the press of KEY_C
Again its very important when MBUTTON_1 is released to have a delay between the press of KEY_C to stand up again to reduce the risk of being banned

Is what I'm asking possible? I'm not so sure on PC... I know this is a lot to ask but would love for someone to give this a go thanks in advance :)
User avatar
GamingScene
Sergeant Major
Sergeant Major
 
Posts: 108
Joined: Sat May 26, 2018 6:17 pm

Re: Pablo's Beginners Guide to Scripting for PC

Postby GamingScene » Tue Apr 28, 2020 10:39 am

GamingScene wrote:
J2Kbr wrote:
GamingScene wrote:Doesn't matter its because I was running it through my Xim

I didn't read the latest posts, so apologize me if missed the discussion point.

This tutorial is not XIM related, but for the case of having the keyboard and mouse plugged to the Titan Two and the Titan Two outputting as keyboard and mouse. Basically the Titan Two works as hardware based macro engine for keyboards and mice.


My Script

Code: Select all
#pragma METAINFO("PC Script", 1, 0, "GamingScene")
 
#include <keyboard.gph>
#include <mouse.gph>
 
// SCRIPT START
//----------------------------------------------------------------------------------------------------------------------------------------------------------------
//----------------------------------------------------------------------------------------------------------------------------------------------------------------
// INIT START
// ADS BOOST START
#define HIP_SENS                             1.00
#define ADS_BOOST_SENS                       1.00
#define ADS_BOOST_SENS1                      1.50
#define ADS_BOOST_DELAY                      10
#define DEADZONE_X                1
#define DEADZONE_Y                1
uint8   ads_delay_timer;
// ADS BOOST END
init {
port_connect(PORT_USB_C, PROTOCOL_HID);keymapping();mousemapping();}
 
// INIT END
//----------------------------------------------------------------------------------------------------------------------------------------------------------------
//----------------------------------------------------------------------------------------------------------------------------------------------------------------
// MAIN START
 
main {
 
// HID PASSTHROUGH START   
    key_passthru();
    mouse_passthru();
// HID PASSTHROUGH END
 
// RAPID FIRE START
if(mouse_status(MBUTTON_1)) {combo_run(RAPID_FIRE);}
// RAPID FIRE END
 
// ADS BOOST START
if(mouse_status(MBUTTON_2)) {
    if(ads_delay_timer < ADS_BOOST_DELAY) ads_delay_timer += elapsed_time();
    if (mouse_status(MREPORT_UPDATED)) {
 
        if (abs(mouse_get(MOUSE_X)) > DEADZONE_X) {
            printf("xorg: %d, xnew: %d",mouse_get(MOUSE_X),(int32)clamp((fix32)mouse_get(MOUSE_X) * (HIP_SENS + (ADS_BOOST_SENS  - HIP_SENS) * ((fix32)ads_delay_timer / (fix32)ADS_BOOST_DELAY)), -100.0, 100.0));
            mouse_set(MOUSE_X, (int32)clamp((fix32)mouse_get(MOUSE_X) * (HIP_SENS + (ADS_BOOST_SENS  - HIP_SENS) * ((fix32)ads_delay_timer / (fix32)ADS_BOOST_DELAY)), -100.0, 100.0));
        }
        if (abs(mouse_get(MOUSE_Y)) > DEADZONE_Y) {
            printf("yorg: %d, ynew: %d",mouse_get(MOUSE_Y),(int32)clamp((fix32)mouse_get(MOUSE_Y) * (HIP_SENS + (ADS_BOOST_SENS1 - HIP_SENS) * ((fix32)ads_delay_timer / (fix32)ADS_BOOST_DELAY)), -100.0, 100.0));
            mouse_set(MOUSE_Y, (int32)clamp((fix32)mouse_get(MOUSE_Y) * (HIP_SENS + (ADS_BOOST_SENS1 - HIP_SENS) * ((fix32)ads_delay_timer / (fix32)ADS_BOOST_DELAY)), -100.0, 100.0));
        }
 
    }
} else ads_delay_timer = 0;}
// ADS BOOST END
 
// MAIN END
//----------------------------------------------------------------------------------------------------------------------------------------------------------------
//----------------------------------------------------------------------------------------------------------------------------------------------------------------
// COMBO START
 
// RAPID PICKUP COMBO START   
combo RAPID_FIRE {   
    mouse_set(MBUTTON_1, 100);
    wait(irand(95));
    mouse_set(MBUTTON_1, 0);
    wait(irand(45));
    mouse_set(MBUTTON_1, 0);}
// RAPID PICKUP COMBO END
 
// COMBO END
//----------------------------------------------------------------------------------------------------------------------------------------------------------------
//----------------------------------------------------------------------------------------------------------------------------------------------------------------
// SCRIPT FUNCTIONS START
 
int irand(int scramble) {
    fix32 fraction = (fix32) scramble * 0.10;
    int vmin = scramble - (int) fraction;
    int vmax = scramble + (int) fraction;
    return(((int)(rand() * (fix32)(vmax + 2 - vmin))) + vmin);
}
 
// SCRIPT FUNCTIONS END
//----------------------------------------------------------------------------------------------------------------------------------------------------------------
//----------------------------------------------------------------------------------------------------------------------------------------------------------------
// SCRIPT END


How do I make rapid fire more random? I'm scared of being banned!

Also how do I make this below:

When my ADS button (MBUTTON_2) isn't pressed my aim on the X AXIS is normal but my Y AXIS is reduced to like maybe 50% (Kinda like deadzone on Controller but the PC equivalent)

But when my ADS Button (MBUTTON_2) is pressed my aim is like what I have already this script

This bit is what I'm referring to here below

Code: Select all
#pragma METAINFO("PC Script", 1, 0, "GamingScene")
 
#include <keyboard.gph>
#include <mouse.gph>
 
// SCRIPT START
//----------------------------------------------------------------------------------------------------------------------------------------------------------------
//----------------------------------------------------------------------------------------------------------------------------------------------------------------
// INIT START
// ADS BOOST START
#define HIP_SENS                             1.00
#define ADS_BOOST_SENS                       1.00
#define ADS_BOOST_SENS1                      1.50
#define ADS_BOOST_DELAY                      10
#define DEADZONE_X                1
#define DEADZONE_Y                1
uint8   ads_delay_timer;
// ADS BOOST END
init {
port_connect(PORT_USB_C, PROTOCOL_HID);keymapping();mousemapping();}
 
// INIT END
//----------------------------------------------------------------------------------------------------------------------------------------------------------------
//----------------------------------------------------------------------------------------------------------------------------------------------------------------
// MAIN START
 
main {
 
// HID PASSTHROUGH START   
    key_passthru();
    mouse_passthru();
// HID PASSTHROUGH END
 
// ADS BOOST START
if(mouse_status(MBUTTON_2)) {
    if(ads_delay_timer < ADS_BOOST_DELAY) ads_delay_timer += elapsed_time();
    if (mouse_status(MREPORT_UPDATED)) {
 
        if (abs(mouse_get(MOUSE_X)) > DEADZONE_X) {
            printf("xorg: %d, xnew: %d",mouse_get(MOUSE_X),(int32)clamp((fix32)mouse_get(MOUSE_X) * (HIP_SENS + (ADS_BOOST_SENS  - HIP_SENS) * ((fix32)ads_delay_timer / (fix32)ADS_BOOST_DELAY)), -100.0, 100.0));
            mouse_set(MOUSE_X, (int32)clamp((fix32)mouse_get(MOUSE_X) * (HIP_SENS + (ADS_BOOST_SENS  - HIP_SENS) * ((fix32)ads_delay_timer / (fix32)ADS_BOOST_DELAY)), -100.0, 100.0));
        }
        if (abs(mouse_get(MOUSE_Y)) > DEADZONE_Y) {
            printf("yorg: %d, ynew: %d",mouse_get(MOUSE_Y),(int32)clamp((fix32)mouse_get(MOUSE_Y) * (HIP_SENS + (ADS_BOOST_SENS1 - HIP_SENS) * ((fix32)ads_delay_timer / (fix32)ADS_BOOST_DELAY)), -100.0, 100.0));
            mouse_set(MOUSE_Y, (int32)clamp((fix32)mouse_get(MOUSE_Y) * (HIP_SENS + (ADS_BOOST_SENS1 - HIP_SENS) * ((fix32)ads_delay_timer / (fix32)ADS_BOOST_DELAY)), -100.0, 100.0));
        }
 
    }
} else ads_delay_timer = 0;}
// ADS BOOST END
 
// MAIN END
//----------------------------------------------------------------------------------------------------------------------------------------------------------------
//----------------------------------------------------------------------------------------------------------------------------------------------------------------
// SCRIPT END


Also finally how do/ or what code do I use to check if the mouse button 1 has been pressed or release
here is an example for my use...

Basically here for CSGO I find it very unnatural to stop moving while shooting as I come from Apex Legends where moving, strafing, jumping, spam crouching and sliding is key to winning most gun fights or it at least gives you the edge of most casual players.

Code: Select all
if(mouse_status(MBUTTON_1)) {key_set(KEY_C, 100);mouse_set(KEY_W, 0);key_set(KEY_S, 0);key_set(KEY_A, 0);key_set(KEY_D, 0);}


So that code above stops me from moving while MBUTTON_1 is pressed and also crouches because shooting while crouched is more accurate I'm told...
but the problem is when I come to move after killing or shooting an enemy I'm still crouched and its stops me from running/sprinting to get to cover to reload or to advance further through the map!

1) So what I'm asking for here is for when I press MBUTTON_1 it holds down KEY_C for as long as I hold down MBUTTON_1
2) When I let go/or release MBUTTON_1 it presses KEY_C again to go back to standing so I'm ready to sprint again (I know in CSGO there isn't really a sprint but yous that have played the game I hope no what I mean.

Its very important when MBUTTON_1 is pressed to have a delay between the press of KEY_C
Again its very important when MBUTTON_1 is released to have a delay between the press of KEY_C to stand up again to reduce the risk of being banned

Is what I'm asking possible? I'm not so sure on PC... I know this is a lot to ask but would love for someone to give this a go thanks in advance :)

Bump sorry just need help
User avatar
GamingScene
Sergeant Major
Sergeant Major
 
Posts: 108
Joined: Sat May 26, 2018 6:17 pm

PreviousNext

Return to Tutorials and FAQs

Who is online

Users browsing this forum: No registered users and 24 guests