Giter Club home page Giter Club logo

generals's Introduction

generals

A collection of scripts for the game generals.io.

List of scripts

  • MountainsWatcher (for FFA): Watches for new obstacles/mountains appearing in the map. This reveals the location of captured generals. The script consults the chat log to determine the color of the player that captured the general, and highlights the square containing the captured general with that color. Explanation: When a general is captured, it turns into a city. Generals don't show up as obstacles in the fog of war, but cities do, so any new city/obstacle must be a newly-captured general.

  • LeaderboardWatcher: Watches the leaderboard for changes in army size. Allows you to easily read off how many cities a player has, whether the player is in a fight, whether the player just captured a city, etc.

  • BetterControls (requires experimental features): Allows for easier and faster keyboard control. Every time you make a move, the script will automatically select the destination square. Although true queueing cannot be implemented, with a decent internet connection you should make be able to reliably make 2 moves per turn.

  • GeneralsHighlighter: Helps you remember enemy general locations. When you find an enemy general, this script will label it with a red outline, which will remain even after the general is no longer visible by your army.

  • AutoPan: Automatically and smoothly moves the map to keep your currently selected square comfortably visible. Accounting for variable window sizes, this script will ensure that all squares within a radius of 3 of the selected square are located in the visible part of the document window.

  • DvorakControls: Allows dvorak typists to play the game without switching to QWERTY.

Setup with TamperMonkey

TamperMonkey is a Chrome Extension that automatically runs scripts on webpages.

Install the extension and add the scripts (copy-paste the whole script into the editor) using TamperMonkey's dashboard.

Alternative setup with TamperMonkey

To avoid updating the scripts manually through the dashboard every time it changes, you can have Tampermonkey source the scripts directly from your file system.

The script may look something like this:

// ==UserScript==
// @name Generals Test
// @namespace http://tampermonkey.net
// @version 0.1
// @description Source the generals script from file system
// @match http://generals.io/*
// @require file://path/to/repo/src/pluginManager.js
// @require file://path/to/repo/src/mountainsWatcher.js
// @require file://path/to/repo/src/generals-prod-modified.js
// @require file://path/to/repo/src/betterControls.js
// @require ...
// ==/UserScript==

You'll also need to give Tampermonkey access to your file system by checking the box "Allow access to file URLs" (which is next to "Allow in incognito) in Chrome's extensions page (chrome://extensions).

Experimental Features

To enable experimental features, you must

  • block the execution of generals-prod.js.
  • load the modified version (src/generals-prod-modified.js)

You can use TamperMonkey to load generals-prod-modified as usual.

You can use AdBlock to block generals-main-prod-vXX.X.X.js: add the line generals-main-*.js to your custom filters, in AdBlock options.

generals's People

Contributors

stevenhao avatar xtonyjiang avatar

Watchers

James Cloos avatar  avatar  avatar

Forkers

xtonyjiang

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.