Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <Windows.h>
- #include <bitset>
- #include <thread>
- enum eTriggerbotIdx
- {
- IDX_ENABLED = 0,
- IDX_AUTOSHOOT,
- IDX_TEAMCHECK,
- IDX_WPM,
- IDX_BURST,
- IDX_DELAY
- };
- class C_CSPlayer
- {
- public:
- C_CSPlayer( size_t idx )
- {
- }
- int32_t GetTeamId( void ) const
- {
- return 1; // Read real team id etc...
- }
- int32_t GetShotsFired( void ) const
- {
- return 0; // Read real shots fired here...
- }
- };
- int main()
- {
- static size_t iTriggerKey = 5, burstmodeShots = 3, triggerDelay = 150;
- static auto bSettings = std::bitset< 6 >();
- auto fnLoadSettings = [&](void) {
- // Load Settings
- bSettings[ IDX_ENABLED ] = true;
- bSettings[ IDX_AUTOSHOOT ] = true;
- bSettings[ IDX_TEAMCHECK ] = true;
- bSettings[ IDX_WPM ] = false;
- bSettings[ IDX_BURST ] = true;
- bSettings[ IDX_DELAY ] = true;
- };
- auto fnIsKeyPressed = [](int iKey) -> bool {
- return GetKeyState( iKey ) & 0x8000;
- };
- auto fnGetIncrossId = [&]() -> int {
- return 0; // Read incrossid etc... 0 for none
- };
- fnLoadSettings();
- while( true ) {
- std::this_thread::sleep_for( std::chrono::milliseconds( 1 ) );
- if( !fnIsKeyPressed( iTriggerKey ) && !bSettings[ IDX_AUTOSHOOT ] ) {
- continue;
- }
- auto iCrosshairId = fnGetIncrossId();
- if( fnGetIncrossId() <= 0 ) {
- continue;
- }
- auto pLocalPlayer = C_CSPlayer( 1 ); // Use real local player idx ofc
- auto pEntity = C_CSPlayer( iCrosshairId );
- if( bSettings[ IDX_TEAMCHECK ] && pLocalPlayer.GetTeamId() == pEntity.GetTeamId() ) {
- continue;
- }
- if( bSettings[ IDX_DELAY ] ) {
- std::this_thread::sleep_for( std::chrono::milliseconds( triggerDelay ) );
- }
- if( bSettings[ IDX_WPM ] ) {
- // WPM +attack ...
- } else {
- // mouse_event() ...
- }
- if( bSettings[ IDX_BURST ] ) {
- while( pLocalPlayer.GetShotsFired() < burstmodeShots ) {
- std::this_thread::sleep_for( std::chrono::milliseconds( 5 ) );
- }
- } else {
- std::this_thread::sleep_for( std::chrono::milliseconds( 65 ) );
- }
- if( bSettings[ IDX_WPM ] ) {
- // WPM -attack ...
- } else {
- // mouse_event() ...
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement