Coder Social home page Coder Social logo

qhorin / cookie-monster Goto Github PK

View Code? Open in Web Editor NEW

This project forked from anahkiasen/cookie-monster

0.0 3.0 0.0 2.55 MB

A rehosted, cleaned up and updated version of the CookieMonster plugin.

JavaScript 78.79% Ruby 0.15% Shell 0.24% CSS 20.81%

cookie-monster's Introduction

Cookie Monster Build Status

Cookie Monster is a plugin you can load into Cookie Clicker, that offers a wide range of tools and statistics to enhance the game. It is not a cheat interface โ€“ although it does offer helpers for golden cookies and such, everything can be toggled off at will to only leave how much information you want.

This is a helper, and it is here to help you at whichever degree you want, if you only need some help shortening long numbers, it does that. If you need to be accompanied by hand to pick the best buildings to buy, it does that, but everything is an option.

Current version

You can see the current version, and a full history of all versions and what they changed by consulting the Releases page.

What it does

At its core, Cookie Monster computes two indexes on both buildings and upgrades :

  • Base Cost per Income (BCI) : indicates how much a building is worth by comparing how much it costs to how much it will earn back
  • Return on investment (ROI) : indicates how "interesting" a building is, for example, if it reduces the time to buy a more advanced building

Cookie Monster also indicates the time left before being able to buy an upgrade or building, and takes it into consideration. It will take everything in consideration, meaning if buying a building also unlocks an achievement which boosts your income, which unlocks an achievement, it will know and highlight that building's value.

Both these indexes are computed for buildings and upgrades. If the relevant option is enabled, it will color-code each of them based on their value :

  • Light Blue : (upgrades) This item has a better BCI than any building
  • Green : This item has the best BCI
  • Yellow : This item is not the best, but it is closer to best than it is to worst
  • Orange : This item is not the worst, but it is closer to worst than it is to best
  • Red : This item has the worst BCI
  • Purple : (upgrades) This item has a worst BCI than any building
  • Grey : (upgrades) This item has not been calculated and/or cannot be calculated due to no definitive worth.

Note : for both these indexes, lower is better, meaning a building with a BCI of 1 is more interesting that one with a BCI of 3.

What it doesn't do

Most likely you'll find items in grey like Golden Cookie upgrades, clicking upgrades โ€“ everything that doesn't earn you a direct bonus to your income will display as grey. This means the following upgrades are not taken into account by Cookie Monster :

  • Plastic mouse
  • Iron mouse
  • Titanium mouse
  • Adamantium mouse
  • Unobtainium mouse
  • Lucky day
  • Serendipity
  • Get lucky
  • Elder Pledge
  • Sacrificial rolling pins
  • etc.

Do note though that, although these upgrades have no direct value, if buying them earns you an achievement of some sort which in return gives you milk and income, Cookie Monster will display that value.

Using

Bookmarklet

Simply use like the previous plugin, create a bookmark and set this as the URL. Then when in the game, click on that bookmark.

javascript: (function () {
  var jA = document.createElement('script');
  jA.setAttribute('type', 'text/javascript');
  jA.setAttribute('src', 'http://cookie-monster.autopergamene.eu/cookie-monster.min.js?' + new Date().getTime());
  document.body.appendChild(jA);
}());

If (for some reason) the above doesn't work, trying pasting everything after the javascript: bit into your browser's console.

Userscript

If you'd rather use the plugin as a script via, for example, Greasemonkey or Tampermonkey, you can use the following script, which will automatically load Cookie Monster every time the original game loads. You may need to specify http://orteil.dashnet.org/cookieclicker/ when asked for a namespace or Includes. For how to add an userscript to your browser, refer to your browser/plugin's documentation as the method changes for each one.

// ==UserScript==
// @name        Cookie Monster
// @namespace   Cookie
// @include     http://orteil.dashnet.org/cookieclicker/
// @version     1
// @grant       none
// ==/UserScript==

var init  = Game.Init;
Game.Init = function() {
  init();
  (function () {
    var jA = document.createElement('script');
    jA.setAttribute('type', 'text/javascript');
    jA.setAttribute('src', 'http://cookie-monster.autopergamene.eu/cookie-monster.min.js?' + new Date().getTime());

    document.body.appendChild(jA);
  }());
}

Bugs and suggestions

Any bug or suggestion should be opened as an issue in the repository for easier tracking. This allows me to close issues once they're fixed.

Before submitting a bug, make sure to give a shot at the latest version of the plugin on the develop branch. For this, simply replace http://cookie-monster by http://dev.cookie-monster in the bookmarklet above. If the bug is still here, you can submit an issue for it.

All suggestions are welcome, even the smallest ones.

Contributing

All edits must be made to the develop branch, that's where the latest version of the code is.

To contribute to the project, you'll find the files you want to edit in src/, split by what the methods are related to. If you're not familiar with Git, the simplest way to contribute is to go into a file, click the Edit button at the top, edit the code, and click on "Propose file change".

Setup the repository

If you are familiar with git, simply click the "Fork" button at the top of the page. You'll be redirected to your fork of the repository. Copy its address in the right side bar. Then clone the repository and install the dependencies :

# Clone repository
git clone https://github.com/YOURNAME/cookie-monster.git
cd cookie-monster

# Install dependencies
npm install
bundle install

You'll need NPM for that, if you don't have it, you can find a one-click installer on NodeJS's website or if you're more familiar with development and have per example Homebrew, you can just do brew install node or on a Linux distrobution such as Ubuntu, apt-get install npm nodejs-legacy or equivalent. Other dependencies (as named on Ubuntu 13.10) include ruby2.0 and ruby2.0-dev.

If you don't have bundle run gem install bundler.

Editing

Make the edits you want in the src/ folder.

Compiling and sending

Then rebuild the assets by running Grunt :

./node_modules/.bin/bower install
./node_modules/.bin/grunt

Test your changes by hosting a local http server with the contents of the dist directory and using a modified bookmarklet such as

javascript: (function () {
  var jA = document.createElement('script');
  jA.setAttribute('type', 'text/javascript');
  jA.setAttribute('src', 'http://localhost:8000/cookie-monster.min.js?' + new Date().getTime());
  document.body.appendChild(jA);
}());

Next you can commit your changes and push :

git commit -m "Edited some stuff" src
git push origin master

Once that is done, go back on Github where your fork is, and create a pull request from there.

Contributors

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.