npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2024 – Pkg Stats / Ryan Hefner

cactpot-solver

v1.1.11

Published

A FFXIV Mini cactpot solver

Downloads

6

Readme

cactpot-solver

A FFXIV Mini cactpot solver

Example

const CactpotSolver = require('cactpot-solver');

// Initiate a new instance of a cactpot-solver
// You can pass an object which will serve as the options
var solver = new CactpotSolver
({
   // Whether or not the statuses on rows and scratches update when a scratch is changed
   autoUpdating: true,

   // The default value a payout is set to. When its reset it will be reset to this value passed
   defaultPayout:
   {
      '6': 10000,
      '7': 36,
      '8': 720,
      '9': 360,
      '10': 80,
      '11': 252,
      '12': 108,
      '13': 72,
      '14': 54,
      '15': 180,
      '16': 72,
      '17': 180,
      '18': 119,
      '19': 36,
      '20': 306,
      '21': 1080,
      '22': 144,
      '23': 1800,
      '24': 3600
   }
})

// solver.scratchValue(scratchID) Returns the scratch value
// solver.scratchValue(scratchID, newValue) Sets  the scratch value and returns it;
solver.scratchValue(0, 1);
solver.scratchValue(1, 1);
solver.scratchValue(2, 3);
solver.scratchValue(3, 4);

// solver.scratch(scratchID) Returns the instanced Scratch class
console.log(solver.scratch(1).problem); // => true;

solver.scratchValue(1, 2);
console.log(solver.scratch(1).problem); // => false;
console.log(solver.scratch(1).best); // => true;
console.log(solver.row('012').best); // => true;

console.log(solver.payout(6).value); // => 10000;
console.log(solver.payoutValue(6)); // => 10000;
console.log(solver.payoutValue(6, 2)); // => 2;
console.log(solver.payoutValue(6)); // => 2;
const CactpotSolver = require('cactpot-solver');
var solver = new CactpotSolver();

CactpotSolver Methods

const CactpotSolver = require('cactpot-solver');
var solver = new CactpotSolver();

//Methods

solver.payouts() // Returns a Map of the Payouts
solver.payout(id) // Returns a Payout;
solver.payoutValue(id, value) // Returns the value of that Payout. If a value you is passed then it sets that Payout's value.

solver.scratches() // Returns a Map of the Scratches
solver.scratch(id) // Returns a Scratch;
solver.scratchValue(id, value) // Returns the value of that Scratch. If a value you is passed then it sets that Scratch's value.

solver.rows() // Returns a Map of the rows
solver.row(id) // Returns a Row

solver.update() // Used if you have the autoUpdating set to false

solver.reset() // Used to reset the scratches and payouts to their default value;
solver.resetScratches() // Used to reset the scratches to 0;
solver.resetPayouts() // Used to reset the payouts to their deafult value;

Scratch Properties

const CactpotSolver = require('cactpot-solver');
var solver = new CactpotSolver();
var scratch = solver.scratch(0);

scratch.value // The value the Scratch is set to. [0-9] are valid values. 0 = unset
scratch.best // If the scrtach is best. Best is true if there are 4 scratches set and the Scratch is apart of the Best row.
scratch.optimal // If the Scratch is optimal. Optimal is true if there isn't enough set scratches to determin the best. So based off of what we know the Scratches with the best potential have optimal set to true.
scratch.problem // If the scratch is a problem. Problems can be if there are duplicate values on different Scratches, or if there are too many values set.

//     Scratch IDs
//
//
//     ╔═══╦═══╦═══╗
//     ║ 0 ║ 1 ║ 2 ║
//     ╠═══╬═══╬═══╣
//     ║ 3 ║ 4 ║ 5 ║
//     ╠═══╬═══╬═══╣
//     ║ 6 ║ 7 ║ 8 ║
//     ╚═══╩═══╩═══╝

Row Properties

const CactpotSolver = require('cactpot-solver');
var solver = new CactpotSolver();
var row = solver.row('a'); //or row = solver.row('678'); 

row.x // ScratchID of the first in the row
row.y // ScratchID of the second in the row
row.z // ScratchID of the third in the row
row.mean // The mean of the possibilities
row.low // The lowest number of the possibilities
row.high // the highest number of the possibilities
row.possibilities // An array of the the possible outcomes for that row
row.best // If the row is the best. The best is true when 4 Scratches are set and the row has the highest mean of all the rows;

//     Row IDs
//
//  d    e   f   g    h 
//     ╔═══╦═══╦═══╗
//  c  ║   ║   ║   ║
//     ╠═══╬═══╬═══╣
//  b  ║   ║   ║   ║
//     ╠═══╬═══╬═══╣
//  a  ║   ║   ║   ║
//     ╚═══╩═══╩═══╝
//
// 048  036 147 258  246
//     ╔═══╦═══╦═══╗
// 012 ║   ║   ║   ║
//     ╠═══╬═══╬═══╣
// 345 ║   ║   ║   ║
//     ╠═══╬═══╬═══╣
// 678 ║   ║   ║   ║
//     ╚═══╩═══╩═══╝

Payout Properties

const CactpotSolver = require('cactpot-solver');
var solver = new CactpotSolver();
var payout = solver.payout(6);

payout.value // The value of the payout
payout.default // The default of this payouts value. When the payout is reset its value becomes the default