Guest User

Untitled

a guest
Jan 17th, 2019
74
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 2.43 KB | None | 0 0
  1. package Bot;
  2.  
  3. import org.jibble.pircbot.*;
  4.  
  5. public class MyBot extends PircBot {
  6.  
  7. public MyBot() {
  8. this.setName("SjBot");
  9. }
  10.  
  11. String cline = "!%: time, say, info" ;
  12. public static void coma(String[] args) {
  13. String[] coma ;
  14. coma = new String [6] ;
  15. coma[0] = "time" ;
  16. coma[1] = "say" ;
  17. coma[2] = "info" ;
  18. coma[3] = "do" ;
  19. coma[4] = "troll" ;
  20. }
  21.  
  22. public static void guide(String[] args) {
  23. String[] guide ;
  24. guide = new String [6] ;
  25. guide[0] = "Returns the current time in CEST" ;
  26. guide[1] = "Makes the bot say something: !%say <text>" ;
  27. guide[2] = "Returns a list of info about the bot" ;
  28. guide[3] = "Makes the bot do an action: !%do <action>" ;
  29. guide[4] = "Replies with a trolly msg" ;
  30. }
  31.  
  32. public void onMessage(String channel, String sender,
  33. String login, String hostname, String message) {
  34. if (message.equalsIgnoreCase("!%time")) {
  35. String time = new java.util.Date().toString();
  36. sendMessage(channel, sender + ": The time is now " + time);
  37. }
  38.  
  39. else if (message.equalsIgnoreCase("!%help")) {
  40. sendMessage(channel,"Avalible commands are "+cline);
  41. }
  42.  
  43. else if (message.startsWith("!%say")) {
  44. sendMessage(channel, message.substring(6));
  45. }
  46.  
  47. else if (message.equalsIgnoreCase("!%info")) {
  48. sendNotice(sender, sender+": this bot is built on PircBot") ;
  49. sendNotice(sender, sender+": the bot owner is Sjele") ;
  50. sendNotice(sender, sender+": it is made in Java") ;
  51. sendNotice(sender, sender+": the prefix is !%") ;
  52. sendNotice(sender, sender+": for a list of commands do !%help") ;
  53. sendNotice(sender, sender+": Thanks for reading this info ") ;
  54. }
  55. else if (message.equalsIgnoreCase("!%cmds"))
  56. for (int i; i < coma[].length; i++) {
  57.  
  58. }
  59.  
  60. //THIS IS A COMMENT
  61. else if (message.startsWith("!%do")) {
  62. sendAction(channel, message.substring(5)) ;
  63. }
  64. else if (message.equalsIgnoreCase("!%troll")) {
  65. sendMessage(channel, "Trolllll lol loll looloool") ;
  66. }
  67. else if (message.equalsIgnoreCase("!%begonne")) {
  68. if (sender.equals("Sjele")) {
  69. partChannel(channel,"Bye") ;
  70. }
  71. }
  72. }
  73. }
Add Comment
Please, Sign In to add comment