From f8f247f556bff65043bbd3f6229371d24d326faa Mon Sep 17 00:00:00 2001 From: terribleplan Date: Sun, 30 Jun 2013 19:08:15 -0500 Subject: [PATCH] remove debug code --- build/EvilBotX-0.1.1-final.jar | Bin 57238 -> 57210 bytes .../xrg/evilbotx/components/UrbanCommand.java | 157 +++++++++--------- 2 files changed, 77 insertions(+), 80 deletions(-) diff --git a/build/EvilBotX-0.1.1-final.jar b/build/EvilBotX-0.1.1-final.jar index 49fc9e592b07dfcaf13a7599af825a484facf3ec..5f8b9baf61a48689828da3c22e94da022e0821af 100644 GIT binary patch delta 2272 zcmV<62p{*BzXSTd0}N100|XQR2nYxO;+U}vdS?RBn3ITSLVs)&RT%zGciWi`1D1sr z7K#)^*rk`1s;FBKY$;IK7PQ<^ak?G4Q+8*Tnb`u~?}+!i7B6^t@IhkK#Dz#S_~3&k zzWT0jMiUbg6BFa*JG0wTw%cf%o%zpy{`>!(|ID|4fBq$aYw@0f8i7?qX5zRzk}$`t z?2zLhPo$k(-hZ)8+xHT?-66y7adJ7s9##+*SWzjQH{3w7w|igDgq}d%I?J~Fn+2L< zsY;DO-*Jr*vn#$wAl%~&n+oa$Ryvf)TW&g#$vDmtk1B!be$(@)&?{FOLYSqa7P>(D z%(hdb#+Z@F8umz{Cu?|K;OvT&Wt#(q+>q(+GKR9IKz}6Vq>bzz!?onP%nbV(%M*xC zGd@FIx&#E}qca90Fe^j3Y$*eQC9zbMWP?q{sX;}Pjs;jKppBS*IeUTmvG|m<27TAE zN4iujVzrkQWIP(0aixMK0u7aNI+mh^_B`KkeQ&SjX9OB!)6K;Xs94T?TBNNNI`rk!Rt4@i}mjyP5e)Oz`>#Z+TeeDuW+PG>4;6PPE< zGU_>YV%y-3fgMAmX4+TKA+VrQzPn&$hfP<-H3A(O-_Iu#2_tWH1a%m;(!S-`hI^ue zElZ4DlNdG+v-KN%)6K2d(2h=tplfF+0XuL#Zhug)mOZU(>2BX*UY6#qLP&Hy;8su{1+0}ZX{RI!EnuIUxB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NF5)P>CzD|5NWn&M zKx%&oJNBOYOoIO-Jd{OQ+`Kt4gQpDUM{OEfa@%r<7_-z$Us}oxJ>_+%?p%CdT zOWABEhG5tdc$XFbImu;C;k>Rqp$nD-8n4u2@&1VGl}nUmlaG_4}&)gSPaLH*8Ax}EeFHlPd2zs@mUI_sJ0D7}b z)dc|pT8^_**75`m8;;&WzEZ|pv<3hG*^^S+YypdtzuQ*=cXE>~axard+$sT~lXBcf z0?2-oKY$gJ&)hNsihz?pfE$w@-6{e~fs_A$8k0xd5R-J>8Uh`alaSp;0!X5h{h=U} z_}wZ3Kctf+-bDg7&Xa52NCGL)leOM7Iv3Lb04`%}VRLhEVRUFvO928D02BZS2nYZ} zQrSX!wW3}L0RRAc0RR9A00000000000000004vm!Bi}UvYm-^u8wO$4000008YxEb diff --git a/src/be/xrg/evilbotx/components/UrbanCommand.java b/src/be/xrg/evilbotx/components/UrbanCommand.java index 04563e7..8f3f1ae 100644 --- a/src/be/xrg/evilbotx/components/UrbanCommand.java +++ b/src/be/xrg/evilbotx/components/UrbanCommand.java @@ -1,80 +1,77 @@ -package be.xrg.evilbotx.components; - -import org.json.JSONArray; -import org.json.JSONObject; -import org.pircbotx.hooks.Event; -import org.pircbotx.hooks.events.MessageEvent; - -import be.xrg.evilbotx.Storage; -import be.xrg.evilbotx.Utilities; - -@SuppressWarnings("rawtypes") -public class UrbanCommand extends be.xrg.evilbotx.parents.EBXComponent { - - public UrbanCommand(Storage s) { - super(s, MessageEvent.class); - } - - public void handleEvent(Event e) { - MessageEvent t = (MessageEvent) e; - String b = t.getMessage(); - boolean response = false; - if (b.startsWith("!urban")) { - if (b.contains(" ")) { - String[] c = b.split(" ", 2); - System.out.println(c[0]); - System.out.println(c[1]); - String a = Utilities - .getHTMLPage("http://api.urbandictionary.com/v0/define?term=" - + Utilities.urlEncode(c[1]))[1]; - System.out.println(a); - JSONObject d = new JSONObject(a); - if (d.has("result_type")) { - Object g = d.get("result_type"); - if (g instanceof String) { - if (((String) g).equals("exact")) { - if (d.has("list")) { - JSONArray h = d.getJSONArray("list"); - d = h.getJSONObject(0); - if (d.has("word") && d.has("definition")) { - Object i = d.get("word"), j = d - .get("definition"); - if ((i instanceof String) - && (j instanceof String)) { - t.getBot().sendMessage( - t.getChannel(), - ((String) i) + ": " - + ((String) j)); - response = true; - } - } - } - } else { - t.respond("Unable to find exact match."); - response = true; - } - } - } - } - } - if (!response) { - t.respond("Unable to perform lookup."); - } - } - - protected boolean wantEventM(Event e) { - if (e instanceof MessageEvent) { - return ((MessageEvent) e).getMessage().startsWith("!urban"); - } - return false; - } - - public String getComponentName() { - return "UrbanCommand"; - } - - public int getComponentID() { - return 4823303; - } - -} +package be.xrg.evilbotx.components; + +import org.json.JSONArray; +import org.json.JSONObject; +import org.pircbotx.hooks.Event; +import org.pircbotx.hooks.events.MessageEvent; + +import be.xrg.evilbotx.Storage; +import be.xrg.evilbotx.Utilities; + +@SuppressWarnings("rawtypes") +public class UrbanCommand extends be.xrg.evilbotx.parents.EBXComponent { + + public UrbanCommand(Storage s) { + super(s, MessageEvent.class); + } + + public void handleEvent(Event e) { + MessageEvent t = (MessageEvent) e; + String b = t.getMessage(); + boolean response = false; + if (b.startsWith("!urban")) { + if (b.contains(" ")) { + String[] c = b.split(" ", 2); + JSONObject d = new JSONObject( + Utilities + .getHTMLPage("http://api.urbandictionary.com/v0/define?term=" + + Utilities.urlEncode(c[1]))[1]); + if (d.has("result_type")) { + Object g = d.get("result_type"); + if (g instanceof String) { + if (((String) g).equals("exact")) { + if (d.has("list")) { + JSONArray h = d.getJSONArray("list"); + d = h.getJSONObject(0); + if (d.has("word") && d.has("definition")) { + Object i = d.get("word"), j = d + .get("definition"); + if ((i instanceof String) + && (j instanceof String)) { + t.getBot().sendMessage( + t.getChannel(), + ((String) i) + ": " + + ((String) j)); + response = true; + } + } + } + } else { + t.respond("Unable to find exact match."); + response = true; + } + } + } + } + } + if (!response) { + t.respond("Unable to perform lookup."); + } + } + + protected boolean wantEventM(Event e) { + if (e instanceof MessageEvent) { + return ((MessageEvent) e).getMessage().startsWith("!urban"); + } + return false; + } + + public String getComponentName() { + return "UrbanCommand"; + } + + public int getComponentID() { + return 4823303; + } + +}