Advertisement
asqapro

QuickSwitch+Scope/Macro/Crouch/Walk

Apr 26th, 2014
210
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C++ 21.54 KB | None | 0 0
  1. #define WINVER 0x0500 //windows XP and up
  2. #include <iostream>
  3. #include <windows.h>
  4. #include <time.h>
  5. #include <winable.h>
  6. #include <map> //for mapping keys to virtual key values
  7. #include <algorithm> //for searching through the maps
  8. #include <pthread.h>
  9.  
  10. using namespace std;
  11.  
  12. bool chat_active = false; //if the player is currently talking
  13. bool command_active = false; //if a chat command menu is open
  14.  
  15. int qswitch_key; //key used to switch your weapon
  16. //==========================//
  17. int crouch_key; //key used to crouch
  18. //==========================//
  19. int walk_key; //key used to walk
  20. //==========================//
  21. int scope_speed_milliseconds; //how fast the scope zooms
  22. //==========================//
  23. bool burst; //if you want to burst or not
  24. int burst_amount; //how many burts
  25. int burst_speed; //how fast to burst
  26. int click_amount; //how many times to click
  27. //==========================//
  28.  
  29. void Generate_Key(int key){ //sends keydown and keyup messages
  30.     INPUT input;
  31.  
  32.     input.type = INPUT_KEYBOARD; //set the flags
  33.     input.ki.wScan = 0;
  34.     input.ki.time = 0;
  35.     input.ki.dwExtraInfo = 0;
  36.     input.ki.wVk = key;
  37.     SendInput(1, &input, sizeof(INPUT)); //send the message
  38.  
  39.     input.ki.dwFlags = KEYEVENTF_KEYUP; //set the flag
  40.     SendInput(1, &input, sizeof(INPUT)); //send the message
  41. }
  42.  
  43. void Generate_Key_down(int key){ //generates a key down
  44.     INPUT input;
  45.  
  46.     input.type = INPUT_KEYBOARD; //set the flags
  47.     input.ki.wScan = 0;
  48.     input.ki.time = 0;
  49.     input.ki.dwExtraInfo = 0;
  50.     input.ki.wVk = key;
  51.     SendInput(1, &input, sizeof(INPUT)); //send the message
  52. }
  53.  
  54. void Generate_Key_up(int key){ //generates a key up
  55.     INPUT input;
  56.  
  57.     input.type = INPUT_KEYBOARD; //set the flags
  58.     input.ki.wScan = 0;
  59.     input.ki.time = 0;
  60.     input.ki.dwExtraInfo = 0;
  61.     input.ki.wVk = key;
  62.  
  63.     input.ki.dwFlags = KEYEVENTF_KEYUP;
  64.     SendInput(1, &input, sizeof(INPUT)); //send the message
  65. }
  66.  
  67. void unclick(bool middle_or_right){ //unclicks a mouse button (middle or right)
  68.     INPUT input = {0};
  69.     input.type = INPUT_MOUSE;
  70.     if(middle_or_right){ //middle button click
  71.         input.mi.dwFlags = MOUSEEVENTF_MIDDLEUP;
  72.         SendInput(1, &input, sizeof(INPUT));
  73.     }
  74.     else if(!middle_or_right){ //right button click
  75.         input.mi.dwFlags = MOUSEEVENTF_RIGHTUP;
  76.         SendInput(1, &input, sizeof(INPUT));
  77.     }
  78. }
  79.  
  80. void click(bool middle_or_right){ //clicks a mouse button (middle or right)
  81.     INPUT input = {0};
  82.     input.type = INPUT_MOUSE;
  83.     if(middle_or_right){ //middle click
  84.         input.mi.dwFlags = MOUSEEVENTF_MIDDLEDOWN;
  85.         SendInput(1, &input, sizeof(INPUT));
  86.     }
  87.     else if(!middle_or_right){ //right click
  88.         input.mi.dwFlags = MOUSEEVENTF_RIGHTDOWN;
  89.         SendInput(1, &input, sizeof(INPUT));
  90.     }
  91. }
  92.  
  93. void macro_click(){ //generates a click and unclick (middle only)
  94.     INPUT    input={0};
  95.     // left down
  96.     input.type      = INPUT_MOUSE;
  97.     input.mi.dwFlags  = MOUSEEVENTF_MIDDLEDOWN;
  98.     SendInput(1,&input,sizeof(INPUT));
  99.  
  100.     // left up
  101.     input.type      = INPUT_MOUSE;
  102.     input.mi.dwFlags  = MOUSEEVENTF_MIDDLEUP;
  103.     SendInput(1,&input,sizeof(INPUT));
  104. }
  105.  
  106. int choose_scope_speed(){ //lets user set the scope speed
  107.     cin.clear();cin.sync(); //clear out the input buffer
  108.     float scope_speed_seconds;
  109.     int scope_speed_milliseconds;
  110.     cout << "Scope speeds:" << endl;
  111.     cout << "0.21s: Mosin Nagant Basic Scope, AWM Precision Scope" << endl;
  112.     cout << "0.23s: FR-F2 Sharpshooter Scope, ASW.338 Quick Scope II, AWM Basic Scope, DSR-1 Quick Scope 2, Blaser R93 Sharpshooter Scope" << endl;
  113.     cout << "0.25s: ASW.338 Sharpshooter Scope II" << endl;
  114.     cout << "0.27s: ASW.338 Basic Scope" << endl;
  115.     cout << "0.29s: M24 Basic Scope, SV98 Precision Scope, FR-F2 Basic Scope, DSR-1 Basic Scope, PGM.338 Precision Scope, Blaser R93 Precison Scope" << endl;
  116.     cout << "0.30s: SV98 Basic Scope" << endl;
  117.     cout << "0.31s: Blaser R93 Basic Scope, FR-F2 Quick Scope, DSR-1 High Powered Scope 2" << endl;
  118.     cout << "0.39s: TPG1 High Powered Scope, PGM.338 High Powered Scope" << endl;
  119.     cout << "0.43s: TPG1 Basic Scope, PGM.338 Basic Scope" << endl << endl;
  120.  
  121.     cout << "Enter your scope speed in seconds: ";
  122.     cin >> scope_speed_seconds;
  123.  
  124.     scope_speed_milliseconds = scope_speed_seconds * 1000;
  125.     return scope_speed_milliseconds;
  126. }
  127.  
  128. int choose_key(int type){ //let the user choose their key for whatever function (walk, crouch, quickswitch)
  129.     cin.clear();cin.sync(); //clear the input buffer
  130.     map<string, int> keycodes;
  131.     keycodes.insert(make_pair("a", 0x41));
  132.     keycodes.insert(make_pair("b", 0x42));
  133.     keycodes.insert(make_pair("c", 0x43));
  134.     keycodes.insert(make_pair("d", 0x44));
  135.     keycodes.insert(make_pair("e", 0x45));
  136.     keycodes.insert(make_pair("f", 0x46));
  137.     keycodes.insert(make_pair("g", 0x47));
  138.     keycodes.insert(make_pair("h", 0x48));
  139.     keycodes.insert(make_pair("i", 0x49));
  140.     keycodes.insert(make_pair("j", 0x4A));
  141.     keycodes.insert(make_pair("k", 0x4B));
  142.     keycodes.insert(make_pair("l", 0x4C));
  143.     keycodes.insert(make_pair("m", 0x4D));
  144.     keycodes.insert(make_pair("n", 0x4E));
  145.     keycodes.insert(make_pair("o", 0x4F));
  146.     keycodes.insert(make_pair("p", 0x50));
  147.     keycodes.insert(make_pair("q", 0x51));
  148.     keycodes.insert(make_pair("r", 0x52));
  149.     keycodes.insert(make_pair("s", 0x53));
  150.     keycodes.insert(make_pair("t", 0x54));
  151.     keycodes.insert(make_pair("u", 0x55));
  152.     keycodes.insert(make_pair("v", 0x56));
  153.     keycodes.insert(make_pair("w", 0x57));
  154.     keycodes.insert(make_pair("x", 0x58));
  155.     keycodes.insert(make_pair("y", 0x59));
  156.     keycodes.insert(make_pair("z", 0x5A));
  157.     keycodes.insert(make_pair("left control", VK_LCONTROL));
  158.     keycodes.insert(make_pair("right control", VK_RCONTROL));
  159.     keycodes.insert(make_pair("left click", VK_LBUTTON));
  160.     keycodes.insert(make_pair("right click", VK_RBUTTON));
  161.     keycodes.insert(make_pair("middle click", VK_MBUTTON));
  162.     keycodes.insert(make_pair("enter", VK_RETURN));
  163.     keycodes.insert(make_pair("shift", VK_SHIFT));
  164.     keycodes.insert(make_pair("alt", VK_MENU));
  165.     keycodes.insert(make_pair("capslock", VK_CAPITAL));
  166.     keycodes.insert(make_pair("1-2-1", 2));
  167.     keycodes.insert(make_pair("1-3-1", 3));
  168.     keycodes.insert(make_pair("1-4-1", 4));
  169.     string key;
  170.     int key_int;
  171.     while(true){
  172.         if(type == 0){ //switch
  173.             cout << "What do you want as your quickswitch key? (type \'help\' for a list of supported keys) ";
  174.         }
  175.         else if(type == 1){ //crouch
  176.             cout << "What do you want as your crouch key? (type \'help\' for a list of supported keys) ";
  177.         }
  178.         else if(type == 2){
  179.             cout << "What do you want as your walk key? (type \'help\' for a list of supported keys) ";
  180.         }
  181.         getline(cin, key);
  182.         transform(key.begin(), key.end(), key.begin(), ::tolower);
  183.         if(key == "help"){
  184.             cout << "Supported keys:" << endl;
  185.             for(map<string, int>::const_iterator it = keycodes.begin(); it != keycodes.end(); ++it){
  186.                 cout << it->first << endl;
  187.             }
  188.             continue;
  189.         }
  190.         if(keycodes.find(key) == keycodes.end()){
  191.             cout << "Key not supported." << endl;
  192.             continue;
  193.         }
  194.         break;
  195.     }
  196.     key_int = keycodes.find(key)->second;
  197.     return key_int;
  198. }
  199.  
  200. void* qswitch(void* ignore){ //quickswitch function (note: type void* and a void* parameter for p_threads)
  201.     bool qswitch_active = false; //starts out deactivated
  202.     while(true){ //run the thread until the program exits
  203.         while(qswitch_active){ //when the user activates it, leave it active
  204.             if((GetKeyState(VK_LBUTTON) & 0x80) != 0){ //if the user left clicks, middle click and unclick
  205.                 click(true);
  206.                 Sleep(50);
  207.                 unclick(true);
  208.                 Sleep(50);
  209.                 if(qswitch_key == 2 || qswitch_key == 3 || qswitch_key == 4){ //quickswitch using 1-2-1, 1-3-1, or 1-4-1
  210.                     Generate_Key(qswitch_key); //quick switch using the key chosen
  211.                     Sleep(5);
  212.                     Generate_Key(1); //switch back to main weapon
  213.                     Sleep(1);
  214.                 }
  215.                 else{ //or just use the key they set
  216.                     Generate_Key(qswitch_key); //quick switch using the key chosen
  217.                     Sleep(5);
  218.                     Generate_Key(qswitch_key); //switch back to main weapon
  219.                     Sleep(1);
  220.                 }
  221.             }
  222.             if((GetKeyState(0x38) & 0x80) != 0){ //if the number 8 key is pressed, pause the quickswitcher
  223.                 cout << "Quickswitch macro paused" << endl;
  224.                 qswitch_active = false;
  225.                 Sleep(100);
  226.             }
  227.             Sleep(1);
  228.         }
  229.         if(!chat_active && !command_active){ //if the command menu is not open, and the user is not typing
  230.             Sleep(200); //since threads run alongside each other, sleep to avoid catching number key when choosing command
  231.             if((GetKeyState(0x37) & 0x80) != 0){ //if the number 7 key is pressed, activate it
  232.                 cout << "Quickswitch macro activated" << endl;
  233.                 qswitch_active = true;
  234.                 Sleep(100);
  235.             }
  236.         }
  237.         Sleep(1);
  238.     }
  239.     return NULL;
  240. }
  241.  
  242. void* qscope(void* ignore){ //quickscope function
  243.     bool qscope_active = false;
  244.     while(true){
  245.         while(qscope_active){
  246.             if((GetKeyState(VK_LBUTTON) & 0x80) != 0){ //if the users presses the left mouse button
  247.                 Sleep(50);
  248.                 click(false); //click right (zoom)
  249.                 Sleep(5);
  250.                 unclick(false); //un_click right
  251.                 Sleep(scope_speed_milliseconds); //wait for the scope to zoom
  252.                 click(true); //click middle (fire)
  253.                 Sleep(50);
  254.                 unclick(true); //un_click middle
  255.                 if(qswitch_key == 2 || qswitch_key == 3 || qswitch_key == 4){
  256.                     Generate_Key(qswitch_key); //quick switch using the key chosen
  257.                     Sleep(5);
  258.                     Generate_Key(1); //switch back to main weapon
  259.                     Sleep(1);
  260.                 }
  261.                 else{
  262.                     Generate_Key(qswitch_key); //quick switch using the key chosen
  263.                     Sleep(5);
  264.                     Generate_Key(qswitch_key); //switch back to main weapon
  265.                     Sleep(1);
  266.                 }
  267.             }
  268.             if((GetKeyState(0x30) & 0x80) != 0){ //if the number 0 key is pressed, pause it
  269.                 cout << "Quickscope macro paused" << endl;
  270.                 qscope_active = false;
  271.                 Sleep(100);
  272.             }
  273.             Sleep(1);
  274.         }
  275.         if(!chat_active && !command_active){
  276.             Sleep(200);
  277.             if((GetKeyState(0x39) & 0x80) != 0){ //if the number 9 key is pressed, activate it
  278.                 cout << "Quickscope macro activated" << endl;
  279.                 qscope_active = true;
  280.                 Sleep(100);
  281.             }
  282.         }
  283.         Sleep(1);
  284.     }
  285.     return NULL;
  286. }
  287.  
  288. void* crouch(void* ignore){ //crouch function
  289.     bool crouch_active = false;
  290.     while(true){
  291.         while(crouch_active){
  292.             if((GetKeyState(VK_LBUTTON) & 0x80) != 0){ //if the left mouse button is clicked
  293.                 Generate_Key_down(crouch_key); //generate the crouch key DOWN ONLY
  294.                 click(true); //middle click (fire)
  295.             }
  296.             else{ //if the left mouse button is not click
  297.                 Generate_Key_up(crouch_key); //generate a key up
  298.                 unclick(true); //unclick the middle (stop firing)
  299.             }
  300.             if((GetKeyState(0x28) & 0x80) != 0){ //if the down arrow is pressed, deactivate it
  301.                 cout << "Crouch macro paused" << endl;
  302.                 crouch_active = false;
  303.                 Sleep(100);
  304.             }
  305.             Sleep(1);
  306.         }
  307.         if(!chat_active && !command_active){
  308.             if((GetKeyState(0x26) & 0x80) != 0){ //if the up arrow is pressed, activate it
  309.                 cout << "Crouch macro activated" << endl;
  310.                 crouch_active = true;
  311.                 Sleep(100);
  312.             }
  313.         }
  314.         Sleep(1);
  315.     }
  316.     return NULL;
  317. }
  318.  
  319. void* walk(void* ignore){ //walk function
  320.     bool walk_active = false;
  321.     while(true){
  322.         while(walk_active){
  323.             if((GetKeyState(VK_LBUTTON) & 0x80) != 0){ //if the user left clicks
  324.                 Generate_Key_down(walk_key); //same idea as crouch, generate walk key DOWN
  325.                 click(true); //and fire
  326.             }
  327.             else{ //no left click
  328.                 Generate_Key_up(walk_key); //generate walk key up
  329.                 unclick(true); //stop firing
  330.             }
  331.             if((GetKeyState(0x27) & 0x80) != 0){ //if the right arrow is pressed, deactivate it
  332.                 cout << "Walk macro paused" << endl;
  333.                 walk_active = false;
  334.                 Sleep(100);
  335.             }
  336.             Sleep(1);
  337.         }
  338.         if(!chat_active && !command_active){
  339.             if((GetKeyState(0x25) & 0x80) != 0){ //if the left arrow is pressed, activate it
  340.                 cout << "Walk macro activated" << endl;
  341.                 walk_active = true;
  342.                 Sleep(100);
  343.             }
  344.         }
  345.         Sleep(1);
  346.     }
  347.     return NULL;
  348. }
  349.  
  350. void* tap(void* ignore){ //rapid mouse click function
  351.     bool tap_active = false;
  352.     int counter1 = 0; //number of clicks
  353.     int counter2 = 0; //number of bursts
  354.     while(true){
  355.         while(tap_active){
  356.             if((GetKeyState(VK_LBUTTON) & 0x80) != 0){ //if the left mouse button is clicked
  357.                 if(burst){ //if the user chose to burst
  358.                     while(counter2 < burst_amount){ //burst the chosen amount of times
  359.                         while(counter1 < click_amount){ //click the chosen amount of times
  360.                             macro_click();
  361.                             Sleep(1000/click_amount);
  362.                             counter1++;
  363.                         }
  364.                         counter1 = 0;
  365.                         Sleep(burst_speed);
  366.                         counter2++;
  367.                     }
  368.                     counter2 = 0;
  369.                 }
  370.                 else{ //if burst was not chosen
  371.                     while(counter1 < click_amount){ //click the chosen amount of times
  372.                         macro_click();
  373.                         Sleep(1000/click_amount);
  374.                         counter1++;
  375.                     }
  376.                     counter1 = 0;
  377.                 }
  378.             }
  379.             if((GetKeyState(VK_END) & 0x80) != 0){ //if the end key is pressed, deactivate it
  380.                 cout << "Tap macro paused" << endl;
  381.                 tap_active = false;
  382.                 Sleep(100);
  383.             }
  384.             Sleep(1);
  385.         }
  386.         if(!chat_active && !command_active){
  387.             if((GetKeyState(VK_HOME) & 0x80) != 0){ //if the home key is pressed, activate it
  388.                 cout << "Tap macro activated" << endl;
  389.                 tap_active = true;
  390.                 Sleep(100);
  391.             }
  392.         }
  393.         Sleep(1);
  394.     }
  395.     return NULL;
  396. }
  397.  
  398. void* normal(void* ignore){ //when you don't want to use any macros, but your fire button is middle click, and you still wanna left click
  399.     bool normal_active = false;
  400.     while(true){
  401.         while(normal_active){
  402.             if((GetKeyState(VK_LBUTTON) & 0x80) != 0){ //if the user left clicks
  403.                 click(true); //fire
  404.             }
  405.             else{ //otherwise
  406.                 unclick(true); //stop firing
  407.             }
  408.             if((GetKeyState(0x4C) & 0x80) != 0){ //if the "L" key is pressed, deactivate it
  409.                 cout << "Normal macro paused" << endl;
  410.                 normal_active = false;
  411.                 Sleep(100);
  412.             }
  413.             Sleep(1);
  414.         }
  415.         if(!chat_active && !command_active){
  416.             if((GetKeyState(0x4B) & 0x80) != 0){ //if the "K" key is pressed, activate it
  417.                 cout << "Normal macro activated" << endl;
  418.                 normal_active = true;
  419.                 Sleep(100);
  420.             }
  421.         }
  422.         Sleep(1);
  423.     }
  424.     return NULL;
  425. }
  426.  
  427. void* catch_chat_command(void* ignore){ //if the user opens a command menu
  428.     Sleep(200); //stops it from catching the user entering macro settings
  429.     while(true){
  430.         if((GetKeyState(0x58) & 0x80) != 0){ //if the "Z" key is pressed
  431.             if(!command_active){ //if the menu was not open
  432.                 command_active = true; //now it is
  433.             }
  434.             else if(command_active){ //if it was open
  435.                 command_active = false; //now it's not
  436.             }
  437.             Sleep(200);
  438.         }
  439.     //Note: No need for a separate bool for each chat menu. If "X" is open, and "C" is pressed, "C" will open instead
  440.         if((GetKeyState(0x59) & 0x80) != 0){ //if the user presses the "X" key
  441.             if(!command_active){ //same idea as before
  442.                 command_active = true;
  443.             }
  444.             else if(command_active){
  445.                 command_active = false;
  446.             }
  447.             Sleep(200);
  448.         }
  449.         if((GetKeyState(0x5A) & 0x80) != 0){ //if the user presses the "C" key
  450.             if(!command_active){ //same idea as before
  451.                 command_active = true;
  452.             }
  453.             else if(command_active){
  454.                 command_active = false;
  455.             }
  456.             Sleep(200);
  457.         }
  458.         if((GetKeyState(VK_RETURN) & 0x80) != 0){ //if the user presses the "Enter/ Return" key
  459.             if(!chat_active){ //if the chat was not open
  460.                 chat_active = true; //now it is
  461.             }
  462.             else if(chat_active){ //if it was open
  463.                 chat_active = false; //now it's not
  464.             }
  465.             Sleep(200);
  466.         }
  467.         if(command_active){ //if a command menu is open
  468.             if((GetKeyState(0x30) & 0x80) != 0){ //if the user presses the 0 key,close it
  469.                 command_active = false;
  470.                 Sleep(200);
  471.             }
  472.             if((GetKeyState(0x31) & 0x80) != 0){ //if the user presses the 1 key,close it
  473.                 command_active = false;
  474.                 Sleep(200);
  475.             }
  476.             if((GetKeyState(0x32) & 0x80) != 0){ //if the user presses the 2 key,close it
  477.                 command_active = false;
  478.                 Sleep(200);
  479.             }
  480.             if((GetKeyState(0x33) & 0x80) != 0){ //if the user presses the 3 key,close it
  481.                 command_active = false;
  482.                 Sleep(200);
  483.             }
  484.             if((GetKeyState(0x34) & 0x80) != 0){ //if the user presses the 4 key,close it
  485.                 command_active = false;
  486.                 Sleep(200);
  487.             }
  488.             if((GetKeyState(0x35) & 0x80) != 0){ //if the user presses the 5 key,close it
  489.                 command_active = false;
  490.                 Sleep(200);
  491.             }
  492.             if((GetKeyState(0x36) & 0x80) != 0){ //if the user presses the 6 key,close it
  493.                 command_active = false;
  494.                 Sleep(200);
  495.             }
  496.             if((GetKeyState(0x37) & 0x80) != 0){ //if the user presses the 7 key,close it
  497.                 command_active = false;
  498.                 Sleep(200);
  499.             }
  500.             if((GetKeyState(0x38) & 0x80) != 0){ //if the user presses the 8 key,close it
  501.                 command_active = false;
  502.                 Sleep(200);
  503.             }
  504.             if((GetKeyState(0x39) & 0x80) != 0){ //if the user presses the 9 key,close it
  505.                 command_active = false;
  506.                 Sleep(200);
  507.             }
  508.         }
  509.         if(chat_active){ //if the chat is active
  510.             if((GetKeyState(VK_RETURN) & 0x80) != 0){ //if the "Return/ Enter" key is pressed, deactivate it
  511.                 chat_active = false;
  512.                 Sleep(200);
  513.             }
  514.         }
  515.         Sleep(1);
  516.     }
  517.     return NULL;
  518. }
  519.  
  520. void setup(){ //prompts user for macro settings
  521.     scope_speed_milliseconds = choose_scope_speed(); //sets the scope speed
  522.     //==========================//
  523.     qswitch_key = choose_key(0); //chooses the quickswitch key
  524.     //==========================//
  525.     crouch_key = choose_key(1); //chooses the crouch key
  526.     //==========================//
  527.     walk_key = choose_key(2); //chooses the walk key
  528.     //==========================//
  529.     string response; //macro settings
  530.     cout << "Burst? (y/n) ";
  531.     cin >> response;
  532.     if(response == "y"){
  533.         burst = true;
  534.         cout << "Wait time between bursts? (in milliseconds) ";
  535.         cin >> burst_speed;
  536.         cout << "How many bursts? ";
  537.         cin >> burst_amount;
  538.     }
  539.     cout << "Clicks per second? ";
  540.     cin >> click_amount;
  541. }
  542.  
  543. int main() //program STARTS here
  544. {
  545.     setup(); //get settings
  546.     pthread_t qswitch_thread; //variables for threads
  547.     pthread_t qscope_thread;
  548.     pthread_t crouch_thread;
  549.     pthread_t walk_thread;
  550.     pthread_t tap_thread;
  551.     pthread_t normal_thread;
  552.     pthread_t catch_thread;
  553.     pthread_create(&qswitch_thread, NULL, &qswitch, NULL); //start each thread (using P_THREADS)
  554.     pthread_create(&qscope_thread, NULL, &qscope, NULL);
  555.     pthread_create(&crouch_thread, NULL, &crouch, NULL);
  556.     pthread_create(&walk_thread, NULL, &walk, NULL);
  557.     pthread_create(&tap_thread, NULL, &tap, NULL);
  558.     pthread_create(&normal_thread, NULL, &normal, NULL);
  559.     pthread_create(&catch_thread, NULL, &catch_chat_command, NULL);
  560.     while(true){
  561.         Sleep(1);
  562.     }
  563.     return 0;
  564. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement