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 🙏

© 2026 – Pkg Stats / Ryan Hefner

funnydots.js

v1.0.2

Published

A funnydots bot client.

Readme

funnydots.js

To be honest, posting the client on here is just a formality, noone else is going to use this.

My stupid docs:

let client = require('funnydots.js')('myBotName'); // The only argument it takes is the username.

client.log(1, client)
{
  init: false,
  mouseX: 0,
  mouseY: 0,
  angle: 0,
  upgrades: [
    0, 0, 0, 0,
    0, 0, 0
  ],
  xp: 0,
  selected: 1,
  selectType: [
    null, null, null,
    null, null, null,
    null, null, null
  ],
  inFaction: false,
  inventoryOpen: false,
  canCraft: null,
  faction: null,
  factionPerms: false,
  inventory: { items: {}, craft: {} },
  updateData: {},
  updatePlayerData: {},
  account: {},
  notif: null,
  socket: Socket {
  /* ... */
  }
}

['updateGame','init','loadChunk','leave','loggedIn','notif','notif2','weapon','upgrade','updateTile','updateClient', 'start']

// Properties that aren't shown because I hate you (events and also name)
client.name = 'newName'; // Sets client name (only applies before start or rejoin)
client.logging(level); // Logging level (default 0 - no logging)
client.log(1, "You only see this", "when logging is more than or equal to one.") // Log something using the clients logging method. Useful for extentions that may log debug messages.

client.map // Map data.
client.map.height // Map height.
client.map.width // Map width.

client.start(); // Starts the bot, this should be called AFTER you register your methods.

client.onStart(()=>{
    client.log(1, "Bot is first starting.")
})

client.onInit(()=>{
    client.log(1, "Bot is first starting or rejoining.")
})

client.onLeave(()=>{
    client.log(1, "Bot died.")
    client.rejoin()
})

client.onUpdateGame(()=>{
    client.log(1, "Game updated. PATA (Your player data):", client.updatePlayerData, "DATA (General game data):", client.updateData);
Game updated. PATA (Your player data): {
      xp: 0,
      lvl: 0,
      player: {
        x: 2073,
        y: 6197
      },
      items: [
        [
          {
            x: 1221.5,
            y: 5706,
            id: "i_wood"
          }
        ],
        []
      ]
} DATA (General game data): {
    "ply": [
      {
        "x": 3813,
        "y": 5912,
        "col": "#009999",
        "hp": 100,
        "name": "pelvisonions",
        "xp": 0,
        "kills": 0,
        "msg": "",
        "lvl": 0,
        "sz": 45,
        "angle": 180.75716886505853,
        "select": 1,
        "pick": {
          "x": 0,
          "y": 0,
          "angle": 0
        },
        "weapon": {
          "x": 0, // I think this is sprite offset, I dunno, doesn't matter tho.
          "y": 0,
          "angle": 0, // Weapon angle.
          "type": "Archer", // Your class.
          "color": "#9999FF"
        },
        "mod": [
          null,
          null
        ]
      },
      /* ... */
    ],
    "proj": [
      {
        "x": 3875.4737172390555,
        "y": 2440.374166449638,
        "angle": 3.116745243413136,
        "type": "proj_arrow"
      }
    ],
    "thing": [
      {
        "x": 2350,
        "y": 913,
        "sz": 25,
        "hp": 100,
        "sides": 5,
        "color": {
          "r": 239,
          "g": 217,
          "b": 136
        },
        "type": 0, // CONTROL F the client rendering code for the types https://funnydots.neilpurohit06.repl.co/rendering.js `.type`
        "angle": 293,
        "mod": null
      },
      /* ... */
    ]
}
})
client.onLoadChunk((mode, data)=>{
    client.log(1, 'New chunk loaded.');
    client.log(1, mode) // ["replace", "add", or "delete"]
})
// This is the client chunk handling code for ref.
  switch(mode){
    case "replace":
      for(let i in data){
        map[i] = {tiles: [], floor: [], biome: []};
          for(let j in data[i].tiles){
            map[i].tiles.push(getTile(data[i].tiles[j].type, data[i].tiles[j].x, data[i].tiles[j].y, null, data[i].tiles[j].facing));
          }
          for(let j in data[i].biome){
            map[i].biome.push(getBiome(data[i].biome[j].type, data[i].biome[j].x, data[i].biome[j].y));
          }
          for(let j in data[i].floor){
            map[i].floor.push(getTile(data[i].floor[j].type, data[i].floor[j].x, data[i].floor[j].y, null, data[i].floor[j].facing));
          }
      }
      break;
    case "add":
      
      for(let i in data){
        if(!(i in map)) return;
          for(let j in data[i].tiles){
            map[i].tiles.push(getTile(data[i].tiles[j].type, data[i].tiles[j].x, data[i].tiles[j].y, null, data[i].tiles[j].facing));
          }
          for(let j in data[i].biome){
            map[i].biome.push(getBiome(data[i].biome[j].type, data[i].biome[j].x, data[i].biome[j].y));
          }
          for(let j in data[i].floor){
            map[i].floor.push(getTile(data[i].floor[j].type, data[i].floor[j].x, data[i].floor[j].y, null, data[i].floor[j].facing));
          }
      }
      break;
    case "delete":
      for(let i in data)
        delete map[data[i]];
      break;
  }
client.onLoggedIn(()=>{}); // Accounts are not out to the public yet so this is obsolete.
client.onNotif((msg, color)=>{
    client.log(1, msg, color) // Death messages.
});

client.onNotif2((msg, color)=>{
    client.log(1, msg, color) // LOGIN TO GAIN SKINS (don't try it its a trap.)
});

client.onWeapon((choices)=>{
  client.log(1, choices)
  client.chooseWeapon(choices[0])
});

client.onUpgrade((a)=>{
    client.log(1, a); // If you haven't hit the cap for anything, it should look like this.
    {
      speed: 1,
      health: 2,
      regen: 3,
      small: 4,
      dash: 5,
      building: 6,
      mining: 7
    }

    if (a.speed) {
      client.upgrade(a.speed)
    } else {
      client.upgrade(Object.values(a)[0]) // First value;
    }
});

client.onUpdateClient((key, value)=>{
  client.log(1, 'client.'+key, '=', value)
})

And thats it!!!!