Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- package Bot;
- import org.jibble.pircbot.*;
- public class MyBot extends PircBot {
- public MyBot() {
- this.setName("SjBot");
- }
- String cline = "!%: time, say, info" ;
- public static void coma(String[] args) {
- String[] coma ;
- coma = new String [6] ;
- coma[0] = "time" ;
- coma[1] = "say" ;
- coma[2] = "info" ;
- coma[3] = "do" ;
- coma[4] = "troll" ;
- }
- public static void guide(String[] args) {
- String[] guide ;
- guide = new String [6] ;
- guide[0] = "Returns the current time in CEST" ;
- guide[1] = "Makes the bot say something: !%say <text>" ;
- guide[2] = "Returns a list of info about the bot" ;
- guide[3] = "Makes the bot do an action: !%do <action>" ;
- guide[4] = "Replies with a trolly msg" ;
- }
- public void onMessage(String channel, String sender,
- String login, String hostname, String message) {
- if (message.equalsIgnoreCase("!%time")) {
- String time = new java.util.Date().toString();
- sendMessage(channel, sender + ": The time is now " + time);
- }
- else if (message.equalsIgnoreCase("!%help")) {
- sendMessage(channel,"Avalible commands are "+cline);
- }
- else if (message.startsWith("!%say")) {
- sendMessage(channel, message.substring(6));
- }
- else if (message.equalsIgnoreCase("!%info")) {
- sendNotice(sender, sender+": this bot is built on PircBot") ;
- sendNotice(sender, sender+": the bot owner is Sjele") ;
- sendNotice(sender, sender+": it is made in Java") ;
- sendNotice(sender, sender+": the prefix is !%") ;
- sendNotice(sender, sender+": for a list of commands do !%help") ;
- sendNotice(sender, sender+": Thanks for reading this info ") ;
- }
- else if (message.equalsIgnoreCase("!%cmds"))
- for (int i; i < coma[].length; i++) {
- }
- //THIS IS A COMMENT
- else if (message.startsWith("!%do")) {
- sendAction(channel, message.substring(5)) ;
- }
- else if (message.equalsIgnoreCase("!%troll")) {
- sendMessage(channel, "Trolllll lol loll looloool") ;
- }
- else if (message.equalsIgnoreCase("!%begonne")) {
- if (sender.equals("Sjele")) {
- partChannel(channel,"Bye") ;
- }
- }
- }
- }
Add Comment
Please, Sign In to add comment