-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathAsk.java
57 lines (48 loc) · 1.35 KB
/
Ask.java
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
import java.util.*;
import net.GUIpsp.GuiBot.*;
public class Ask extends BasePlugin {
public void main() throws Throwable {
registerCmd(
"ask",
getClass().getMethod("ask", String.class, String.class,
String.class, String.class, String.class), this,
"USAGE: " + GuiBot.pref + "ask <question> - asks " + Main.nick
+ " a question");
}
public String version() {
return "V1";
}
public String pluginName() {
return "Ask";
}
public String author() {
return "GUIpsp";
}
public void ask(String channel, String sender, String login,
String hostname, String message) {
Random random = new Random();
random.setSeed(message.hashCode());
List<String> list = new ArrayList<String>();
list.add("As I see it, yes");
list.add("It is certain");
list.add("It is decidedly so");
list.add("Most likely");
list.add("Outlook good");
list.add("Signs point to yes");
list.add("Without a doubt");
list.add("Yes");
list.add("Yes, definitely");
list.add("You may rely on it");
list.add("Don't count on it");
list.add("My reply is no");
list.add("My sources say no");
list.add("Outlook not so good");
list.add("Very doubtful");
list.add("Don't lose hope");
list.add("It may happen");
list.add("Maybe");
if (!(message.trim() == "")) {
Main.bot.sendMessage(channel, list.get(random.nextInt(list.size())));
}
}
}