-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathMyBot - Copy.java
165 lines (153 loc) · 5.07 KB
/
MyBot - Copy.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
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
import org.jibble.pircbot.*;
public class MyBot extends PircBot {
public MyBot() {
this.setName("MTRDbot");
}
public void onPrivateMessage(String sender, String login, String hostname, String message) {
// Declare variables
String thing = "";
String bay = "";
int baynum = 0;
String side = "";
int entry = 0;
String type = "";
int id = 0;
int data = 0;
String pm = "";
// Make sure it's one of us - don't spam randoms
if (sender.contains("WizardCM") || sender.contains("Motordom")) {
// Items/Blocks - in order of ID
if (message.contains("?help")) {
pm = "Help";
}
else if ((message.contains("?stone")) || (message.contains("?1"))) {
thing = "Stone";
bay = "L"; baynum = 1;
side = "L"; entry = 1;
type = "Block"; id = 1;
pm = "Storage";
}
else if ((message.contains("?grass")) || (message.contains("?2"))) {
thing = "Grass";
bay = "L"; baynum = 3;
side = "R"; entry = 7;
type = "Block"; id = 2;
pm = "Storage";
}
else if ((message.contains("?dirt")) || (message.contains("?3"))) {
thing = "Dirt";
bay = "R"; baynum = 1;
side = "L"; entry = 2;
type = "Block"; id = 3;
pm = "Storage";
}
else if ((message.contains("?cobble")) || (message.contains("?4"))) {
thing = "Cobblestone";
bay = "L"; baynum = 1;
side = "L"; entry = 2;
type = "Block"; id = 4;
pm = "Storage";
}
else if ((message.contains("?oakplank")) || (message.contains("?5"))) {
thing = "Oak Wood Planks";
bay = "R"; baynum = 1;
side = "L"; entry = 1;
type = "Block"; id = 5; data = 0;
pm = "Storage";
}
else if ((message.contains("?spruceplank")) || (message.contains("?5.1"))) {
thing = "Spruce Wood Planks";
bay = "R"; baynum = 1;
side = "L"; entry = 2;
type = "Block"; id = 5; data = 1;
pm = "Storage";
}
else if ((message.contains("?birchplank")) || (message.contains("?5.2"))) {
thing = "Birch Wood Planks";
bay = "R"; baynum = 1;
side = "L"; entry = 3;
type = "Block"; id = 5; data = 2;
pm = "Storage";
}
else if ((message.contains("?jungleplank")) || (message.contains("?5.3"))) {
thing = "Jungle Wood Planks";
bay = "R"; baynum = 1;
side = "L"; entry = 4;
type = "Block"; id = 5; data = 3;
pm = "Storage";
}
else if ((message.contains("?oaksapling")) || (message.contains("?6"))) {
thing = "Oak Sapling";
bay = "L"; baynum = 5;
side = "L"; entry = 1;
type = "Item"; id = 6; data = 0;
pm = "Storage";
}
else if ((message.contains("?sprucesapling")) || (message.contains("?6.1"))) {
thing = "Spruce Sapling";
bay = "L"; baynum = 5;
side = "L"; entry = 2;
type = "Item"; id = 6; data = 1;
pm = "Storage";
}
else if ((message.contains("?birchsapling")) || (message.contains("?6.2"))) {
thing = "Spruce Sapling";
bay = "L"; baynum = 5;
side = "R"; entry = 1;
type = "Item"; id = 6; data = 2;
pm = "Storage";
}
else if ((message.contains("?junglesapling")) || (message.contains("?6.3"))) {
thing = "Jungle Sapling";
bay = "L"; baynum = 5;
side = "R"; entry = 2;
type = "Item"; id = 6; data = 3;
pm = "Storage";
}
else if (message.contains("?cmds")) {
pm = "Commands";
}
else if ((message.contains("?7")) || (message.contains("?8")) || (message.contains("?8")) || (message.contains("?9")) || (message.contains("?10")) || (message.contains("?11"))) {
pm = "None";
}
else if (message.contains("?depart")) {
pm = "Depart";
}
else if (message.contains("?exit")) {
pm = "Exit";
}
// Respond via Private Message
if (pm == "Storage") {
sendNotice(sender, ((char) 3) + "13" + type + " " + ((char) 2) + thing + " [ID " + id + ((data == 0) ? "" : ":" + data) + "]" + ((char) 15) + ((char) 3) + "13" + " is in " + ((char) 29) + "Bay " + bay + baynum + "." + side + entry);
}
else if (pm == "Help") {
sendNotice(sender, ((char) 3) + "13" + "NAMEbot is a Minecraft helper bot coded by" + ((char) 3) + "04" + " @MotordomT & @WizardCM " + ((char) 3) + "13" + "in Java using PircBOT, primarily designed for finging items in the Motordom-WizardCM Storage Centre.");
}
else if (pm == "Commands") {
sendNotice(sender, "?stone ?grass ?dirt ?cobble ?oakplank ?spruceplank ?birchplank ?jungleplank ?help ?depart ?exit");
}
else if (pm == "None") {
sendNotice(sender, "Not a valid obtainable item/block.");
}
else if (pm == "Depart") {
sendNotice(sender, "Departing channel. To return, use ?return in a private message (non-functional yet)");
partChannel("#cloudbot", "departing");
}
else if (pm == "Exit") {
sendNotice(sender, "Shutting down NAMEBot.");
System.exit(0);
} */
}
}
}
/*
Add function to turn bot on/off
Convert if to switch/case
Finish list of data values & id's
Add more internal documentation
Add permission denial message
Think of name for bot
Add TFS?
Work out if you can do contains grass, 2
Config file?????????????????????
*/