Git Product home page Git Product logo

hubot-ingress's Introduction

Ingress Hubot Build Statusnpm version

Looking for maintainer(s)! This project is still actively maintained, but I could use a hand. Create an issue asking to become a maintainer if you're interested.

A collection of Ingress-related commands for Hubot. This script is designed specifically for use with the Slack adapter.

Features

  • Report level requirements
  • List requirements for all levels
  • Store badge information for players
  • Calculate recharge rate and max distance for AP level
  • Calculate septicycle/checkpoint times
  • much more to come...

Installation

npm install hubot-ingress

Then add "hubot-ingress" to external-scripts.json

Go to the custom emojis page of your Slack team. Upload each of the images from the badges/ subfolder, naming them the same as their filename (without the extension). These emoji will be used by Hubot.

Configuration

HUBOT_GOOGLE_GEOCODE_KEY - An optional Google Geocoding API key. If configured, this will be used by the "intelmap" feature in order to convert an address to a lat/long for the intelmap link. The intelmap link generator should function without this, but it may be needed if the intelmap generator begins returing no results at some point.

A Geocoding API key can be obtained easily from the Google Developer Console. At the time of this writing, 2,500 requests/day are provided for free. Create a new project for your hubot in the developer console, unless you have one already. Enable "Geocoding API" under "APIs" and then create a new key under "Credentials".

HUBOT_CYCLE_TIME_FMT - Optionally ovveride the display format for times (see Moment-timezone.js). Default is "ddd hA" (e.g. "Sun 10pm")

HUBOT_CYCLE_TZ_NAME - Optionally set the timezone name (e.g. 'America/Chicago'; see TZ name list for names to use.). This overrides HUBOT_CYCLE_TZ_OFFSET if both are set.

HUBOT_CYCLE_TZ_OFFSET - Optionally set the timezone offset (e.g. '-05:00', see Moment.js). Defaults to the server instance's offset. This is used when HUBOT_CYCLE_TZ_NAME is not provided.

Slack

In order for the badge images to be seen on Slack, you must manually upload each one as an emoji with the appropriate name. Each image is conveniently named exactly how the emoji name should appear (leave off the .png of course).

Go to .slack.com/admin/emoji to configure emoji.

NOTE: The following emojis have been renamed for consistency, and will automatically be renamed for each user when hubot is started. However, you will need to manually upload the new emojis (and remove the old ones) so that they look correct in Slack:

  • ada-1 -> ada
  • ada-2 -> ada-2016
  • aegis -> aegis-nova
  • akira -> akira-tsukasa
  • devra-1 -> devra-bogdanovich
  • goruckstealh -> goruck-stealth
  • goruckurban -> goruck-urban
  • nl-1331-1 -> nl-1331
  • nl-1331-2 -> nl-1331-2016
  • oliver-lynton-wolfe-2 -> oliver-lynton-wolfe-2016
  • p-a-chapeau-2 -> p-a-chapeau-2016
  • susanna-moyer1 -> susanna-moyer
  • susanna-moyer2 -> susanna-moyer-2016

Commands

AP requirement

Reports the AP/badge requirements for the specified level.

hubot AP until L<level>

List levels

Show the AP/badge requirements for every level.

hubot AP all

Add badges

Badges can be added one by one or multiples at a time, and can be added for other players. Badges that have levels end with a number representing that level (1=bronze, 2=silver, etc). When a badge is added that is the same as an existing badge (hacker5 vs hacker1, for example), then the new badge will replace the existing badge.

hubot I have the hacker3, founder badges

hubot user1 has the recursion badge

Remove badges

Badges can be removed one by one.

hubot I don't have the hacker1 badge

Get Intel map

Gives you a link to the Ingress Intel map based on Google Maps search.

hubot intelmap soho ny

Calculate max recharge distance

Calculate maximum distance from which an agent can recharge, based on agent level.

hubot recharge distance [level]

Calculate recharge rate/percentage

Calculate recharge efficiency for an agent, based on agent level and distance.

hubot recharge rate [level] [distance]

Note: The distance parameter defaults to km, but it can also convert imperial units, e.g. hubot recharge rate 11 450 miles

Get Septicycle times

Calculate the next septicycle start. Optionally provide a number X to get the next X start times.

hubot septicycle|cycle [count]

Get Checkpoint times

Calculate the next checkpoint start. Optionally provide a number X to get the next X start times.

hubot checkpoint|cp [count]

Get Checkpoint times on a day

Calculate the checkpoint times for a given day. Day given can be in common date formats (e.g. 5/17/14, May 4, 1999, 5 May 2016) and in English day names (e.g. Saturday, monday, this Thursday). Note that "Thursday", "this Thursday", and "next Thursday" all return the same data.

hubot checkpoints|cps on <day>

Get Timezone Offset

Returns the current configured timezone offset.

hubot cycle offset

Set Timezone Offset

Temporarily sets the timezone offset. See Moment.js for how to configure this.

hubot cycle set offset [offset]

Set Timezone Offset By Name

Temporarily sets the timezone offset by name. See TZ name list for names to use.

hubot cycle set offsetname [offset-name]

Calculate MU score

Using the provided scores (from your scanner), calculates the difference currently needed to win the cycle.

hubot mind units needed [ours] [theirs] hubot mu needed [ours] [theirs] hubot mu [ours] [theirs]

MU scores can be absolute numbers or shortened by 1000 (both 42000 and 42k work).

Calculate MU average score

Using the provided scores (from your scanner), calculates the difference per cycle currently needed to win the cycle.

hubot mind units average [ours] [theirs] hubot mu average [ours] [theirs]

MU scores can be absolute numbers or shortened by 1000 (both 42000 and 42k work).

hubot-ingress's People

Contributors

agentnormandy avatar ankorite avatar chaotic avatar drh4kor avatar drstevens avatar evoldica avatar ianslai avatar impleri avatar kaneoriley avatar mackhankins avatar sleavitt avatar therealklanni avatar whychoosebob avatar witaminer avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

hubot-ingress's Issues

http errors on join-request through heroku

I am getting this when I go to http://myurl/apply after setting up the join-request branch

TypeError: Cannot read property 'user' of undefined
  at validate (/app/node_modules/hubot-ingress/src/join-request.coffee:5:3, <js>:9:20)
  at callbacks (/app/node_modules/hubot/node_modules/express/lib/router/index.js:161:37)
  at param (/app/node_modules/hubot/node_modules/express/lib/router/index.js:135:11)
  at pass (/app/node_modules/hubot/node_modules/express/lib/router/index.js:142:5)
  at Router._dispatch (/app/node_modules/hubot/node_modules/express/lib/router/index.js:170:5)
  at Object.router (/app/node_modules/hubot/node_modules/express/lib/router/index.js:33:10)
  at next (/app/node_modules/hubot/node_modules/express/node_modules/connect/lib/proto.js:190:15)
  at multipart (/app/node_modules/hubot/node_modules/express/node_modules/connect/lib/middleware/multipart.js:64:37)
  at /app/node_modules/hubot/node_modules/express/node_modules/connect/lib/middleware/bodyParser.js:57:9
  at urlencoded (/app/node_modules/hubot/node_modules/express/node_modules/connect/lib/middleware/urlencoded.js:51:37)
  at /app/node_modules/hubot/node_modules/express/node_modules/connect/lib/middleware/bodyParser.js:55:7
  at json (/app/node_modules/hubot/node_modules/express/node_modules/connect/lib/middleware/json.js:53:37)
  at Object.bodyParser [as handle] (/app/node_modules/hubot/node_modules/express/node_modules/connect/lib/middleware/bodyParser.js:53:5)
  at next (/app/node_modules/hubot/node_modules/express/node_modules/connect/lib/proto.js:190:15)
  at Object.query [as handle] (/app/node_modules/hubot/node_modules/express/node_modules/connect/lib/middleware/query.js:44:5)
  at next (/app/node_modules/hubot/node_modules/express/node_modules/connect/lib/proto.js:190:15)
  at Object.handle (/app/node_modules/hubot/src/robot.coffee:278:7, <js>:233:16)
  at next (/app/node_modules/hubot/node_modules/express/node_modules/connect/lib/proto.js:190:15)
  at Object.expressInit [as handle] (/app/node_modules/hubot/node_modules/express/lib/middleware.js:30:5)
  at next (/app/node_modules/hubot/node_modules/express/node_modules/connect/lib/proto.js:190:15)
  at Object.query [as handle] (/app/node_modules/hubot/node_modules/express/node_modules/connect/lib/middleware/query.js:44:5)
  at next (/app/node_modules/hubot/node_modules/express/node_modules/connect/lib/proto.js:190:15)
  at Function.app.handle (/app/node_modules/hubot/node_modules/express/node_modules/connect/lib/proto.js:198:3)
  at Server.app (/app/node_modules/hubot/node_modules/express/node_modules/connect/lib/connect.js:65:37)
  at Server.emit (events.js:98:17)
  at HTTPParser.parser.onIncoming (http.js:2108:12)
  at HTTPParser.parserOnHeadersComplete [as onHeadersComplete] (http.js:121:23)
  at Socket.socket.ondata (http.js:1966:22)
  at TCP.onread (net.js:527:27)

Blank badges too dark

It's hard to differentiate the badge colors, especially when they are sized down. Need to lighten up the colors a bit.


Support @mentions

Informational commands should support @mentions. When a user adds "@mention" (where "mention" is another user) at the end of a command that only provides information (data or a link, etc), the bot should direct the response at the named user instead of the user invoking the command.

See hubot-factoids for example implementation.

AP for levels 1-8 potentially inaccurate

Need to find accurate information for the current AP requirements for levels 1-8. The information I found may have been outdated/inaccurate. I did some searching on Google, but was only able to find information confirming the numbers I already have, however one L2 agent said the AP requirement for L3 is 20k not 30k—need to confirm.

Collaboration Time

Hello project maintainers,
I hereby request to be added to the list of collaborators for this project.

I've undertaken the task to collect new badge images (53 total at 128x128) as well as update the list of badges available in badges.coffee. Over the next few days, I'll be updating our forked version. Maybe other teams could also use the updates.

Regards,

--drh4kor

Fix output for MUs needed when ENL is losing

Quoting original issue (hubot-archive#68)

The output from cycle-times.coffee for MUs needed to win a cycle is incorrect when the Enlightened are losing. Since the difference is calculated using ENL - RES and then if the difference is < 1 it is cast to zero, and then regardless 1 is added to the difference, any time the ENL are losing the output will be 1 MU for them to win. This should be refactored slightly to use Math.abs() instead to always have a positive value returned.

To reproduce, issue the command "mu needed 506114 149875" (which is what I used to discover it, but as long as the RES score is higher than the ENL score, any values will work for this). Depending upon the number of checkpoints into the cycle you are, the value will vary, but you should see a value higher than 1 for the number of MUs needed.

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.