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

smt-bot

v1.2.0

Published

The summit computer science library for interfacing with vindinium

Downloads

2

Readme

Summit CS Bot

This is a quick and dirty node module for you to access the vindinum server.

You just have to:

var Bot = require('smt-bot');
var PF = Bot.pathfinding;
var Promise = Bot.promise;
var bot = new Bot('key', 'location', 'url');

// var bot = new Bot('YOUR_KEY_HERE', 'arena', 'http://24.6.28.217:9000'); //Put your bot's code here and change training to Arena when you want to fight others.
var goDir;
Bot.prototype.botBrain = function() {
  return new Promise(function(resolve, reject) {
    _this = bot;
    /* Write your bot below Here */
    /* Set `bot.goDir` in the direction you want to go */  //<--- In this case, set myDir to what you want and it will set bot.goDir to that at the end.

    /*                                      *
     * This Code is global data!            *
     *                                      */

    // Set myDir to what you want and it will set bot.goDir to that direction at the end.  Unless it is "none"
    var myDir;
    var myPos = [bot.yourBot.pos.x, bot.yourBot.pos.y];

    var enemyBots = [];
    if(bot.yourBot.id != 1) enemyBots.push(bot.bot1);
    if(bot.yourBot.id != 2) enemyBots.push(bot.bot2);
    if(bot.yourBot.id != 3) enemyBots.push(bot.bot3);
    if(bot.yourBot.id != 4) enemyBots.push(bot.bot4);

    /*                                      *
     * This Code Decides WHAT to do         *
     *                                      */
    var task;
    task = "freemines";

    /*                                      *
     * This Code Determines HOW to do it    *
     *                                      */

    // This Code find the nearest freemine and sets myDir toward that direction //
    if(task === "freemines") {
      var closestMine = bot.freeMines[0];
      for(i = 0; i < bot.freeMines.length; i++) {
        if(bot.findDistance(myPos, closestMine) > bot.findDistance(myPos, bot.freeMines[i])) {
          closestMine = bot.freeMines[i];
        }
      }
      console.log("Claiming a Free Mine!");
      myDir = bot.findPath(myPos, closestMine);
    }

    /*                                                                                                                              *
     * This Code Sets your direction based on myDir.  If you are trying to go to a place that you can't reach, you move randomly.   *
     * Otherwise you move in the direction set by your code.                                                                        */
    if(myDir === "none") {
      console.log("Going Random!");
      var rand = Math.floor(Math.random() * 4);
      var dirs = ["north", "south", "east", "west"];
      bot.goDir = dirs[rand];
    } else {
      bot.goDir = myDir;
    }



    /* DON'T REMOVE ANTYTHING BELOW THIS LINE */
    resolve();
  });
}
bot.runGame();

instead of having to clone the entire repo for the vind server.