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

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Answer this question...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.



×
×
  • Create New...