Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- //there is a switch statement which gives the "gserver" and "link" before this, I'm not on my comp so I'm not gonna be able to copy and paste it. The other stuff I wrote while on the school computer. Stealers beware, there's probably some errors in this XD also because the methods for the colors aren't included here either...
- String gserver = "http://aos075.aloha.pk:", num = comm[comm.length - 1], String link;
- //the old switcheroo goes here XD
- URL server = new URL(gserver);
- BufferedReader htmlcrawler = (new BufferedReader(new InputStreamReader(server.openStream())));
- if(!num.contains("#")) {
- num = "#" + num;
- }
- String ctry = "", name = "", ping = "", team = "", score = "", kill = "", death = "", ratio = "", strk = "", bstrk = "", racc = "", smacc = "", shacc = "", afk = "";
- try {
- String ln = htmlcrawler.readLine();
- while(ln != null) {
- ln = htmlcrawler.readLine();
- if(htmlcrawler.trim().contains(num)) {
- System.out.println("INIT");
- ctry = DARK_BLUE + htmlcrawler.readLine().trim().split(">", -1)[3].replaceAll("</p", "");
- name = DARK_BLUE + htmlcrawler.readLine().trim().replaceAll("<td>", "").replaceAll("</td>", "");
- htmlcrawler.readLine(); htmlcrawler.readLine();
- ping = htmlcrawler.readLine().trim().split("<", -1)[0];
- team = htmlcrawler.readLine().trim().split("\\s+", -1)[7].replaceAll("</td>", "");
- score = "Score: " + DARK_BLUE + htmlcrawler.readLine().trim().replaceAll("<td>", "");
- htmlcrawler.readLine(); htmlcrawler.readLine();
- if(ln.contains("Has enemy intel")) {
- htmlcrawler.readLine(); htmlcrawler.readLine();
- }
- htmlcrawler.readLine(); htmlcrawler.readLine();
- kill = "K: " + DARK_BLUE + htmlcrawler.readLine().trim().replaceAll("<td>", "").replaceAll("</td>", "");
- death = "D: " + DARK_BLUE + htmlcrawler.readLine().trim().replaceAll("<td>", "").replaceAll("</td>", "");
- htmlcrawler.readLine(); htmlcrawler.readLine(); htmlcrawler.readLine(); htmlcrawler.readLine();
- ratio = htmlcrawler.readLine().trim().replaceAll("</td>", "");
- strk = "Strk: " + DARK_BLUE + htmlcrawler.readLine().trim().replaceAll("<td>", "").replaceAll("</td>", "");
- bstrk = "\u2605Strk: " + DARK_BLUE + htmlcrawler.readLine().trim().replaceAll("<td>", "").replaceAll("</td>", "");
- htmlcrawler.readLine(); htmlcrawler.readLine(); htmlcrawler.readLine(); htmlcrawler.readLine(); htmlcrawler.readLine();
- racc = htmlcrawler.readLine().split("<", -1)[0];
- htmlcrawler.readLine(); htmlcrawler.readLine(); htmlcrawler.readLine(); htmlcrawler.readLine();
- smacc = htmlcrawler.readLine().split("<", -1)[0];
- htmlcrawler.readLine(); htmlcrawler.readLine(); htmlcrawler.readLine(); htmlcrawler.readLine();
- shacc = htmlcrawler.readLine().split("<", -1)[0];
- afk = "AFK: " + DARK_BLUE + htmlcrawler.readLine().trim().substring(4).replaceAll("</td>", "");
- break;
- }
- }
- }
- catch (java.lang.NullPointerException e) {
- }
- switch(team.toLowerCase()) {
- case "green":
- nick = GREEN + nick;
- team = GREEN + team;
- break;
- case "blue":
- nick = BLUE + nick;
- team = BLUE + team;
- break;
- case "red":
- nick = RED + nick;
- team = RED + team;
- break;
- case "global":
- nick = LIGHT_GRAY + nick;
- team = LIGHT_GRAY + team;
- break;
- case "ffa":
- nick = DARK_GRAY + nick;
- team = DARK_GRAY + team;
- break;
- }
- if(Integer.parseInt(ping) <= 70) {
- ping = BLUE + ping;
- }
- if(Integer.parseInt(ping) > 70 && Integer.parseInt(ping) <= 150) {
- ping = GREEN + ping;
- }
- if(Integer.parseInt(ping) > 150 && Integer.parseInt(ping) <= 300) {
- ping = YELLOW + ping;
- }
- if(Integer.parseInt(ping) > 300) {
- ping = RED + ping;
- }
- if(Double.parseDouble(ratio) > 1.0 && Double.parseDouble(ratio) <= 1.5) {
- ratio = BLUE + ratio;
- }
- if(Double.parseDouble(ratio) > 1.5 && Double.parseDouble(ratio) <= 3.0) {
- ratio = GREEN + ratio;
- }
- if(Double.parseDouble(ratio) > 3.0 && Double.parseDouble(ratio) <= 4.5) {
- ratio = YELLOW + ratio;
- }
- if(Double.parseDouble(ratio) > 4.5) {
- ratio = RED + ratio;
- }
- if(Integer.parseInt(racc.replaceAll("%", "")) <= 20) {
- racc = BLUE + racc;
- }
- if(Integer.parseInt(racc.replaceAll("%", "")) > 20 && Integer.parseInt(racc.replaceAll("%", "")) <= 85) {
- racc = GREEN + racc;
- }
- if(Integer.parseInt(racc.replaceAll("%", "")) > 85 && Integer.parseInt(racc.replaceAll("%", "")) <= 100) {
- racc = YELLOW + racc;
- }
- if(Integer.parseInt(racc.replaceAll("%", "")) > 100) {
- racc = RED + racc;
- }
- if(Integer.parseInt(smacc.replaceAll("%", "")) <= 20) {
- smacc = BLUE + smacc;
- }
- if(Integer.parseInt(smacc.replaceAll("%", "")) > 20 && Integer.parseInt(smacc.replaceAll("%", "")) <= 85) {
- smacc = GREEN + smacc;
- }
- if(Integer.parseInt(smacc.replaceAll("%", "")) > 85 && Integer.parseInt(smacc.replaceAll("%", "")) <= 100) {
- smacc = YELLOW + smacc;
- }
- if(Integer.parseInt(smacc.replaceAll("%", "")) > 100) {
- smacc = RED + smacc;
- }
- if(Integer.parseInt(shacc.replaceAll("%", "")) <= 20) {
- shacc = BLUE + shacc;
- }
- if(Integer.parseInt(shacc.replaceAll("%", "")) > 20 && Integer.parseInt(shacc.replaceAll("%", "")) <= 85) {
- shacc = GREEN + shacc;
- }
- if(Integer.parseInt(shacc.replaceAll("%", "")) > 85 && Integer.parseInt(shacc.replaceAll("%", "")) <= 100) {
- shacc = YELLOW + shacc;
- }
- if(Integer.parseInt(shacc.replaceAll("%", "")) > 100) {
- shacc = RED + shacc;
- }
- String sep = DARK_GREEN + BOLD + " / " + NORMAL;
- String mess = (num + sep + ctry + sep + name + sep + ping + sep + team + sep + score + sep + kill + sep + death + sep + ratio + sep + strk + sep + bstrk + sep + racc + sep + smacc + sep + shacc + sep + afk + sep + gserver + sep + link);
- msg("", chan, mess, writer);
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement