Advertisement
Guest User

Untitled

a guest
Oct 28th, 2015
352
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C++ 2.46 KB | None | 0 0
  1. #include <Windows.h>
  2. #include <bitset>
  3. #include <thread>
  4.  
  5. enum eTriggerbotIdx
  6. {
  7.     IDX_ENABLED = 0,
  8.     IDX_AUTOSHOOT,
  9.     IDX_TEAMCHECK,
  10.     IDX_WPM,
  11.     IDX_BURST,
  12.     IDX_DELAY
  13. };
  14.  
  15. class C_CSPlayer
  16. {
  17. public:
  18.     C_CSPlayer( size_t idx )
  19.     {
  20.     }
  21.  
  22.     int32_t GetTeamId( void ) const
  23.     {
  24.         return 1; // Read real team id etc...
  25.     }
  26.  
  27.     int32_t GetShotsFired( void ) const
  28.     {
  29.         return 0; // Read real shots fired here...
  30.     }
  31. };
  32.  
  33. int main()
  34. {
  35.     static size_t iTriggerKey = 5, burstmodeShots = 3, triggerDelay = 150;
  36.     static auto bSettings = std::bitset< 6 >();
  37.  
  38.     auto fnLoadSettings = [&](void) {
  39.         // Load Settings
  40.         bSettings[ IDX_ENABLED ] = true;
  41.         bSettings[ IDX_AUTOSHOOT ] = true;
  42.         bSettings[ IDX_TEAMCHECK ] = true;
  43.         bSettings[ IDX_WPM ] = false;
  44.         bSettings[ IDX_BURST ] = true;
  45.         bSettings[ IDX_DELAY ] = true;
  46.     };
  47.  
  48.     auto fnIsKeyPressed = [](int iKey) -> bool {
  49.         return GetKeyState( iKey ) & 0x8000;
  50.     };
  51.  
  52.     auto fnGetIncrossId = [&]() -> int {
  53.         return 0; // Read incrossid etc... 0 for none
  54.     };
  55.  
  56.     fnLoadSettings();
  57.  
  58.     while( true ) {
  59.         std::this_thread::sleep_for( std::chrono::milliseconds( 1 ) );
  60.  
  61.         if( !fnIsKeyPressed( iTriggerKey ) && !bSettings[ IDX_AUTOSHOOT ] ) {
  62.             continue;
  63.         }
  64.  
  65.         auto iCrosshairId = fnGetIncrossId();
  66.  
  67.         if( fnGetIncrossId() <= 0 ) {
  68.             continue;
  69.         }
  70.  
  71.         auto pLocalPlayer = C_CSPlayer( 1 ); // Use real local player idx ofc
  72.         auto pEntity = C_CSPlayer( iCrosshairId );
  73.  
  74.         if( bSettings[ IDX_TEAMCHECK ] && pLocalPlayer.GetTeamId() == pEntity.GetTeamId() ) {
  75.             continue;
  76.         }
  77.  
  78.         if( bSettings[ IDX_DELAY ] ) {
  79.             std::this_thread::sleep_for( std::chrono::milliseconds( triggerDelay ) );
  80.         }
  81.  
  82.         if( bSettings[ IDX_WPM ] ) {
  83.             // WPM +attack ...
  84.         } else {
  85.             // mouse_event() ...
  86.         }
  87.  
  88.         if( bSettings[ IDX_BURST ] ) {
  89.             while( pLocalPlayer.GetShotsFired() < burstmodeShots ) {
  90.                 std::this_thread::sleep_for( std::chrono::milliseconds( 5 ) );
  91.             }
  92.         } else {
  93.             std::this_thread::sleep_for( std::chrono::milliseconds( 65 ) );
  94.         }
  95.  
  96.         if( bSettings[ IDX_WPM ] ) {
  97.             // WPM -attack ...
  98.         } else {
  99.             // mouse_event() ...
  100.         }
  101.     }
  102. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement