Advertisement
Guest User

CheckScript V3 OpFor ^MB^

a guest
Oct 29th, 2015
52
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Java 7.21 KB | None | 0 0
  1. //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...
  2.  
  3.         String gserver = "http://aos075.aloha.pk:", num = comm[comm.length - 1], String link;
  4.         //the old switcheroo goes here XD
  5.         URL server = new URL(gserver);
  6.         BufferedReader htmlcrawler = (new BufferedReader(new InputStreamReader(server.openStream())));
  7.  
  8.         if(!num.contains("#")) {
  9.             num = "#" + num;
  10.         }
  11.        
  12.         String ctry = "", name = "", ping = "", team = "", score = "", kill = "", death = "", ratio = "", strk = "", bstrk = "", racc = "", smacc = "", shacc = "", afk = "";
  13.        
  14.         try {
  15.             String ln = htmlcrawler.readLine();
  16.             while(ln != null) {
  17.                 ln = htmlcrawler.readLine();
  18.                 if(htmlcrawler.trim().contains(num)) {
  19.                     System.out.println("INIT");
  20.                     ctry = DARK_BLUE + htmlcrawler.readLine().trim().split(">", -1)[3].replaceAll("</p", "");
  21.                     name = DARK_BLUE + htmlcrawler.readLine().trim().replaceAll("<td>", "").replaceAll("</td>", "");
  22.                     htmlcrawler.readLine(); htmlcrawler.readLine();
  23.                     ping = htmlcrawler.readLine().trim().split("<", -1)[0];
  24.                     team = htmlcrawler.readLine().trim().split("\\s+", -1)[7].replaceAll("</td>", "");
  25.                     score = "Score: " + DARK_BLUE + htmlcrawler.readLine().trim().replaceAll("<td>", "");
  26.                     htmlcrawler.readLine(); htmlcrawler.readLine();
  27.             if(ln.contains("Has enemy intel")) {
  28.                         htmlcrawler.readLine(); htmlcrawler.readLine();
  29.                     }
  30.                     htmlcrawler.readLine(); htmlcrawler.readLine();
  31.                     kill = "K: " + DARK_BLUE + htmlcrawler.readLine().trim().replaceAll("<td>", "").replaceAll("</td>", "");
  32.                     death = "D: " + DARK_BLUE + htmlcrawler.readLine().trim().replaceAll("<td>", "").replaceAll("</td>", "");
  33.                     htmlcrawler.readLine(); htmlcrawler.readLine(); htmlcrawler.readLine(); htmlcrawler.readLine();
  34.                     ratio = htmlcrawler.readLine().trim().replaceAll("</td>", "");
  35.                     strk = "Strk: " + DARK_BLUE + htmlcrawler.readLine().trim().replaceAll("<td>", "").replaceAll("</td>", "");
  36.                     bstrk = "\u2605Strk: " + DARK_BLUE + htmlcrawler.readLine().trim().replaceAll("<td>", "").replaceAll("</td>", "");
  37.                     htmlcrawler.readLine(); htmlcrawler.readLine(); htmlcrawler.readLine(); htmlcrawler.readLine(); htmlcrawler.readLine();
  38.                     racc = htmlcrawler.readLine().split("<", -1)[0];
  39.                     htmlcrawler.readLine(); htmlcrawler.readLine(); htmlcrawler.readLine(); htmlcrawler.readLine();
  40.                     smacc = htmlcrawler.readLine().split("<", -1)[0];
  41.                     htmlcrawler.readLine(); htmlcrawler.readLine(); htmlcrawler.readLine(); htmlcrawler.readLine();
  42.                     shacc = htmlcrawler.readLine().split("<", -1)[0];
  43.                     afk = "AFK: " + DARK_BLUE + htmlcrawler.readLine().trim().substring(4).replaceAll("</td>", "");
  44.                     break;
  45.                 }
  46.             }
  47.         }
  48.         catch (java.lang.NullPointerException e) {
  49.         }
  50.        
  51.         switch(team.toLowerCase()) {
  52.                 case "green":
  53.                         nick = GREEN + nick;
  54.                         team = GREEN + team;
  55.                         break;
  56.                 case "blue":
  57.                         nick = BLUE + nick;
  58.                         team = BLUE + team;
  59.                         break;
  60.                 case "red":
  61.                         nick = RED + nick;
  62.                         team = RED + team;
  63.                         break;
  64.                 case "global":
  65.                         nick = LIGHT_GRAY + nick;
  66.                         team = LIGHT_GRAY + team;
  67.                         break;
  68.                 case "ffa":
  69.                         nick = DARK_GRAY + nick;
  70.                         team = DARK_GRAY + team;
  71.                         break;
  72.         }
  73.        
  74.         if(Integer.parseInt(ping) <= 70) {
  75.                 ping = BLUE + ping;
  76.         }
  77.         if(Integer.parseInt(ping) > 70 && Integer.parseInt(ping) <= 150) {
  78.                 ping = GREEN + ping;
  79.         }
  80.         if(Integer.parseInt(ping) > 150 && Integer.parseInt(ping) <= 300) {
  81.                 ping = YELLOW + ping;
  82.         }
  83.         if(Integer.parseInt(ping) > 300) {
  84.                 ping = RED + ping;
  85.         }
  86.         if(Double.parseDouble(ratio) > 1.0 && Double.parseDouble(ratio) <= 1.5) {
  87.                 ratio = BLUE + ratio;
  88.         }
  89.         if(Double.parseDouble(ratio) > 1.5 && Double.parseDouble(ratio) <= 3.0) {
  90.                 ratio = GREEN + ratio;
  91.         }
  92.         if(Double.parseDouble(ratio) > 3.0 && Double.parseDouble(ratio) <= 4.5) {
  93.                 ratio = YELLOW + ratio;
  94.         }
  95.         if(Double.parseDouble(ratio) > 4.5) {
  96.                 ratio = RED + ratio;
  97.         }
  98.         if(Integer.parseInt(racc.replaceAll("%", "")) <= 20) {
  99.                 racc = BLUE + racc;
  100.         }
  101.         if(Integer.parseInt(racc.replaceAll("%", "")) > 20 && Integer.parseInt(racc.replaceAll("%", "")) <= 85) {
  102.                 racc = GREEN + racc;
  103.         }
  104.         if(Integer.parseInt(racc.replaceAll("%", "")) > 85 && Integer.parseInt(racc.replaceAll("%", "")) <= 100) {
  105.                 racc = YELLOW + racc;
  106.         }
  107.         if(Integer.parseInt(racc.replaceAll("%", "")) > 100) {
  108.                 racc = RED + racc;
  109.         }
  110.         if(Integer.parseInt(smacc.replaceAll("%", "")) <= 20) {
  111.                 smacc = BLUE + smacc;
  112.         }
  113.         if(Integer.parseInt(smacc.replaceAll("%", "")) > 20 && Integer.parseInt(smacc.replaceAll("%", "")) <= 85) {
  114.                 smacc = GREEN + smacc;
  115.         }
  116.         if(Integer.parseInt(smacc.replaceAll("%", "")) > 85 && Integer.parseInt(smacc.replaceAll("%", "")) <= 100) {
  117.                 smacc = YELLOW + smacc;
  118.         }
  119.         if(Integer.parseInt(smacc.replaceAll("%", "")) > 100) {
  120.                 smacc = RED + smacc;
  121.         }
  122.         if(Integer.parseInt(shacc.replaceAll("%", "")) <= 20) {
  123.                 shacc = BLUE + shacc;
  124.         }
  125.         if(Integer.parseInt(shacc.replaceAll("%", "")) > 20 && Integer.parseInt(shacc.replaceAll("%", "")) <= 85) {
  126.                 shacc = GREEN + shacc;
  127.         }
  128.         if(Integer.parseInt(shacc.replaceAll("%", "")) > 85 && Integer.parseInt(shacc.replaceAll("%", "")) <= 100) {
  129.                 shacc = YELLOW + shacc;
  130.         }
  131.         if(Integer.parseInt(shacc.replaceAll("%", "")) > 100) {
  132.                 shacc = RED + shacc;
  133.         }
  134.  
  135.         String sep = DARK_GREEN + BOLD + " / " + NORMAL;
  136.         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);
  137.         msg("", chan, mess, writer);
  138.     }
  139. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement