Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- public void onMessage(String channel, String sender, String login, String hostname, String message) {
- String messageIC = message.trim( ).toLowerCase( );
- if (message.equalsIgnoreCase("time")) {
- String time = new java.util.Date().toString();
- sendMessage(channel, sender + ": The time is now " + time);
- }
- if (messageIC.contains("Ampersand")) {
- double randomosity = Math.random();
- if (randomosity < 0.4) {
- sendMessage(channel, "Hello.");
- }
- else if (randomosity > 0.7) {
- sendMessage(channel, "Sup?");
- }
- else {
- sendMessage(channel, "I am Ampersand, a bot created out of boredom and lack of witty replies.");
- }
- }
- if (messageIC.contains("Poad")) {
- double randomosity = Math.random();
- if (randomosity < 0.2) {
- sendMessage(channel, "Poad is my brother.");
- }
- else if (randomosity > 0.9) {
- sendMessage(channel, "!slay Poad");
- }
- else if (randomosity >.2 && randomosity <.5) {
- sendMessage(channel, "Poad, I love you.");
- }
- else if (randomosity >.5 && randomosity <.9) {
- sendMessage(channel, "No love for Ampersand?")
- }
- }
- if (messageIC.contains("I want it")) {
- sendMessage(channel, "I want it that way.")
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement