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
|
import org.jibble.pircbot.*;
public class MyBot extends PircBot {
public MyBot() {
this.setName("vG|XtraCt");
this.setFinger("XtraCt Private Bot");
this.setLogin("XtraCt");
this.setVersion("XtraCt Test IRC Bot");
this.setMessageDelay(1);
}
@Override
protected void onMessage(String channel, String sender, String login, String hostname, String message) {
if (hostname.equals("E-XtraCt.users.quakenet.org")) {
if (message.split(" ")[0].toLowerCase().equals("!join")) {
this.joinChannel(message.split(" ")[1]);
}
if (message.split(" ")[0].toLowerCase().equals("!part")) {
this.partChannel(message.split(" ")[1]);
}
}
}
@Override
protected void onServerResponse(int code, String response) {
if (code == 433) {
this.setName(this.getName() + "`");
this.reconnect();
}
}
}
|