Giter VIP home page Giter VIP logo

salien-bot's Introduction

Salien Bot

Salien Bot is a WIP bot for the Salien Minigame that came out for the Steam Summer Sale 2018.

I picked this up because it reminded me of a challenge in programming I had before. I won't be manipulating any state, just injecting mouse clicks and other button presses.

Also, a note: playing this game AT ALL will not net you better rewards! It's only the time you have been on the page. There's no need to waste computer resources. :)

Userscript Mode

Userscript Mode is a version of this bot that is ran as a script on top of your browser, while having a tab with the game open. It is generally easier to use.

Here are the steps to use:

It should be running now!

Tile Selection

The tile select code, in this version, focuses on leveling up to level 13 on hard tiles; after you hit level 13 it will try and target the highest progress tile.

Headless Mode

Headless Mode is a version of this game that is ran without a UI with the bot controlling it, in your command prompt / terminal / shell / etc.

Here are the steps to use:

npm install
notepad gettoken.json
  • Log into Steam
  • Open https://steamcommunity.com/saliengame/gettoken in browser with Steam logged in
  • Copy the entire contents of the page
  • Paste into notepad and save the file as gettoken.json.
  • (IMPORTANT) Immediately copy something else to avoid accidentally giving this out to someone else!
  • Save and exit
  • Back to command line:
node headless
  • (optional) See detailed bot options
node headless --help

It should be running now!

Tile Selection

This version, by default, will scour all available planets and get the highest EXP rewards from difficult tiles; if you don't want this, run the bot with:

node headless --care-for-planet

This will make the bot only use the last planet which you were on and allows you to select the planet for the bot to focus on by first logging onto the Steam website and selecting a planet.

Run the bot inside Docker

This bot can be ran inside a docker container in headless mode.

  1. Get the gettoken.json file.
  2. Run the docker image:
docker run -v /path/to/gettoken.json:/app/gettoken.json meepen/salien-bot:latest

You also can run an autoupdated stack with the examples/docker-compose-autoupdate/docker-compose.yml configuration file for docker-compose.

salien-bot's People

Contributors

ahakola avatar andrewda avatar callmenemo491 avatar dylandelobel avatar eod avatar evanito avatar ionbazan avatar js41637 avatar kamsac avatar matthiasmoore avatar meepen avatar mitchbarnett avatar nero2k avatar pewnypl avatar smaus avatar tbrx103 avatar tehdmitry avatar tokkenno avatar tplk avatar vademon avatar yggdrasil128 avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

salien-bot's Issues

Not clicking

Don't know why, but it's not clicking on enemys,just shooting with "1" button. what could be wrong?

delet this

helo good sir im valve emplooye can you delet this pls thank you sir

TypeError: ajax_object.nosucc is not a function

C:\Users\Administrator\Desktop\salien-bot-master - vijay deena nath chauhan>node headless.js
Running for: 10144 seconds
Current level: 8 (370290 / 450000)
Exp since start: 115200
Estimated exp/hr: 75130
Current planet: Behind the Screen Planet [41.03%] (id 6)
Current zone: (2, 6) (id: 74) difficulty: medium
Round time left: -153 seconds
Next level up: 2018-6-23 16:47:26
failed url https://community.steam-api.com/IMiniGameService/LeaveGame/v0001/, retrying 2
C:\Users\Administrator\Desktop\salien-bot-master - vijay deena nath chauhan\headless\jquery_node.js:70
ajax_object.nosucc();
^

TypeError: ajax_object.nosucc is not a function
at Request.response [as _callback] (C:\Users\Administrator\Desktop\salien-bot-master - vijay deena nath chauhan\headless\jquery_node.js:70:29)
at self.callback (C:\Users\Administrator\Desktop\salien-bot-master - vijay deena nath chauhan\node_modules\request\request.js:185:22)
at Request.emit (events.js:180:13)
at ClientRequest. (C:\Users\Administrator\Desktop\salien-bot-master - vijay deena nath chauhan\node_modules\request\request.js:815:16)
at Object.onceWrapper (events.js:272:13)
at ClientRequest.emit (events.js:180:13)
at TLSSocket.emitTimeout (_http_client.js:703:34)
at Object.onceWrapper (events.js:272:13)
at TLSSocket.emit (events.js:180:13)
at TLSSocket.Socket._onTimeout (net.js:396:8)

C:\Users\Administrator\Desktop\salien-bot-master - vijay deena nath chauhan>

Get Error "TypeError: SERVER is null"

Running version: v24 (normal mode -> i.e., non-headless), ViolentMonkey
Script stopped working.

See in the FireFox developer console (error):

Error running script: Saliens bot
TypeError: SERVER is null
SERVER is null

Valve changed methodnames

Uncaught TypeError: enemy.m_Sprite.click is not a function
at ClickAttack.attack (userscript.html?id=:285)

Add Please! console.

CEnemy.prototype.Walk = function(){ this.Damage(1000);}
CEnemyManager.prototype.BuildEnemy = function(){};

Chosen planet is ignored on refresh

When the game gets an error and has to restart, or if you manually refresh the page, or otherwise return to the title screen, the script chooses a planet on its own (in this case, the Pirate Planet).

However, if I disable Tampermonkey, then refresh and click Play manually, the game automatically loads my chosen planet properly (eg. Dark Humor Planet). Enabling the script at this point starts a battle on the proper planet and all is well.

I'm not even sure how this happens, since there isn't even an opportunity for me to choose the planet manually unless I specifically quit out of the planet I'm already on first. The script shouldn't be adding extraneous steps.

commend

Please make a choice of planets manually. A choice of level hard as "if there is hard->do hard,else if there is medium do medium,else low"
And organize the attack, as in this script, and then the drawing of each model loads my old PC.
https://pastebin.com/1LkRyKVc

Bot "overshoots" Salien Special skill

When you are starting anew, the bot performs very badly as the default skill 1 does overshoot enemies almost all the time.

This is especially noticeable when you are on hard and enemies are walking very fast it barely hits them.

Not gaining XP

Any reason why some users are not getting XP at all after running the script for some time?

Fail, no socre after that

After game it says "failed to load your score" or something like that, so i got no xp and didnt get progress for that "tile" and it restarts after that

Properly convert to *monkey script

needs to be named *.user.js for Tampermonkey etc. to recognize it as a script for it.
Also setting up updating tags for it would be ๐Ÿ’ฏ

// @downloadURL  https://raw.githubusercontent.com/meepen/salien-bot/master/salien-bot.user.js
// @updateURL    https://raw.githubusercontent.com/meepen/salien-bot/master/salien-bot.user.js

Game loop crashes after some game

Hello Sir! Sometimes game loop interrupts after the finish of a round with this error:
Uncaught TypeError: Cannot read property 'click' of undefined at setTimeout (<anonymous>:362:55)
Game indicates an error, game reloads and I have to insert the script into the console again.

Keep getting Game Error...

Running tampermonkey, installed script and went to https://steamcommunity.com/saliengame/play/. Every time the page loads it throws the error There was an error loading required game content. Your game will be restarted. and if I click on OK page reloads and then throws the error once. This seems to be on a continuous loop as it always seems to throw the error everytime the page loads.

Not rejoining same square.

Note sure if it's intended, but it seems to be selecting next available square instead of the one you previously played on. Makes it difficult to organize with a group if everyone just defaults back to a non desirable square.

Bot : Doesn't gains XP

So I've been testing this in my main account and it's working flawless but when I tried to use it in my friends account I'm seeing that he didn't gain a single XP for 15 mins already.

What I can conclude is that the bot is trying to play hard missions from the start which is not right for a low lvl account or let's say a 1 lvl account. Also if this bot works just like the script where it only uses powers and not the gun then it won't work at all. Cause powers are locked and it's a 1 lvl account.

Please have a look at this. I guess we need to do a headstart before putting our accounts into this bot.

a better way

CEnemyManager.prototype.BuildEnemy = function(){};

Stuck on planets with no high threat tiles?

There's a tiny problem with the current build that's only an issue when you're focusing on leveling up.

Since the code focuses on selecting planets with the highest progress, you end up on worlds where all the high threat (and eventually the middle threat) tiles have been used up, while planets that still have those tiles available are still available.

I messed around with the GetBestPlanet function, so that it selected the planet with the lowest progress. Here's what I did:
`
const GetBestPlanet = function GetBestPlanet() {
let bestPlanet;
let worstPlanet;
let maxProgress = 0;
let worstProgress = Number.MAX_VALUE;

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(planet.state.capture_progress < worstProgress) {
        worstProgress = planet.state.capture_progress;
        worstPlanet = planet;
    }
}

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

}
`

This works for me as the bot is now selecting the least progressed planet.

I'm wondering now if this should be added, where the bot priorities low progress planets, while player is still leveling up.

this.SetBodyType is not a function

Bot refreshed page then got this error and did nothing

TypeError: this.SetBodyType is not a function
    at eval (userscript.html?id=f427dd6f-22cb-4b65-99ad-3202f248fdbb:22)
    at Window.eval (userscript.html?id=f427dd6f-22cb-4b65-99ad-3202f248fdbb:27)
    at <anonymous>:2:491
    at eval (userscript.html?id=f427dd6f-22cb-4b65-99ad-3202f248fdbb:2)
    at eval (userscript.html?id=f427dd6f-22cb-4b65-99ad-3202f248fdbb:3)
    at Object.eval (userscript.html?id=f427dd6f-22cb-4b65-99ad-3202f248fdbb:353)
    at eval (userscript.html?id=f427dd6f-22cb-4b65-99ad-3202f248fdbb:355)
    at eval (<anonymous>)
    at <anonymous>:2:491
    at Object.b [as F_c] (<anonymous>:1:409)

AUTOKILL

use this CEnemy.prototype.Walk = function(){this.Die(true);};

Clicking too quickly on a tile.

I'm getting "Game Error: There was an error loading required game content. Your game will be restarted." at the end of every 2min game because its selecting a tile to quickly after clicking play and not showing the error until the end of the game, if I wait 1 or 2 seconds before selecting a tile after clicking play I dont get the error at the the begining of the game or the end.

Script doesn't seem to submit the score

I've been running the script for a while with tampermonkey but it seems like each time the level is completed the script refreshes before submitting the score, so it never counts the game. I've left it for a couple hours and it didn't go through a single game since my level is the same. Any solutions to this?

Valve's take on this

Hello!

Thank you for awesome script - I was actually just thinking about coding something similar but discovered your work and so I will look for the ways to contribute.

But there are some things that I think should be considered first - I remember when we did something similar few years back with Golden Helm minigame - no one cared, Valve even somewhat supported botting (I know some of Valve employees actually participated in scripting). Did anyone collected Valve's take on this now? Are they still OK with it? Or are users using the script potentially put in danger?

Thank you, if you find the time to reply, I am looking forward to it.

How to find get gettoken?

In my F12 -> Network tab, I can't find gettoken anywhere. I've attempted this with Chrome and Microsoft Edge. Anyone have any tips? I'd love to use the headless version.

Headless hangs when no planet is selected

If the player presses "leave planet" and the uses the headless NodeJS bot, the bot seems to hang and never start.

Is it meant to select the planet with the highest count of "High" thread tiles?

logged experience sometimes logged wrong

04:10:03.438 Lv: 7 165535 / 180000
04:10:03.439 join to zone 91
04:10:56.837 gGame.m_State.m_Grid.m_Tiles
04:10:56.841 VM18071:1 Uncaught TypeError: Cannot read property 'm_Tiles' of undefined
at :1:22
(anonymous) @ VM18071:1
04:12:12.885 continued!
04:12:13.179 Pirates Planet zone 34 (10, 2) progress: 0.18986579775810242 difficulty: 2
04:12:13.180 Lv: 7 165535 / 180000
04:12:13.181 join to zone 34
04:14:22.726 continued!
04:14:23.085 Pirates Planet zone 58 (10, 4) progress: 0.19264115393161774 difficulty: 2
04:14:23.087 Lv: 7 167875 / 180000

maybe it's server-side bug
maybe we doing something wrong

Not selecting Hard tile while leveling.

I'm level 6 and the script automatically sends me into an Easy map.
I even entered window.localStorage.forceLevellingMode = true into my console and it still is selecting Easy tiles.

Levels past 9

Confirmed that the game goes past level 9. Should update to not look at level <9

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.