botemon 0.5.4.2 → 0.5.5
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/bin/botemon +32 -23
- data/lib/botemon/storage.rb +1 -0
- data/lib/botemon/version.rb +1 -1
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: f2d667948ffa1014e3e6571c89908931a248e566
|
4
|
+
data.tar.gz: 957e69a5bbd5138e4bd68f8a3bfa8ec07016c00f
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 58e65bab3c4d97d3e548a2ced8f26afb600d8cff53758273cc76060ec7d583aafb98e02a9b4537e0e8a3b81c95f488459eb9b07510d50089948a8dbb033594fe
|
7
|
+
data.tar.gz: bfff0fb5e3c046e203abdbc31a198c9bed3ba5617f6ed70a00f1bb2939a2de7d0c922fb8a2aed3659e05686289f601341bd6ae744722f587ea70ad15ae731059
|
data/bin/botemon
CHANGED
@@ -20,26 +20,28 @@
|
|
20
20
|
#++
|
21
21
|
|
22
22
|
require 'botemon'
|
23
|
+
require 'open-uri'
|
23
24
|
|
24
|
-
abort 'Usage: botemon <bot_name> <
|
25
|
+
abort 'Usage: botemon <bot_name> <server> <channels>' if ARGV.length < 3
|
25
26
|
|
26
27
|
Cinch::Bot.new {
|
27
28
|
configure do |c|
|
28
29
|
c.nick = ARGV[0]
|
29
30
|
c.realname = ARGV[0]
|
30
31
|
c.user = ARGV[0]
|
31
|
-
c.password =
|
32
|
-
c.server = ARGV[
|
33
|
-
c.channels = ARGV.drop(
|
32
|
+
c.password = 'dat_password'
|
33
|
+
c.server = ARGV[1]
|
34
|
+
c.channels = ARGV.drop(2).map { |c| "\##{c}" }
|
34
35
|
|
35
36
|
c.plugins.plugins = [Cinch::Plugins::Login]
|
36
|
-
c.plugins.options[Cinch::Plugins::Login] = { :password =>
|
37
|
+
c.plugins.options[Cinch::Plugins::Login] = { :password => 'dat_password' }
|
37
38
|
|
38
39
|
@storage = Storage.new './cache.db'
|
39
40
|
@pokemon_trivia = nil
|
40
41
|
@players = []
|
41
42
|
@trivia_owner = ''
|
42
43
|
@trivia_wrong = 0
|
44
|
+
@bot_admin = [ 'mirkosp', 'RoxasShadowRS' ]
|
43
45
|
end
|
44
46
|
|
45
47
|
on :message, /^pkmn (.+)/ do |m, name|
|
@@ -81,7 +83,7 @@ Cinch::Bot.new {
|
|
81
83
|
end
|
82
84
|
end
|
83
85
|
|
84
|
-
on :message, /^pstats (
|
86
|
+
on :message, /^pstats (\S*) (\S*) (\S*) (.*)/ do |m, name, level, nature, evs|
|
85
87
|
@storage = Storage.new('./cache.db') unless @storage
|
86
88
|
|
87
89
|
name = Smogon::Pokemon.id2name(name) if name.numeric?
|
@@ -89,13 +91,13 @@ Cinch::Bot.new {
|
|
89
91
|
|
90
92
|
hidden_values = evs.strip.split
|
91
93
|
if hidden_values.length == 2
|
92
|
-
evs = hidden_values[0].
|
93
|
-
ivs = hidden_values[1].
|
94
|
+
evs = hidden_values[0].split ?/
|
95
|
+
ivs = hidden_values[1].split ?/
|
94
96
|
else
|
95
|
-
evs = evs.
|
97
|
+
evs = evs.split ?/
|
96
98
|
ivs = '31/31/31/31/31/31'.split ?/
|
97
99
|
end
|
98
|
-
|
100
|
+
|
99
101
|
m.reply "#{pokemon.name}: (#{pokemon.types.join(?-)}) #{pokemon.stats(level.to_i, nature, evs, ivs).join(?/)}"
|
100
102
|
end
|
101
103
|
|
@@ -110,7 +112,7 @@ Cinch::Bot.new {
|
|
110
112
|
@storage = Storage.new('./cache.db') unless @storage
|
111
113
|
|
112
114
|
if @pokemon_trivia != nil
|
113
|
-
m.reply Format(:red, 'Other players are playing, wait until they finish.')
|
115
|
+
m.reply Format(:red, 'Other players are playing, please wait until they finish.')
|
114
116
|
m.reply Format(:red, @pokemon_trivia.clues)
|
115
117
|
else
|
116
118
|
@pokemon_trivia = Pokedex.get Smogon::Pokemon.id2name(Random.new.rand(1..649)).delete(?'), @storage
|
@@ -137,7 +139,7 @@ Cinch::Bot.new {
|
|
137
139
|
m.reply Format(:red, "Nope, #{m.user.nick} was wrong.")
|
138
140
|
@trivia_wrong += 1
|
139
141
|
if @trivia_wrong >= 3
|
140
|
-
m.reply Format(:red, "
|
142
|
+
m.reply Format(:red, "You have no more chances. The secret Pokémon is #{@pokemon_trivia.name}!")
|
141
143
|
@pokemon_trivia = nil
|
142
144
|
@trivia_wrong = 0
|
143
145
|
end
|
@@ -145,25 +147,26 @@ Cinch::Bot.new {
|
|
145
147
|
end
|
146
148
|
|
147
149
|
on :message, /^pkstop$/ do |m|
|
148
|
-
if @pokemon_trivia != nil && (
|
150
|
+
if @pokemon_trivia != nil && (@bot_admin.include?(m.user.nick) || m.user.nick == @trivia_owner)
|
149
151
|
@pokemon_trivia = nil
|
150
152
|
@trivia_owner = ''
|
151
153
|
@trivia_wrong = 0
|
152
154
|
m.reply Format(:red, "Game aborted by #{m.user.nick}.")
|
153
155
|
elsif @pokemon_trivia == nil
|
154
|
-
m.reply Format(:red, 'Game not started.')
|
156
|
+
m.reply Format(:red, 'Game not started yet.')
|
155
157
|
else
|
156
|
-
m.reply Format(:red, "Only
|
158
|
+
m.reply Format(:red, "Only channel operators and the game luncher can stop the game. #{m.user.nick} GTFO.")
|
157
159
|
end
|
158
160
|
end
|
159
161
|
|
160
162
|
on :message, /^pkdebug$/ do |m|
|
161
163
|
if @pokemon_trivia == nil
|
162
164
|
m.reply Format(:red, 'Game not started.')
|
163
|
-
elsif
|
165
|
+
elsif @bot_admin.include?(m.user.nick)
|
164
166
|
m.reply Format(:red, @pokemon_trivia.name)
|
165
167
|
else
|
166
|
-
|
168
|
+
proverbs = open('http://pastebin.com/raw.php?i=qWF65TcP').read.each_line.to_a.sample.strip
|
169
|
+
m.reply Format(:red, proverbs)
|
167
170
|
end
|
168
171
|
end
|
169
172
|
|
@@ -179,7 +182,8 @@ Cinch::Bot.new {
|
|
179
182
|
|
180
183
|
m.reply Format(:red, 'Cache created.')
|
181
184
|
else
|
182
|
-
|
185
|
+
proverbs = open('http://pastebin.com/raw.php?i=qWF65TcP').read.each_line.to_a.sample.strip
|
186
|
+
m.reply Format(:red, proverbs)
|
183
187
|
end
|
184
188
|
end
|
185
189
|
|
@@ -189,10 +193,15 @@ Cinch::Bot.new {
|
|
189
193
|
end
|
190
194
|
|
191
195
|
on :message, /^pkhelp$/ do |m|
|
192
|
-
m.reply Format(:red, "- pkmn
|
193
|
-
m.reply Format(:red, "-
|
194
|
-
m.reply Format(:red, "-
|
195
|
-
m.reply Format(:red, "-
|
196
|
-
m.reply Format(:red, "-
|
196
|
+
m.reply Format(:red, "- pkmn Bulbasaur ")
|
197
|
+
m.reply Format(:red, "- pkmn 1 ")
|
198
|
+
m.reply Format(:red, "- ability Synchronize ")
|
199
|
+
m.reply Format(:red, "- item Leftovers ")
|
200
|
+
m.reply Format(:red, "- move Reflect ")
|
201
|
+
m.reply Format(:red, "- moveset Bulbasaur LC ")
|
202
|
+
m.reply Format(:red, "- moveset Bulbasaur LC DP ")
|
203
|
+
m.reply Format(:red, "- pstats Scizor 70 Adamant 0/252/0/0/6/252 15/31/30/2/31/31 ")
|
204
|
+
m.reply Format(:red, "- pstats Scizor 70 Adamant 0/252/0/0/6/252 ")
|
205
|
+
m.reply Format(:red, "- pkrandom, pktrivia, pkdebug, pkstop, pkcache, pkversion ")
|
197
206
|
end
|
198
207
|
}.start
|
data/lib/botemon/storage.rb
CHANGED
data/lib/botemon/version.rb
CHANGED
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: botemon
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.5.
|
4
|
+
version: 0.5.5
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Giovanni Capuano
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2013-12-
|
11
|
+
date: 2013-12-21 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: nokogiri
|