Jump to content
  • 0

Question

Posted (edited)

Hello there once again. I am trying to install this vote reward to my server : http://www.maxcheaters.com/topic/104990-freya-hoptop-zone-vote-reward/

 

 

It seems to have one problem on getVotes() method.

Im speaking for this one :

private int getVotes()
+   {
+       URL url = null;
+       InputStreamReader isr = null;
+       BufferedReader in = null;
+       try
+       {
+           url = new URL(http);
+           isr = new InputStreamReader(url.openStream());
+           in = new BufferedReader(isr);
+           String inputLine;
+           while ((inputLine = in.readLine()) != null)
+           {
+               // for top-zone
+               if (inputLine.contains("<tr><td><div align=\"center\"><b><font style=\"font-size:14px;color:#018BC1;\""))
+               {
+                 return Integer.valueOf(inputLine.split(">")[5].replace("</font", ""));
+               }

+           }
+       }
+       catch (IOException e)
+       {
+           _log.warning("AutoVoteRewardHandler: "+e);
+       }
+       finally
+       {
+           try
+           {
+               in.close();
+           }
+           catch (IOException e)
+           {}
+           try
+           {
+               isr.close();
+           }
+           catch (IOException e)
+           {}
+       }
+       return 0;
+   }

How should i make it to work for TOPZONE? I mean, this is the wrong part according to logic...

if (inputLine.contains("<tr><td><div align=\"center\"><b><font style=\"font-size:14px;color:#018BC1;\""))
{
 return Integer.valueOf(inputLine.split(">")[5].replace("</font", ""));
 }

Thanks in advance.

Edited by Medisept

1 answer to this question

Recommended Posts

  • 0
Posted (edited)
if(inputLine.contains("Votes:")){
              String i = inputLine.replace("<div class=\"rank\"><div class=\"votes2\">Votes:<br>", "");
              i = i.replace("</div></div>", "");
              i = i.trim();
              int o = Integer.parseInt(i);
              return Integer.valueOf(o);
   }

This was answered, use search...

Edited by Stewie

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now


×
×
  • Create New...

AdBlock Extension Detected!

Our website is made possible by displaying online advertisements to our members.

Please disable AdBlock browser extension first, to be able to use our community.

I've Disabled AdBlock