Skip to content

Instantly share code, notes, and snippets.

@hkamran80
Last active February 25, 2020 19:51
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save hkamran80/4271011deb6b9168f579077cadbbb6fb to your computer and use it in GitHub Desktop.
Save hkamran80/4271011deb6b9168f579077cadbbb6fb to your computer and use it in GitHub Desktop.
Full Player for Gameinc.io
// ==UserScript==
// @name Gameinc.io Full Player
// @namespace hkamran80
// @version 1.0
// @description Full play bot for Gameinc.io
// @author H. Kamran
// @match http://gameinc.io/?use_fp_mode=true
// @grant none
// ==/UserScript==
(function() {
'use strict';
const in_progress_game_limit = 2;
let in_progress_games = [],
completed_games = 0;
setInterval(() => {
socket.emit("make money")
}, 0);
setInterval(() => {
if (company.games.length > 0) {
for (game of company.games) {
if (game.revenue == -1) {
if (!in_progress_games.includes(game.id)) {
in_progress_games.push(game.id);
}
} else {
if (in_progress_games.includes(game.id)) {
in_progress_games.pop(game.id);
}
if (!completed_games.includes(game.id)) {
completed_games.push(game.id);
}
}
}
}
if (company.money > 15000 && in_progress_games.length <= in_progress_game_limit) {
socket.emit("create game", 0);
}
for (game of company.games) {
if (game.revenue == -1) {
socket.emit("start hiring", "game", game.id, (employees) => {
let employees_list = employees,
employee_index = 0;
if (employees_list[0].hype >= employees_list[1].hype) {
employee_index = 0;
} else {
employee_index = 1;
}
socket.emit("finish hiring", employee_index, () => {});
});
}
}
}, 1000);
})();
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment