Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- let end = 1000; //Ставим сколько нужно купить оружия
- let wp = 503; // Выбираем что купить. Бита: 501, Нож: 502, Пистолет: 503
- let time = 800; //Время между покупками в мс
- let score = 0;
- function buy_item(_viewer_id, _auth_key) {
- $.post('script.php', {
- action: 'buy_item',
- type: wp,
- viewer_id: _viewer_id,
- auth_key: _auth_key
- }, 'json');
- }
- function myLoop() {
- setTimeout(function () {
- buy_item(_viewer_id, _auth_key);
- score++;
- console.log(score);
- if (score < end) {
- myLoop();
- }
- }, time);
- }
- myLoop();
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement