Advertisement
stuppid_bot

Untitled

Feb 15th, 2014
147
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. function sendGift() {
  2.     var giftIds = [66, 69]; // id подарков через запятую
  3.     var giftId = giftIds[Math.floor(Math.random() * giftIds.length)];
  4.     var req = new XMLHttpRequest;
  5.     req.open('GET', '/al_gifts.php?act=get_gift_box&al=1&fr=0&mid=' + vk.id);
  6.     req.onload = function () {
  7.         var hash = req.response.match(/hash: '(.+?)'/)[1];
  8.         ajax.post('/al_gifts.php', {
  9.             act: 'do_send',
  10.             al: 1,
  11.             from: 'profile',
  12.             hash: hash,
  13.             mids: vk.id,
  14.             need_module: 0,
  15.             number: giftId,
  16.             text: 'Люблю себя',
  17.             type: 0
  18.         });
  19.     };
  20.     req.send();
  21. }
  22.  
  23. sendGift();
  24. setInterval(sendGift, 60 * 1000);
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement