• Как поиграть на серверах CS:GO?

    Нажмите правой кнопкой мыши на "Counter-Strike 2", выберите Свойства, далее - Бета-версии и там выберите (выпадающий список, где написано "Нет") - csgo_legacy - Legacy Version of CS:GO
    Дождитесь окончания загрузки файлов и наслаждайтесь привычной CS:GO :)

    Если не понятно, то посмотрите это видео: https://www.youtube.com/watch?v=3XPFPkeHsso
Добро пожаловать на Net4ALL
Привет, рады видеть у нас на портале. Для полноценного использования возможностей нашего форума вам необходимо зарегистрироваться. Зарегистрировавшись, Вы сможете общаться с другими членами сообщества, просматривать, скрытые от гостей, разделы и многое другое. Не забудьте привязать SteamID к профилю форума, чтобы выигрывать VIP на ивентах и другие призы.
Зарегистрироваться

Полезность для игры на распродаже Steam

Broccoli

Проверенный
Забанен
10 Окт 2016
95
43
18
26
Информация для игры на распродаже: заходите через браузер, открываете консоль (в опере пкм>Просмотреть код элемента>Console) и перед боем - пишете туда: CEnemyManager.prototype.BuildEnemy = function(){};
Мобы пропадут, и можно в течении нескольких минут заниматься своими делами, не утруждая себя закликиванием мобов. Очки дают просто за прожитое время. Наличие мобов на получение очков не влияет. Нет мобов - нет возможности умереть, а значит - халявный фарм.
Способ был найден в свободном доступе, выложу сюда, мб кому-нибудь пригодится.
 
Спасибо

UPD: Можно и более честным (тоже читерским) путём пойти:

setInterval(() => gGame.m_State.m_EnemyManager.m_rgEnemies.forEach(enemy => enemy.Die(true)), 1000);

Убивает всех мобов каждую секунду
 
Последнее редактирование:
  • Like
Реакции: /Ice/Storm/
Еще вот так можно, но если изменить очки, то выбьет под конец игры и их все равно не дадут:
- Установить кол-во хп:
gGame.m_State.m_PlayerHealth = 1000000;
- Установить кол-во убитых врагов:
gGame.m_State.m_EnemyManager.m_nDefeatedEnemies = 99999999;
- Установить счёт:
gGame.m_State.m_Score = 9999999;
- Закончить игру:
gGame.m_State.m_rtBattleEnd = Date.now();
- Бесконечный раунд:
gGame.m_State.m_rtBattleEnd = Date.now() + 100000000000000000;
- Установить имбо psycho оружие:
gGame.m_State.m_AttackManager.m_AttackData.psychicattack.speed = 9999;
gGame.m_State.m_AttackManager.m_AttackData.psychicattack.cooldown = 0;
gGame.m_State.m_AttackManager.m_AttackData.psychicattack.damage = 99999;
Бот для автоматической игры:
Код:
(function(context) {
const pixi = gApp;
const GAME = gGame;
const SERVER = gServer;
const SetMouse = function SetMouse(x, y) {
    pixi.renderer.plugins.interaction.mouse.global.x = x;
    pixi.renderer.plugins.interaction.mouse.global.y = y;
}
const EnemyManager = function EnemyManager() {
    return GAME.m_State.m_EnemyManager;
}
const AttackManager = function AttackManager() {
    return GAME.m_State.m_AttackManager;
}

const TryContinue = function Continue() {
    let continued = false;
    if (GAME.m_State.m_VictoryScreen) {
        GAME.m_State.m_VictoryScreen.children.forEach(function(child) {
            if (child.visible && child.x == 155 && child.y == 300) {// TODO: not this
                continued = true;
                child.click();
            }
        })
    }
    if (GAME.m_State.m_LevelUpScreen) {
        continued = false;
        GAME.m_State.m_LevelUpScreen.children.forEach(function(child) {
            if (child.visible && child.x == 155 && child.y == 300) {// TODO: not this
                continued = true;
                child.click();
            }
        })
    }
    return continued;
}


// Let's challenge ourselves to be human here!
const CLICKS_PER_SECOND = 10;

const InGame = function InGame() {
    return GAME.m_State.m_bRunning;
}

const InZoneSelect = function InZoneSelect() {
    return GAME.m_State instanceof CBattleSelectionState;
}

const WORST_SCORE = -1 / 0;
const START_POS = pixi.renderer.width;

// context.lastZoneIndex;
let isJoining = false;

const EnemySpeed = function EnemySpeed(enemy) {
    return enemy.m_Sprite.vx;
}
const EnemyDistance = function EnemyDistance(enemy) {
    return (enemy.m_Sprite.x - k_nDamagePointx) / (START_POS - k_nDamagePointx);
}


class Attack {
    constructor() {
        this.nextAttackDelta = 0;
    }
    shouldAttack(delta) {
        throw new Error("shouldAttack not implemented");
    }
    process(enemies) {
        throw new Error("process not implemented");
    }
}

// Basic clicking attack, attack closest
class ClickAttack extends Attack {
    shouldAttack(delta) {
        this.nextAttackDelta -= delta;
        return this.nextAttackDelta <= 0;;
    }
    score(enemy) {
        if (enemy.m_bDead)
            return WORST_SCORE;
        return 1 - EnemyDistance(enemy);
    }
    process(enemies) {
        let target, target_score = WORST_SCORE;

        enemies.forEach((enemy) => {
            if (!enemy.m_Sprite.visible)
                return;
            let now_score = this.score(enemy);
            if (now_score > target_score) {
                target = enemy, target_score = now_score;
            }
        });

        if (target)
            this.attack(target);
    }
    attack(enemy) {
        enemy.m_Sprite.click();
        this.nextAttackDelta = 1 / CLICKS_PER_SECOND;
    }
}

// the '1' button (SlimeAttack PsychicAttack BeastAttack - depends on body type of your salien)
class SpecialAttack extends Attack {
    getCurrent() {
        if (gSalien.m_BodyType == "slime")
            return "slimeattack";
        else if (gSalien.m_BodyType == "beast")
            return "beastattack";
        else
            return "psychicattack";
    }
    getData() {
        return AttackManager().m_AttackData[this.getCurrent()];
    }
    shouldAttack(delta) {
        let Manager = AttackManager().m_mapCooldowns.get(this.getCurrent());
        let lastUsed = Manager.m_rtAttackLastUsed;
        let canAttack = Manager.BAttack();
        Manager.m_rtAttackLastUsed = lastUsed;
        return canAttack
    }
    score(enemy) {
        if (enemy.m_bDead)
            return WORST_SCORE;
        return enemy.m_nHealth;
    }
    process(enemies) {
        let target, target_score = WORST_SCORE;

        enemies.forEach((enemy) => {
            if (!enemy.m_Sprite.visible)
                return;
            let now_score = this.score(enemy);
            if (now_score > target_score) {
                target = enemy, target_score = now_score;
            }
        });

        if (target)
            this.attack(target.m_Sprite.x, target.m_Sprite.y);
    }
    attack(x, y) {
        SetMouse(x, y)
        AttackManager().m_mapKeyCodeToAttacks.get(this.getData().keycode)()
    }
}

let attacks = [
    new ClickAttack(),
    new SpecialAttack()
]

if (context.BOT_FUNCTION) {
    pixi.ticker.remove(context.BOT_FUNCTION);
    context.BOT_FUNCTION = undefined;
}

context.BOT_FUNCTION = function ticker(delta) {
    delta /= 100;

    if(GAME.m_IsStateLoading) {
        return;
    }

    if (InZoneSelect()) {
        if (context.lastZoneIndex !== undefined && !isJoining) {
            isJoining = true;
            SERVER.JoinZone(
                lastZoneIndex,
                function ( results ) {
                    gGame.ChangeState( new CBattleState( GAME.m_State.m_PlanetData, context.lastZoneIndex ) );
                },
                GameLoadError
                );
          
            return;
        }
    }
    if (!InGame()) {
        if (TryContinue()) {
            console.log("continued!");
        }
        return;
    }
  
    isJoining = false;
    context.lastZoneIndex = GAME.m_State.m_unZoneIndex;

    let state = EnemyManager();

    let enemies = state.m_rgEnemies;

    for (let attack of attacks)
        if (attack.shouldAttack(delta))
            attack.process(enemies);

}


pixi.ticker.add(context.BOT_FUNCTION);

})(window);
 
Еще вот так можно, но если изменить очки, то выбьет под конец игры и их все равно не дадут:
- Установить кол-во хп:
gGame.m_State.m_PlayerHealth = 1000000;
- Установить кол-во убитых врагов:
gGame.m_State.m_EnemyManager.m_nDefeatedEnemies = 99999999;
- Установить счёт:
gGame.m_State.m_Score = 9999999;
- Закончить игру:
gGame.m_State.m_rtBattleEnd = Date.now();
- Бесконечный раунд:
gGame.m_State.m_rtBattleEnd = Date.now() + 100000000000000000;
- Установить имбо psycho оружие:
gGame.m_State.m_AttackManager.m_AttackData.psychicattack.speed = 9999;
gGame.m_State.m_AttackManager.m_AttackData.psychicattack.cooldown = 0;
gGame.m_State.m_AttackManager.m_AttackData.psychicattack.damage = 99999;
Бот для автоматической игры:
Код:
(function(context) {
const pixi = gApp;
const GAME = gGame;
const SERVER = gServer;
const SetMouse = function SetMouse(x, y) {
    pixi.renderer.plugins.interaction.mouse.global.x = x;
    pixi.renderer.plugins.interaction.mouse.global.y = y;
}
const EnemyManager = function EnemyManager() {
    return GAME.m_State.m_EnemyManager;
}
const AttackManager = function AttackManager() {
    return GAME.m_State.m_AttackManager;
}

const TryContinue = function Continue() {
    let continued = false;
    if (GAME.m_State.m_VictoryScreen) {
        GAME.m_State.m_VictoryScreen.children.forEach(function(child) {
            if (child.visible && child.x == 155 && child.y == 300) {// TODO: not this
                continued = true;
                child.click();
            }
        })
    }
    if (GAME.m_State.m_LevelUpScreen) {
        continued = false;
        GAME.m_State.m_LevelUpScreen.children.forEach(function(child) {
            if (child.visible && child.x == 155 && child.y == 300) {// TODO: not this
                continued = true;
                child.click();
            }
        })
    }
    return continued;
}


// Let's challenge ourselves to be human here!
const CLICKS_PER_SECOND = 10;

const InGame = function InGame() {
    return GAME.m_State.m_bRunning;
}

const InZoneSelect = function InZoneSelect() {
    return GAME.m_State instanceof CBattleSelectionState;
}

const WORST_SCORE = -1 / 0;
const START_POS = pixi.renderer.width;

// context.lastZoneIndex;
let isJoining = false;

const EnemySpeed = function EnemySpeed(enemy) {
    return enemy.m_Sprite.vx;
}
const EnemyDistance = function EnemyDistance(enemy) {
    return (enemy.m_Sprite.x - k_nDamagePointx) / (START_POS - k_nDamagePointx);
}


class Attack {
    constructor() {
        this.nextAttackDelta = 0;
    }
    shouldAttack(delta) {
        throw new Error("shouldAttack not implemented");
    }
    process(enemies) {
        throw new Error("process not implemented");
    }
}

// Basic clicking attack, attack closest
class ClickAttack extends Attack {
    shouldAttack(delta) {
        this.nextAttackDelta -= delta;
        return this.nextAttackDelta <= 0;;
    }
    score(enemy) {
        if (enemy.m_bDead)
            return WORST_SCORE;
        return 1 - EnemyDistance(enemy);
    }
    process(enemies) {
        let target, target_score = WORST_SCORE;

        enemies.forEach((enemy) => {
            if (!enemy.m_Sprite.visible)
                return;
            let now_score = this.score(enemy);
            if (now_score > target_score) {
                target = enemy, target_score = now_score;
            }
        });

        if (target)
            this.attack(target);
    }
    attack(enemy) {
        enemy.m_Sprite.click();
        this.nextAttackDelta = 1 / CLICKS_PER_SECOND;
    }
}

// the '1' button (SlimeAttack PsychicAttack BeastAttack - depends on body type of your salien)
class SpecialAttack extends Attack {
    getCurrent() {
        if (gSalien.m_BodyType == "slime")
            return "slimeattack";
        else if (gSalien.m_BodyType == "beast")
            return "beastattack";
        else
            return "psychicattack";
    }
    getData() {
        return AttackManager().m_AttackData[this.getCurrent()];
    }
    shouldAttack(delta) {
        let Manager = AttackManager().m_mapCooldowns.get(this.getCurrent());
        let lastUsed = Manager.m_rtAttackLastUsed;
        let canAttack = Manager.BAttack();
        Manager.m_rtAttackLastUsed = lastUsed;
        return canAttack
    }
    score(enemy) {
        if (enemy.m_bDead)
            return WORST_SCORE;
        return enemy.m_nHealth;
    }
    process(enemies) {
        let target, target_score = WORST_SCORE;

        enemies.forEach((enemy) => {
            if (!enemy.m_Sprite.visible)
                return;
            let now_score = this.score(enemy);
            if (now_score > target_score) {
                target = enemy, target_score = now_score;
            }
        });

        if (target)
            this.attack(target.m_Sprite.x, target.m_Sprite.y);
    }
    attack(x, y) {
        SetMouse(x, y)
        AttackManager().m_mapKeyCodeToAttacks.get(this.getData().keycode)()
    }
}

let attacks = [
    new ClickAttack(),
    new SpecialAttack()
]

if (context.BOT_FUNCTION) {
    pixi.ticker.remove(context.BOT_FUNCTION);
    context.BOT_FUNCTION = undefined;
}

context.BOT_FUNCTION = function ticker(delta) {
    delta /= 100;

    if(GAME.m_IsStateLoading) {
        return;
    }

    if (InZoneSelect()) {
        if (context.lastZoneIndex !== undefined && !isJoining) {
            isJoining = true;
            SERVER.JoinZone(
                lastZoneIndex,
                function ( results ) {
                    gGame.ChangeState( new CBattleState( GAME.m_State.m_PlanetData, context.lastZoneIndex ) );
                },
                GameLoadError
                );
       
            return;
        }
    }
    if (!InGame()) {
        if (TryContinue()) {
            console.log("continued!");
        }
        return;
    }
 
    isJoining = false;
    context.lastZoneIndex = GAME.m_State.m_unZoneIndex;

    let state = EnemyManager();

    let enemies = state.m_rgEnemies;

    for (let attack of attacks)
        if (attack.shouldAttack(delta))
            attack.process(enemies);

}


pixi.ticker.add(context.BOT_FUNCTION);

})(window);
Зачем кидать старую версию кода который обновляется каждый час, ещё и без указания автора...

Ссылки на гитхаб у нас, не запрещены.
 
Еще один код, похожий на тот, что давали выше. Запуск тот же, что и в первом скрипте.
Для полноценной работы нужен Tampermonkey. Можете найти в магазине расширений. Ничего плохого этот Tampermonkey не делает, он лишь нужен для работы ваших скриптов.
Код:
// ==UserScript==
// @name         Saliens bot
// @namespace    http://tampermonkey.net/
// @version      15
// @description  Beat all the saliens levels
// @author       https://github.com/meepen/salien-bot
// @match        https://steamcommunity.com/saliengame
// @match        https://steamcommunity.com/saliengame/
// @match        https://steamcommunity.com/saliengame/play
// @match        https://steamcommunity.com/saliengame/play/
// @downloadURL  https://github.com/meepen/salien-bot/raw/master/index.user.js
// @updateURL    https://github.com/meepen/salien-bot/raw/master/index.user.js
// @grant        none
// ==/UserScript==

if (typeof GM_info !== "undefined" && (GM_info.scriptHandler || "Greasemonkey") == "Greasemonkey") {
    alert("It's not possible to support Greasemonkey, please try Tampermonkey or ViolentMonkey.");
}

(function(context) {
"use strict";

// when the error is fixed we should remove the following
CSalien.prototype.UpdateCustomizations = function()
{
    this.SetBodyType(BODY_TYPES[gSalienData.body_type]);
    this.LoadAttachments();
}
const APP = context.gApp;
const GAME = context.gGame;
const SERVER = context.gServer;
const PIXI = context.PIXI;

const Option = function Option(name, def) {
    if (window.localStorage[name] === undefined) {
        context.localStorage[name] = def;
    }
    return context.localStorage[name];
}
Option("forceLevellingMode", false);
const SetMouse = function SetMouse(x, y) {
    APP.renderer.plugins.interaction.mouse.global.x = x;
    APP.renderer.plugins.interaction.mouse.global.y = y;
}
const EnemyManager = function EnemyManager() {
    return GAME.m_State.m_EnemyManager;
}
const AttackManager = function AttackManager() {
    return GAME.m_State.m_AttackManager;
}

let isJoining = false;
const TryContinue = function TryContinue() {
    let continued = false;
    if (GAME.m_State.m_VictoryScreen) {
        GAME.m_State.m_VictoryScreen.children.forEach(function(child) {
            if (child.visible && child.x == 155 && child.y == 300) {// TODO: not this
                continued = true;
                child.click();
            }
        })
    }
    if (GAME.m_State.m_LevelUpScreen) {
        continued = false;
        GAME.m_State.m_LevelUpScreen.children.forEach(function(child) {
            if (child.visible && child.x == 155 && child.y == 300) {// TODO: not this
                continued = true;
                child.click();
            }
        })
    }
    if (GAME.m_State instanceof CBootState) { // First screen
        gGame.m_State.button.click();
    }
    if (GAME.m_State instanceof CPlanetSelectionState && !isJoining) { // Planet Selectiong
        GAME.m_State.m_rgPlanetSprites[0].click();
        isJoining = true;
        setTimeout(() => isJoining = false, 1000);
        continued = true;
    }
    if (GAME.m_State instanceof CBattleSelectionState && !isJoining) {
        let bestZoneIdx = GetBestZone();
        if(bestZoneIdx) {
            console.log(GAME.m_State.m_SalienInfoBox.m_LevelText.text, GAME.m_State.m_SalienInfoBox.m_XPValueText.text);
            console.log("join to zone", bestZoneIdx);
            isJoining = true;
            SERVER.JoinZone(
                bestZoneIdx,
                (results) => {
                    GAME.ChangeState(new CBattleState(GAME.m_State.m_PlanetData, bestZoneIdx));
                    isJoining = false;
                    console.log(results);
                },
                () => {
                    console.log("fail");
                    isJoining = false;
                }
            );
        }
        console.log(bestZoneIdx);
        return;
    }
    return continued;
}
const CanAttack = function CanAttack(attackname) {
    let Manager = AttackManager().m_mapCooldowns.get(attackname);
    let lastUsed = Manager.m_rtAttackLastUsed;
    let canAttack = Manager.BAttack();
    Manager.m_rtAttackLastUsed = lastUsed;
    return canAttack;
}
const GetBestZone = function GetBestZone() {
    let bestZoneIdx;
    let highestDifficulty = -1;

    let isLevelling = context.gPlayerInfo.level < 9 || Option("forceLevellingMode");
    let maxProgress = isLevelling ? 10000 : 0;

    for (let idx = 0; idx < GAME.m_State.m_Grid.m_Tiles.length; idx++) {
        let zone = GAME.m_State.m_Grid.m_Tiles[idx].Info;
        if (!zone.captured) {
            if (zone.boss) {
                console.log(`zone ${idx} (${bestZoneIdx % k_NumMapTilesW}, ${(bestZoneIdx / k_NumMapTilesW) | 0}) with boss`);
                return idx;
            }

            if(isLevelling) {
                if(zone.difficulty > highestDifficulty) {
                    highestDifficulty = zone.difficulty;
                    maxProgress = zone.progress;
                    bestZoneIdx = idx;
                } else if(zone.difficulty < highestDifficulty) continue;

                if(zone.progress < maxProgress) {
                    maxProgress = zone.progress;
                    bestZoneIdx = idx;
                }
            } else {
                if(zone.progress > maxProgress) {
                    maxProgress = zone.progress;
                    bestZoneIdx = idx;
                }
            }

        }
    }

    if(bestZoneIdx !== undefined) {
        console.log(`${GAME.m_State.m_PlanetData.state.name} zone ${bestZoneIdx} (${bestZoneIdx % k_NumMapTilesW}, ${(bestZoneIdx / k_NumMapTilesW) | 0}) progress: ${GAME.m_State.m_Grid.m_Tiles[bestZoneIdx].Info.progress} difficulty: ${GAME.m_State.m_Grid.m_Tiles[bestZoneIdx].Info.difficulty}`);
    }

    return bestZoneIdx;
}
const GetBestPlanet = function GetBestPlanet() {
    let bestPlanet;
    let maxProgress = 0;

    if (!GAME.m_State.m_mapPlanets)
        return;

    for (let planetKV of GAME.m_State.m_mapPlanets) {
        let planet = planetKV[1];
        if(planet.state.active && !planet.state.captured && planet.state.capture_progress > maxProgress) {
            maxProgress = planet.state.capture_progress;
            bestPlanet = planet;
        }

    }

    if(bestPlanet) {
        console.log(`selecting planet ${bestPlanet.state.name} with progress: ${bestPlanet.state.capture_progress}`);
        return bestPlanet.id;
    }
}

// Let's challenge ourselves to be human here!
const CLICKS_PER_SECOND = 15;

const InGame = function InGame() {
    return GAME.m_State.m_bRunning;
}

const WORST_SCORE = -1 / 0;
const START_POS = APP.renderer.width;


const EnemySpeed = function EnemySpeed(enemy) {
    return enemy.m_Sprite.vx;
}
const EnemyDistance = function EnemyDistance(enemy) {
    return (enemy.m_Sprite.x - k_nDamagePointx) / (START_POS - k_nDamagePointx);
}

const EnemyCenter = function EnemyCenter(enemy) {
    return [
        enemy.m_Sprite.x + enemy.m_Sprite.width / 2,
        enemy.m_Sprite.y + enemy.m_Sprite.height / 2
    ];
}


class Attack {
    constructor() {
        this.nextAttackDelta = 0;
    }
    shouldAttack(delta, enemies) {
        throw new Error("shouldAttack not implemented");
    }
    process(enemies) {
        throw new Error("process not implemented");
    }
    getAttackName() {
        throw new Error("no current attack name");
    }
    canAttack() {
        return CanAttack(this.getAttackName());
    }
    getAttackData() {
        return AttackManager().m_AttackData[this.getAttackName()];
    }
}

// Basic clicking attack, attack closest
class ClickAttack extends Attack {
    shouldAttack(delta) {
        // Can't do basic attack when station is down
        if (GAME.m_State.m_PlayerHealth <= 0)
            return false;
        this.nextAttackDelta -= delta;
        return this.nextAttackDelta <= 0;;
    }
    score(enemy) {
        if (enemy.m_bDead)
            return WORST_SCORE;
        return 1 - EnemyDistance(enemy);
    }
    process(enemies) {
        let target, target_score = WORST_SCORE;

        enemies.forEach((enemy) => {
            if (!enemy.m_Sprite.visible)
                return;
            let now_score = this.score(enemy);
            if (now_score > target_score) {
                target = enemy, target_score = now_score;
            }
        });

        if (target)
            this.attack(target);
    }
    attack(enemy) {
        enemy.m_Sprite.click();
        this.nextAttackDelta = 1 / CLICKS_PER_SECOND;
    }
}

class ProjectileAttack extends Attack {
    shouldAttack(delta) {
        return CanAttack(this.getAttackName());
    }
    score(enemy) {
        if (enemy.m_bDead)
            return WORST_SCORE;
        return enemy.m_nHealth;
    }
    process(enemies) {
        let target, target_score = WORST_SCORE;

        enemies.forEach((enemy) => {
            if (!enemy.m_Sprite.visible)
                return;
            let now_score = this.score(enemy);
            if (now_score > target_score) {
                target = enemy, target_score = now_score;
            }
        });

        if (target)
            this.attack.apply(this, EnemyCenter(target));
    }
    attack(x, y) {
        SetMouse(x, y)
        AttackManager().m_mapKeyCodeToAttacks.get(this.getAttackData().keycode)()
    }
}

// the '1' button (SlimeAttack PsychicAttack BeastAttack - depends on body type of your salien)
class SpecialAttack extends ProjectileAttack {
    getAttackName() {
        if (gSalien.m_BodyType == "slime")
            return "slimeattack";
        else if (gSalien.m_BodyType == "beast")
            return "beastattack";
        else
            return "psychicattack";
    }
}

class BombAttack extends ProjectileAttack {
    getAttackName() {
        return "explosion";
    }
}
class BlackholeAttack extends ProjectileAttack {
    getAttackName() {
        return "blackhole";
    }
}

class FreezeAttack extends Attack {
    getCurrent() {
        return "flashfreeze";
    }
    shouldAttack(delta, enemies) {
        let shouldAttack = false;
        if (CanAttack(this.getCurrent())) {
            enemies.forEach((enemy) => {
                if (EnemyDistance(enemy) <= 0.05) {
                    shouldAttack = true;
                }
            });
        }
        return shouldAttack;
    }
    getData() {
        return AttackManager().m_AttackData[this.getCurrent()];
    }
    process() {
        AttackManager().m_mapKeyCodeToAttacks.get(this.getData().keycode)()
    }
}

let attacks = [
    new ClickAttack(),
    new SpecialAttack(),
    new FreezeAttack(),
    new BombAttack(),
    new BlackholeAttack()
]

if (context.BOT_FUNCTION) {
    APP.ticker.remove(context.BOT_FUNCTION);
    context.BOT_FUNCTION = undefined;
}

let reloadingPage = false;

context.BOT_FUNCTION = function ticker(delta) {
    delta /= 100;

    let difficulties = PIXI.loader.resources['level_config'];
    if (difficulties)
        for (let difficulty in difficulties.data) {
            let freq = difficulties.data[difficulty].enemies.spawn_frequency;
            freq.min = freq.max;
        }

    let buttonsOnErrorMessage = document.getElementsByClassName("btn_grey_white_innerfade btn_medium");
    if(buttonsOnErrorMessage[0] != null) {
        if (!reloadingPage) {
            setTimeout(() => buttonsOnErrorMessage[0].click(), 1000);
        }

        return;
    }

    if(GAME.m_IsStateLoading || !context.gPlayerInfo) {
        return;
    }

    if (!InGame()) {
        if (TryContinue()) {
            console.log("continued!");
        }
        return;
    }



    let state = EnemyManager();

    let enemies = state.m_rgEnemies;

    for (let attack of attacks)
        if (attack.shouldAttack(delta, enemies))
            attack.process(enemies);

}


APP.ticker.add(context.BOT_FUNCTION);

})(window);

исходник здесь. Может обновляться:
p.s. еще инфа, если вечно перезапускается игра: попробуйте вынести её в отдельную вкладку, в браузере.
Вот пример, как должно быть:
PY6962S.png
 
Последнее редактирование:
Еще один код, похожий на тот, что давали выше. Запуск тот же, что и в первом скрипте.
Код:
// ==UserScript==
// @name         Saliens bot
// @namespace    http://tampermonkey.net/
// @version      15
// @description  Beat all the saliens levels
// @author       https://github.com/meepen/salien-bot
// @match        https://steamcommunity.com/saliengame
// @match        https://steamcommunity.com/saliengame/
// @match        https://steamcommunity.com/saliengame/play
// @match        https://steamcommunity.com/saliengame/play/
// @downloadURL  https://github.com/meepen/salien-bot/raw/master/index.user.js
// @updateURL    https://github.com/meepen/salien-bot/raw/master/index.user.js
// @grant        none
// ==/UserScript==

if (typeof GM_info !== "undefined" && (GM_info.scriptHandler || "Greasemonkey") == "Greasemonkey") {
    alert("It's not possible to support Greasemonkey, please try Tampermonkey or ViolentMonkey.");
}

(function(context) {
"use strict";

// when the error is fixed we should remove the following
CSalien.prototype.UpdateCustomizations = function()
{
    this.SetBodyType(BODY_TYPES[gSalienData.body_type]);
    this.LoadAttachments();
}
const APP = context.gApp;
const GAME = context.gGame;
const SERVER = context.gServer;
const PIXI = context.PIXI;

const Option = function Option(name, def) {
    if (window.localStorage[name] === undefined) {
        context.localStorage[name] = def;
    }
    return context.localStorage[name];
}
Option("forceLevellingMode", false);
const SetMouse = function SetMouse(x, y) {
    APP.renderer.plugins.interaction.mouse.global.x = x;
    APP.renderer.plugins.interaction.mouse.global.y = y;
}
const EnemyManager = function EnemyManager() {
    return GAME.m_State.m_EnemyManager;
}
const AttackManager = function AttackManager() {
    return GAME.m_State.m_AttackManager;
}

let isJoining = false;
const TryContinue = function TryContinue() {
    let continued = false;
    if (GAME.m_State.m_VictoryScreen) {
        GAME.m_State.m_VictoryScreen.children.forEach(function(child) {
            if (child.visible && child.x == 155 && child.y == 300) {// TODO: not this
                continued = true;
                child.click();
            }
        })
    }
    if (GAME.m_State.m_LevelUpScreen) {
        continued = false;
        GAME.m_State.m_LevelUpScreen.children.forEach(function(child) {
            if (child.visible && child.x == 155 && child.y == 300) {// TODO: not this
                continued = true;
                child.click();
            }
        })
    }
    if (GAME.m_State instanceof CBootState) { // First screen
        gGame.m_State.button.click();
    }
    if (GAME.m_State instanceof CPlanetSelectionState && !isJoining) { // Planet Selectiong
        GAME.m_State.m_rgPlanetSprites[0].click();
        isJoining = true;
        setTimeout(() => isJoining = false, 1000);
        continued = true;
    }
    if (GAME.m_State instanceof CBattleSelectionState && !isJoining) {
        let bestZoneIdx = GetBestZone();
        if(bestZoneIdx) {
            console.log(GAME.m_State.m_SalienInfoBox.m_LevelText.text, GAME.m_State.m_SalienInfoBox.m_XPValueText.text);
            console.log("join to zone", bestZoneIdx);
            isJoining = true;
            SERVER.JoinZone(
                bestZoneIdx,
                (results) => {
                    GAME.ChangeState(new CBattleState(GAME.m_State.m_PlanetData, bestZoneIdx));
                    isJoining = false;
                    console.log(results);
                },
                () => {
                    console.log("fail");
                    isJoining = false;
                }
            );
        }
        console.log(bestZoneIdx);
        return;
    }
    return continued;
}
const CanAttack = function CanAttack(attackname) {
    let Manager = AttackManager().m_mapCooldowns.get(attackname);
    let lastUsed = Manager.m_rtAttackLastUsed;
    let canAttack = Manager.BAttack();
    Manager.m_rtAttackLastUsed = lastUsed;
    return canAttack;
}
const GetBestZone = function GetBestZone() {
    let bestZoneIdx;
    let highestDifficulty = -1;

    let isLevelling = context.gPlayerInfo.level < 9 || Option("forceLevellingMode");
    let maxProgress = isLevelling ? 10000 : 0;

    for (let idx = 0; idx < GAME.m_State.m_Grid.m_Tiles.length; idx++) {
        let zone = GAME.m_State.m_Grid.m_Tiles[idx].Info;
        if (!zone.captured) {
            if (zone.boss) {
                console.log(`zone ${idx} (${bestZoneIdx % k_NumMapTilesW}, ${(bestZoneIdx / k_NumMapTilesW) | 0}) with boss`);
                return idx;
            }

            if(isLevelling) {
                if(zone.difficulty > highestDifficulty) {
                    highestDifficulty = zone.difficulty;
                    maxProgress = zone.progress;
                    bestZoneIdx = idx;
                } else if(zone.difficulty < highestDifficulty) continue;

                if(zone.progress < maxProgress) {
                    maxProgress = zone.progress;
                    bestZoneIdx = idx;
                }
            } else {
                if(zone.progress > maxProgress) {
                    maxProgress = zone.progress;
                    bestZoneIdx = idx;
                }
            }

        }
    }

    if(bestZoneIdx !== undefined) {
        console.log(`${GAME.m_State.m_PlanetData.state.name} zone ${bestZoneIdx} (${bestZoneIdx % k_NumMapTilesW}, ${(bestZoneIdx / k_NumMapTilesW) | 0}) progress: ${GAME.m_State.m_Grid.m_Tiles[bestZoneIdx].Info.progress} difficulty: ${GAME.m_State.m_Grid.m_Tiles[bestZoneIdx].Info.difficulty}`);
    }

    return bestZoneIdx;
}
const GetBestPlanet = function GetBestPlanet() {
    let bestPlanet;
    let maxProgress = 0;

    if (!GAME.m_State.m_mapPlanets)
        return;

    for (let planetKV of GAME.m_State.m_mapPlanets) {
        let planet = planetKV[1];
        if(planet.state.active && !planet.state.captured && planet.state.capture_progress > maxProgress) {
            maxProgress = planet.state.capture_progress;
            bestPlanet = planet;
        }

    }

    if(bestPlanet) {
        console.log(`selecting planet ${bestPlanet.state.name} with progress: ${bestPlanet.state.capture_progress}`);
        return bestPlanet.id;
    }
}

// Let's challenge ourselves to be human here!
const CLICKS_PER_SECOND = 15;

const InGame = function InGame() {
    return GAME.m_State.m_bRunning;
}

const WORST_SCORE = -1 / 0;
const START_POS = APP.renderer.width;


const EnemySpeed = function EnemySpeed(enemy) {
    return enemy.m_Sprite.vx;
}
const EnemyDistance = function EnemyDistance(enemy) {
    return (enemy.m_Sprite.x - k_nDamagePointx) / (START_POS - k_nDamagePointx);
}

const EnemyCenter = function EnemyCenter(enemy) {
    return [
        enemy.m_Sprite.x + enemy.m_Sprite.width / 2,
        enemy.m_Sprite.y + enemy.m_Sprite.height / 2
    ];
}


class Attack {
    constructor() {
        this.nextAttackDelta = 0;
    }
    shouldAttack(delta, enemies) {
        throw new Error("shouldAttack not implemented");
    }
    process(enemies) {
        throw new Error("process not implemented");
    }
    getAttackName() {
        throw new Error("no current attack name");
    }
    canAttack() {
        return CanAttack(this.getAttackName());
    }
    getAttackData() {
        return AttackManager().m_AttackData[this.getAttackName()];
    }
}

// Basic clicking attack, attack closest
class ClickAttack extends Attack {
    shouldAttack(delta) {
        // Can't do basic attack when station is down
        if (GAME.m_State.m_PlayerHealth <= 0)
            return false;
        this.nextAttackDelta -= delta;
        return this.nextAttackDelta <= 0;;
    }
    score(enemy) {
        if (enemy.m_bDead)
            return WORST_SCORE;
        return 1 - EnemyDistance(enemy);
    }
    process(enemies) {
        let target, target_score = WORST_SCORE;

        enemies.forEach((enemy) => {
            if (!enemy.m_Sprite.visible)
                return;
            let now_score = this.score(enemy);
            if (now_score > target_score) {
                target = enemy, target_score = now_score;
            }
        });

        if (target)
            this.attack(target);
    }
    attack(enemy) {
        enemy.m_Sprite.click();
        this.nextAttackDelta = 1 / CLICKS_PER_SECOND;
    }
}

class ProjectileAttack extends Attack {
    shouldAttack(delta) {
        return CanAttack(this.getAttackName());
    }
    score(enemy) {
        if (enemy.m_bDead)
            return WORST_SCORE;
        return enemy.m_nHealth;
    }
    process(enemies) {
        let target, target_score = WORST_SCORE;

        enemies.forEach((enemy) => {
            if (!enemy.m_Sprite.visible)
                return;
            let now_score = this.score(enemy);
            if (now_score > target_score) {
                target = enemy, target_score = now_score;
            }
        });

        if (target)
            this.attack.apply(this, EnemyCenter(target));
    }
    attack(x, y) {
        SetMouse(x, y)
        AttackManager().m_mapKeyCodeToAttacks.get(this.getAttackData().keycode)()
    }
}

// the '1' button (SlimeAttack PsychicAttack BeastAttack - depends on body type of your salien)
class SpecialAttack extends ProjectileAttack {
    getAttackName() {
        if (gSalien.m_BodyType == "slime")
            return "slimeattack";
        else if (gSalien.m_BodyType == "beast")
            return "beastattack";
        else
            return "psychicattack";
    }
}

class BombAttack extends ProjectileAttack {
    getAttackName() {
        return "explosion";
    }
}
class BlackholeAttack extends ProjectileAttack {
    getAttackName() {
        return "blackhole";
    }
}

class FreezeAttack extends Attack {
    getCurrent() {
        return "flashfreeze";
    }
    shouldAttack(delta, enemies) {
        let shouldAttack = false;
        if (CanAttack(this.getCurrent())) {
            enemies.forEach((enemy) => {
                if (EnemyDistance(enemy) <= 0.05) {
                    shouldAttack = true;
                }
            });
        }
        return shouldAttack;
    }
    getData() {
        return AttackManager().m_AttackData[this.getCurrent()];
    }
    process() {
        AttackManager().m_mapKeyCodeToAttacks.get(this.getData().keycode)()
    }
}

let attacks = [
    new ClickAttack(),
    new SpecialAttack(),
    new FreezeAttack(),
    new BombAttack(),
    new BlackholeAttack()
]

if (context.BOT_FUNCTION) {
    APP.ticker.remove(context.BOT_FUNCTION);
    context.BOT_FUNCTION = undefined;
}

let reloadingPage = false;

context.BOT_FUNCTION = function ticker(delta) {
    delta /= 100;

    let difficulties = PIXI.loader.resources['level_config'];
    if (difficulties)
        for (let difficulty in difficulties.data) {
            let freq = difficulties.data[difficulty].enemies.spawn_frequency;
            freq.min = freq.max;
        }

    let buttonsOnErrorMessage = document.getElementsByClassName("btn_grey_white_innerfade btn_medium");
    if(buttonsOnErrorMessage[0] != null) {
        if (!reloadingPage) {
            setTimeout(() => buttonsOnErrorMessage[0].click(), 1000);
        }

        return;
    }

    if(GAME.m_IsStateLoading || !context.gPlayerInfo) {
        return;
    }

    if (!InGame()) {
        if (TryContinue()) {
            console.log("continued!");
        }
        return;
    }



    let state = EnemyManager();

    let enemies = state.m_rgEnemies;

    for (let attack of attacks)
        if (attack.shouldAttack(delta, enemies))
            attack.process(enemies);

}


APP.ticker.add(context.BOT_FUNCTION);

})(window);

исходник здесь. Может обновляться:
Это он и есть, просто парень кинул старый код без исходников.

Стоит уточнить что код писался на JavaScript, и стабильно работает только через обезьян (tampermonkey, greasemonkey и тд)
 
  • Like
Реакции: Broccoli
А можно для совсем далекого - о чем вся тема и сообщения и что дают эти коды?
 
Если кто использовал скрипт, и видели новость про возможный VAC-ban в некоторых группах - не переживайте, это фэйк.
Вот так, примерно, выглядит фэйк:
59fBYOPwh2U.jpg
Всё было несколько раз перепроверено, с разными людьми. Не у одного такой надписи нет, хотя скрипты использовались.
Вот пруфы:
unknown.png

unknown.png
 
  • Like
Реакции: NoName
Интересно, кто верил про VAC-ban :D

Встроить VAC защиту в браузерную игру это что то новое
 
  • Like
Реакции: Broccoli и HeeChann
Valve же не банят за баги всякие . Разве что в показательных целях , но это нужно чтобы пару человек заюзало дыру, а не сотни тысяч. Музыка в профиле через шмотку доты не банили никого, хотя в теории можно было много чего придумать с тем способом. Желтый ник кажись или рамка - тоже не банили. Значок разработчика игр просто отобрали и все .Игры с ошибкой в цене не отзывают (если не сотни копий для продажи куплено, уже не актуально). Даже не знаю кто мог предположить что они за бота в фармилке кого-то накажут. Да они даже за смену валюты не банят, можно спокойно на рубли перейти и не переплачивать, максимум вернут как было и пригрозят пальчиком, если верить в мифы .
 
Последнее редактирование: