TheProfosist

Untitled

Aug 5th, 2010
94
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 10.03 KB | None | 0 0
  1. //***********************************************************************
  2. //***** BOT: NAME - Cloud, type help bot.*******************************
  3. //***********************************************************************
  4. //***********************************************************************
  5.  
  6. import org.jibble.pircbot.*;
  7.  
  8. public class Cloud extends PircBot
  9. {
  10. public Cloud()
  11. {
  12. this.setName("Genjutsu");
  13. this.identify("kaedefuyou");
  14. this.sendMessage("#dac", Colors.DARK_BLUE + Colors.BOLD + "I am here to serve you my master");
  15. }
  16.  
  17. public void onMessage(String channel, String sender,String login, String hostname, String message)
  18. {
  19.  
  20. if(message.equalsIgnoreCase("time"))
  21. {
  22. String time = new java.util.Date().toString();
  23. sendMessage(channel, sender + ": The time is now " + time);
  24. }
  25. if(message.equalsIgnoreCase("Hello"))
  26. {
  27. sendMessage(channel,sender +": " + Colors.BOLD + "Hello! How are you?");
  28. }
  29.  
  30.  
  31.  
  32. //Start of help func
  33. //
  34. // Variables declared
  35. // a = for selection of menu
  36. //
  37. if(message.equalsIgnoreCase("!help"))
  38. {
  39. sendMessage(channel, "Since my master is not present I will help you around for a while");
  40. sendMessage(channel, "Please enter a choice followed by my name");
  41. sendMessage(channel, "1. Delhi Anime Club");
  42. sendMessage(channel, "2. Anime Clubs in India");
  43. sendMessage(channel, "3. Anime Meets");
  44. sendMessage(channel, "4. Anime Sharing");
  45. sendMessage(channel, "5. How to use IRC");
  46. sendMessage(channel, "6. What we do here");
  47. sendMessage(channel, "7. Links");
  48. sendMessage(channel, "8. Who are we");
  49. sendMessage(channel, "For Example: If you want to know about 2. Anime Clubs type Genjutsu 2");
  50. sendMessage(channel, "9. What the hell?");
  51. }
  52.  
  53. {
  54. int a = 0;
  55. if(message.equalsIgnoreCase("Genjutsu 1") || message.equalsIgnoreCase("Genjutsu: 1")
  56. || message.equalsIgnoreCase("Genjutsu 0"))
  57. {
  58. a=1;
  59. }
  60.  
  61. if(message.equalsIgnoreCase("Genjutsu 2") || message.equalsIgnoreCase("Genjutsu: 2")
  62. || message.equalsIgnoreCase("Genjutsu 0"))
  63. {
  64. a=2;
  65. }
  66. if(message.equalsIgnoreCase("Genjutsu 3") || message.equalsIgnoreCase("Genjutsu: 3")
  67. || message.equalsIgnoreCase("Genjutsu 0"))
  68. {
  69. a=3;
  70. }
  71. if(message.equalsIgnoreCase("Genjutsu 4") || message.equalsIgnoreCase("Genjutsu: 4")
  72. || message.equalsIgnoreCase("Genjutsu 0"))
  73. {
  74. a=4;
  75. }
  76. if(message.equalsIgnoreCase("Genjutsu 5") || message.equalsIgnoreCase("Genjutsu: 5")
  77. || message.equalsIgnoreCase("Genjutsu 0"))
  78. {
  79. a=5;
  80. }
  81. if(message.equalsIgnoreCase("Genjutsu 6") || message.equalsIgnoreCase("Genjutsu: 6")
  82. || message.equalsIgnoreCase("Genjutsu 0"))
  83. {
  84. a=6;
  85. }
  86. if(message.equalsIgnoreCase("Genjutsu 7") || message.equalsIgnoreCase("Genjutsu: 7")
  87. || message.equalsIgnoreCase("Genjutsu 0"))
  88. {
  89. a=7;
  90. }
  91. if(message.equalsIgnoreCase("Genjutsu 8") || message.equalsIgnoreCase("Genjutsu: 7")
  92. || message.equalsIgnoreCase("Genjutsu 0"))
  93. {
  94. a=8;
  95. }
  96. if(message.equalsIgnoreCase("Genjutsu 9") || message.equalsIgnoreCase("Genjutsu: 7")
  97. || message.equalsIgnoreCase("Genjutsu 0"))
  98. {
  99. a=9;
  100. }
  101.  
  102. switch(a)
  103. {
  104. case 1: sendMessage(sender, sender + ": About Delhi Anime Club");
  105. break;
  106. case 2: sendMessage(sender, sender + ": Other Anime Clubs in India");
  107. break;
  108. case 3: sendMessage(sender, sender + ": Delhi Anime Meets");
  109. sendMessage(sender, sender + ":Our Meets - on 8st August at CP at 10:00 hrs sharply ");
  110. sendMessage(sender, sender + ":Future Meetups");
  111. break;
  112. case 4: sendMessage(sender, sender + ": Anime Sharing");
  113. break;
  114. case 5: sendMessage(sender, sender + ": What you need to know for using IRC");
  115. sendMessage(sender, sender + ":Since you have already connected to th chat, I don't need to tell you how to do that. ");
  116. sendMessage(sender, sender + ":Towards your right you will see a pane which has the users that are connected to the chat " );
  117. sendMessage(sender, sender + ":at the moment. You can send a private message to any of them by ust double clicking on their ");
  118. sendMessage(sender, sender + ":name and a window will open. Just type in a message and it would be sent as a private chat ");
  119. sendMessage(sender, sender + ":to the other user. "+
  120. ""+
  121. "");
  122. break;
  123. case 6: sendMessage(sender, sender + ": We have lots and lots of fun here");
  124. break;
  125. case 7: sendMessage(sender, sender + ": Links");
  126.  
  127. sendMessage(sender, sender + ":Our Orkut Comnunity -");
  128.  
  129.  
  130. sendMessage(sender, sender + ":Our FaceBook Page - http://www.facebook.com/pages/Delhi-Anime-Club/132308146804794");
  131.  
  132. sendMessage(sender, sender + ":Our Website - Under Construction");
  133.  
  134. sendMessage(sender, sender + ":Kaiokane's webpage - http://www.hd-crazy.com/wordpress ");
  135.  
  136. break;
  137. case 8: sendMessage(sender, sender + ": WE ARE ANIME FREAKS ");
  138. sendMessage(sender, sender + ":Kaiokane, The Channel Owner. He has provided us with this 24X7 IRC Channel ");
  139. sendMessage(sender, sender + ":Sudipta, The channel Operator. He heppened to send a friend request to Kaiokane, ");
  140. sendMessage(sender, sender + ":and has been feeling rejuvenated since. ");
  141. sendMessage(sender, sender + ":Oh! and yes he is also a moderator for dac and likes to call himself a marketing otakut");
  142. break;
  143. case 9: sendMessage(sender, sender + ": Fuck off this channel immidiately...");
  144. break;
  145.  
  146. }
  147. }
  148. //End of Help Func
  149. //Start of master servant behaviour
  150. if((sender.toString()).equalsIgnoreCase("Kaiokane"))
  151.  
  152. {
  153. if(message.equalsIgnoreCase("Genjutsu behave") )
  154. {
  155. sendMessage(channel,sender + ": I am sorry my master");
  156. }
  157. if(message.equalsIgnoreCase("who is Gyrovagus") )
  158. {
  159. sendMessage(channel,sender + ": Hes a Gay...and uses fucked up humour and is a Child Molestor..");
  160. }
  161. if(message.equalsIgnoreCase("Genjutsu smile"))
  162. {
  163. sendMessage(channel, ":D :D :D :D :D :D :D :D");
  164. }
  165. if(message.equalsIgnoreCase("Genjutsu join hina"))
  166. {
  167. this.joinChannel("#hina");
  168. }
  169. if(message.equalsIgnoreCase("Genjutsu leave me"))
  170. {
  171. sendMessage(channel, "Master I will be at your service when you need me");
  172. this.quitServer("orders from my master");
  173. }
  174. if(message.equalsIgnoreCase("Genjutsu join aa"))
  175. {
  176. this.joinChannel("#aa");
  177. }
  178. if(message.equalsIgnoreCase("Genjutsu join chihiro"))
  179. {
  180. this.joinChannel("#chihiro");
  181. }
  182. if(message.equalsIgnoreCase("Genjutsu kick"))
  183. {
  184. //for kicking a specific user this.kick(channel, nick);
  185. }
  186. if(message.equalsIgnoreCase("Genjutsu dance"))
  187. {
  188. //add ascii character
  189. }
  190. {
  191. String str = message;
  192. char charr[] = str.toCharArray();
  193. int i = str.length();
  194. i = i-12;
  195. String chk = new String(charr,0,11);
  196. if(chk.equalsIgnoreCase("Genjutsu join"))
  197. {
  198. String s = new String(charr,12,i);
  199. this.joinChannel(s);
  200. }
  201. }
  202. }
  203.  
  204. //End of master servant behaviour
  205. }
  206. //End of class Cloud
  207.  
  208.  
  209. public static void main(String[] args) throws Exception {
  210.  
  211. // Now start our bot up.
  212. Cloud bot = new Cloud();
  213.  
  214. // Enable debugging output.
  215. bot.setVerbose(true);
  216.  
  217. // Connect to the IRC server.
  218. bot.connect("irc.rizon.net");
  219.  
  220. // Join the #pircbot channel.
  221. bot.joinChannel("#dac");
  222.  
  223. }
  224.  
  225. }
Advertisement
Add Comment
Please, Sign In to add comment