UNPKG

5.23 kBMarkdownView Raw
1# Ingress Hubot
2
3A collection of Ingress-related commands for Hubot. This script is designed
4specifically for use with the Slack adapter.
5
6[![Build Status](https://travis-ci.org/hubot-scripts/hubot-ingress.svg)](https://travis-ci.org/hubot-scripts/hubot-ingress)
7
8## Features
9
10* Report level requirements
11* List requirements for all levels
12* Store badge information for players
13* Calculate recharge rate and max distance for AP level
14* Calculate septicycle/checkpoint times
15* *much more to come...*
16
17## Installation
18
19`npm install hubot-ingress`
20
21Then add `"hubot-ingress"` to `external-scripts.json`
22
23Go to the custom emojis page of your Slack team. Upload each of the images from
24the `badges/` subfolder, naming them the same as their filename (without the
25extension).
26These emoji will be used by Hubot.
27
28## Configuration
29
30`HUBOT_GOOGLE_GEOCODE_KEY` - An optional Google Geocoding API key.
31If configured, this will be used by the "intelmap" feature in order to
32convert an address to a lat/long for the intelmap link. The intelmap link
33generator should function without this, but it may be needed if the
34intelmap generator begins returing no results at some point.
35
36A Geocoding API key can be obtained easily from the [Google Developer Console](https://console.developers.google.com).
37At the time of this writing, 2,500 requests/day are provided for free.
38Create a new project for your hubot in the developer console, unless you
39have one already. Enable "Geocoding API" under "_APIs_" and then
40create a new key under "_Credentials_".
41
42`HUBOT_CYCLE_TIME_FMT` - Optionally ovveride the display format for times (see
43Moment-timezone.js). Default is "ddd hA" (e.g. "Sun 10pm")
44
45`HUBOT_CYCLE_TZ_NAME` - Optionally set the timezone name (e.g. 'America/Chicago';
46see [TZ name list](https://en.wikipedia.org/wiki/List_of_tz_database_time_zones) for names to use.).
47This overrides `HUBOT_CYCLE_TZ_OFFSET` if both are set.
48
49`HUBOT_CYCLE_TZ_OFFSET` - Optionally set the timezone offset (e.g. '-05:00',
50see [Moment.js](http://momentjs.com/docs/#/manipulating/timezone-offset/)).
51Defaults to the server instance's offset. This is used when
52`HUBOT_CYCLE_TZ_NAME` is not provided.
53
54### Slack
55
56In order for the badge images to be seen on Slack, you must manually upload
57each one as an emoji with the appropriate name. Each image is conveniently
58named exactly how the emoji name should appear (leave off the .png of course).
59
60Go to <yourslackdomain>.slack.com/admin/emoji to configure emoji.
61
62## Commands
63
64### AP requirement
65
66Reports the AP/badge requirements for the specified level.
67
68`hubot AP until L<level>`
69
70### List levels
71
72Show the AP/badge requirements for every level.
73
74`hubot AP all`
75
76### Add badges
77
78Badges can be added one by one or multiples at a time, and can be added for
79other players. Badges that have levels end with a number representing that
80level (1=bronze, 2=silver, etc). When a badge is added that is the same as an
81existing badge (hacker5 vs hacker1, for example), then the new badge will
82replace the existing badge.
83
84`hubot I have the hacker3, founder badges`
85
86`hubot user1 has the recursion badge`
87
88### Remove badges
89
90Badges can be removed one by one.
91
92`hubot I don't have the hacker1 badge`
93
94### Get Intel map
95
96Gives you a link to the Ingress Intel map based on Google Maps search.
97
98`hubot intelmap soho ny`
99
100### Calculate max recharge distance
101
102Calculate maximum distance from which an agent can recharge, based on agent
103level.
104
105`hubot recharge distance [level]`
106
107### Calculate recharge rate/percentage
108
109Calculate recharge efficiency for an agent, based on agent level and distance.
110
111`hubot recharge rate [level] [distance]`
112
113Note: The distance parameter defaults to km, but it can also convert imperial
114units, e.g. `hubot recharge rate 11 450 miles`
115
116### Get Septicycle times
117
118Calculate the next septicycle start. Optionally provide a number X to get the
119next X start times.
120
121`hubot septicycle|cycle [count]`
122
123### Get Checkpoint times
124
125Calculate the next checkpoint start. Optionally provide a number X to get the
126next X start times.
127
128`hubot checkpoint|cp [count]`
129
130### Get Timezone Offset
131
132Returns the current configured timezone offset.
133
134`hubot cycle offset`
135
136### Set Timezone Offset
137
138Temporarily sets the timezone offset. See [Moment.js](http://momentjs.com/docs/#/manipulating/timezone-offset/) for how to configure this.
139
140`hubot cycle set offset [offset]`
141
142### Set Timezone Offset By Name
143
144Temporarily sets the timezone offset by name. See [TZ name list](https://en.wikipedia.org/wiki/List_of_tz_database_time_zones) for names to use.
145
146`hubot cycle set offsetname [offset-name]`
147
148### Calculate MU score
149
150Using the provided scores (from your scanner), calculates the difference currently needed to win the cycle.
151
152`hubot mind units needed [ours] [theirs]`
153`hubot mu needed [ours] [theirs]`
154`hubot mu [ours] [theirs]`
155
156MU scores can be absolute numbers or shortened by 1000 (both 42000 and 42k work).
157
158### Calculate MU average score
159
160Using the provided scores (from your scanner), calculates the difference per cycle currently needed to win the cycle.
161
162`hubot mind units average [ours] [theirs]`
163`hubot mu average [ours] [theirs]`
164
165MU scores can be absolute numbers or shortened by 1000 (both 42000 and 42k work).