Загрузка...

Scripts for VK Sova V RE

Thread in Node.js created by may_gaff Jun 4, 2022. 12,246 views

  1. may_gaff
    may_gaff Topic starter Jun 4, 2022 4 Jul 10, 2021
    Решил поделится с вами своими скриптами 19-ого года.
    Для начала нужно создать файл с любым названием, но обязательно с расширение .js.
    Далее копируем код и вставляем в фаил.
    JavaScript
    function randomInt() {
    return Math.floor(Math.random() * 2147483647.0);
    }

    function toastTyping(u) {
    Toast.toast(String.format(' {0} {1} печатает...', u.first_name, u.last_name), false);
    }

    if (!String.format) {
    String.format = function(format) {
    var args = Array.prototype.slice.call(arguments, 1);
    return format.replace(/{(\d+)}/g, function(match, number) {
    return typeof args[number] != 'undefined'
    ? args[number]
    : match
    ;
    });
    };
    }

    var typers = [];
    var users = [];

    onStart = function(a) {
    Toast.toast('release bot v0.0.2', false);

    var t = Storage.getItem('typing');
    if (t) typers = JSON.parse(t);

    repeat (function (){
    for (var i = 0; i < typers.length; i++)
    Vk.call('messages.setActivity', {peer_id: typers[i], type: 'typing'}, function (response) {});
    }, 4800, 4800);
    }

    onStop = function(a) {
    log("onStop!");
    }

    Vk.onTyping = function (t) {
    if (t.peerId != t.userId)
    return;

    var u = users[t.userId.toString()];
    if (u) toastTyping(u);
    else {
    Vk.call('users.get', {user_ids: t.userId}, function (r) {
    var u = r.body[0];
    toastTyping(u);
    });
    }
    }

    Vk.onMessage = function(message) {
    log("peerId=" + message.peerId + ", Vk.myId()="+Vk.myId());
    log("Got VK message from " + message.fromId + " with text " + message.text);

    if(message.incoming){
    return;
    }

    var p, del;
    if(message.text.toLowerCase().startsWith(".say ")) {
    p = message.text.substring(5);
    }
    switch (message.text.toLowerCase().substring(1)) {
    case 'xz':
    p = '¯\\_(ツ)_/¯';
    break;
    case 'mm':
    p = '( ° ʖ °)';
    break;
    case 'kris':
    p = '…ᘛ⁐ᕐᐷ';
    break;
    case 'wtf':
    p = '(ノ ̄皿 ̄)ノ ⌒== ┫';
    break;
    case 'pl':
    p = '༼;´༎ ۝ ༎༽';
    break;
    case 'nn':
    p = '¯\\_(ツ)_/¯';
    break;
    case 'oy':
    p = '°^°';
    break;
    case 'magic':
    p = '(`▽´)―━━☆⌒*';
    break;
    case 'sho':
    p = 'ヽ( ̄~ ̄)ノ';
    break;
    case 'sho2':
    p = '┐( ̄ヘ ̄)┌ ';
    break;
    case 'pas':
    del = true;
    if (typers.indexOf(message.peerId) != -1) {
    typers.splice(typers.indexOf(message.peerId), 1);
    Toast.toast('Выключено', false);
    } else {
    typers.push(message.peerId);
    Toast.toast('Включено', false);
    }
    Storage.setItem('typing', JSON.stringify(typers));
    break;
    }

    if (p)
    Vk.call('messages.edit', {peer_id: message.peerId, message: p, message_id: message.id}, function(response){
    log(response);
    });
    else if (del)
    Vk.call('messages.delete', {peer_id: message.peerId, message_ids: message.id, delete_for_all: 1}, function(response){});
    }
    .xz-¯\\_(ツ)_/¯
    .nn-¯\\_(ツ)_/¯
    .oy- = °^°
    .magic- =(`▽´)―━━☆⌒*
    .sho-ヽ( ̄~ ̄)ノ
    .sho2-┐( ̄ヘ ̄)┌
    .mm-( ° ʖ °)
    .kris-ᘛ⁐ᕐᐷ
    wtf-(ノ ̄皿 ̄)ノ ⌒== ┫
    .pas-постоянно печатаешь
    Надеюсь кому-то это будет полезно.
     
  2. NK_TRIPLLE
    Такое,использовать var в 19,ну ты и говнокодер
     
    1. may_gaff Topic starter
      NK_TRIPLLE, это было в 19-ом году.. хотя и сейчас ничего не поменялось...
    2. Khnzhsky
      may_gaff, А какие нынче стоят?
    3. Точная остановка
      NK_TRIPLLE, сам то хоть отличие let от var знаешь?
  3. wanders
    wanders Apr 1, 2023 0 Apr 1, 2023
    можете скриптов покидать?
     
Loading...
Top