1 | # Ingress Hubot
|
2 |
|
3 | A collection of Ingress-related commands for Hubot. This script is designed
|
4 | specifically 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 |
|
21 | Then add `"hubot-ingress"` to `external-scripts.json`
|
22 |
|
23 | Go to the custom emojis page of your Slack team. Upload each of the images from
|
24 | the `badges/` subfolder, naming them the same as their filename (without the
|
25 | extension).
|
26 | These emoji will be used by Hubot.
|
27 |
|
28 | ## Configuration
|
29 |
|
30 | `HUBOT_GOOGLE_GEOCODE_KEY` - An optional Google Geocoding API key.
|
31 | If configured, this will be used by the "intelmap" feature in order to
|
32 | convert an address to a lat/long for the intelmap link. The intelmap link
|
33 | generator should function without this, but it may be needed if the
|
34 | intelmap generator begins returing no results at some point.
|
35 |
|
36 | A Geocoding API key can be obtained easily from the [Google Developer Console](https://console.developers.google.com).
|
37 | At the time of this writing, 2,500 requests/day are provided for free.
|
38 | Create a new project for your hubot in the developer console, unless you
|
39 | have one already. Enable "Geocoding API" under "_APIs_" and then
|
40 | create a new key under "_Credentials_".
|
41 |
|
42 | `HUBOT_CYCLE_TIME_FMT` - Optionally ovveride the display format for times (see
|
43 | Moment-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';
|
46 | see [TZ name list](https://en.wikipedia.org/wiki/List_of_tz_database_time_zones) for names to use.).
|
47 | This overrides `HUBOT_CYCLE_TZ_OFFSET` if both are set.
|
48 |
|
49 | `HUBOT_CYCLE_TZ_OFFSET` - Optionally set the timezone offset (e.g. '-05:00',
|
50 | see [Moment.js](http://momentjs.com/docs/#/manipulating/timezone-offset/)).
|
51 | Defaults to the server instance's offset. This is used when
|
52 | `HUBOT_CYCLE_TZ_NAME` is not provided.
|
53 |
|
54 | ### Slack
|
55 |
|
56 | In order for the badge images to be seen on Slack, you must manually upload
|
57 | each one as an emoji with the appropriate name. Each image is conveniently
|
58 | named exactly how the emoji name should appear (leave off the .png of course).
|
59 |
|
60 | Go to <yourslackdomain>.slack.com/admin/emoji to configure emoji.
|
61 |
|
62 | ## Commands
|
63 |
|
64 | ### AP requirement
|
65 |
|
66 | Reports the AP/badge requirements for the specified level.
|
67 |
|
68 | `hubot AP until L<level>`
|
69 |
|
70 | ### List levels
|
71 |
|
72 | Show the AP/badge requirements for every level.
|
73 |
|
74 | `hubot AP all`
|
75 |
|
76 | ### Add badges
|
77 |
|
78 | Badges can be added one by one or multiples at a time, and can be added for
|
79 | other players. Badges that have levels end with a number representing that
|
80 | level (1=bronze, 2=silver, etc). When a badge is added that is the same as an
|
81 | existing badge (hacker5 vs hacker1, for example), then the new badge will
|
82 | replace 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 |
|
90 | Badges can be removed one by one.
|
91 |
|
92 | `hubot I don't have the hacker1 badge`
|
93 |
|
94 | ### Get Intel map
|
95 |
|
96 | Gives 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 |
|
102 | Calculate maximum distance from which an agent can recharge, based on agent
|
103 | level.
|
104 |
|
105 | `hubot recharge distance [level]`
|
106 |
|
107 | ### Calculate recharge rate/percentage
|
108 |
|
109 | Calculate recharge efficiency for an agent, based on agent level and distance.
|
110 |
|
111 | `hubot recharge rate [level] [distance]`
|
112 |
|
113 | Note: The distance parameter defaults to km, but it can also convert imperial
|
114 | units, e.g. `hubot recharge rate 11 450 miles`
|
115 |
|
116 | ### Get Septicycle times
|
117 |
|
118 | Calculate the next septicycle start. Optionally provide a number X to get the
|
119 | next X start times.
|
120 |
|
121 | `hubot septicycle|cycle [count]`
|
122 |
|
123 | ### Get Checkpoint times
|
124 |
|
125 | Calculate the next checkpoint start. Optionally provide a number X to get the
|
126 | next X start times.
|
127 |
|
128 | `hubot checkpoint|cp [count]`
|
129 |
|
130 | ### Get Timezone Offset
|
131 |
|
132 | Returns the current configured timezone offset.
|
133 |
|
134 | `hubot cycle offset`
|
135 |
|
136 | ### Set Timezone Offset
|
137 |
|
138 | Temporarily 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 |
|
144 | Temporarily 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 |
|
150 | Using 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 |
|
156 | MU scores can be absolute numbers or shortened by 1000 (both 42000 and 42k work).
|
157 |
|
158 | ### Calculate MU average score
|
159 |
|
160 | Using 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 |
|
165 | MU scores can be absolute numbers or shortened by 1000 (both 42000 and 42k work).
|