Jump to content

cyta5

Members
  • Posts

    61
  • Credits

  • Joined

  • Last visited

  • Feedback

    0%

Posts posted by cyta5

  1.   

    4 hours ago, TGSLineage2 said:
    
    line.split(">")[2].split("<")[0].replace(",","");

     

    9 minutes ago, melron said:

    Like @TGSLineage2 mentioned, you should replace "," with nothing. ""...

    also, you have to add the lineFound inside of the line check. so it should be

    
    while ((line = br.readLine()) != null)
    {
    	if (line.contains("color:#e7ebf2"))
    	{
    		votes = Integer.parseInt(line.split(">")[2].split("<")[0].replace(",",""));
    		lineFound = true;
    	}
    }

     

     

    but does not want and one check ...if the votes is <=999 or >999 ?

    because the votes until the 999 its ok but when goes 1000 and over the website write it 1,000

  2. Hello guys i have one problem with the vote manager at l2network, when the votes are until 999 the vote manager work

    but when goes 1000 and up i got error because the website write the votes 1,000 with a comma.

    maybe someone can help me to work this ?

    ERROR RequestByPassToServer.runImpl : invalid number format
    java.lang.NumberFormatException: For input string: "19,474"

    the code is this 

    public static int getL2NetworkVotes()
    	{
    		int votes = 0;
    		boolean lineFound = false;
    		try
    		{
    			URL url = new URL(Config.VOTES_SITE_L2NETWORK_URL);
    			InputStream is = url.openStream();
    			try (
    				BufferedReader br = new BufferedReader(new InputStreamReader(is)))
    			{
    				String line;
    				while ((line = br.readLine()) != null)
    				{
    					if (line.contains("color:#e7ebf2"))
    						votes = Integer.parseInt(line.split(">")[2].split("<")[0]);
    					lineFound = true;
    				}
    			}
    		}
    		catch (IOException e)
    		{
    			e.printStackTrace();
    			System.out.println("NetWork is offline. We will check reward as it will be online again.");
    		}
    		if (!lineFound)
    			System.out.println("The line wasn't found in Network, check site in case they updated.");
    		return votes;
    	}

     

  3. 23 minutes ago, TGSLineage2 said:

    For total votes count should be
    https://api.l2topzone.com/v1/server_here-type-your-api-key/getServerData
    and something like that is his answer
    {"ok": true,"result": {"totalVotes": "0","serverRank": null}} 

     

    I think you are using a very old code and that link no longer exists on that site

     

    i use the link with my api and i got that messege

    Forbiden

    Please contact l2topzone.com administrator to get access

     

  4. Hello guys i have one vote manager for l2jfrozen and stopped to give reward for topzone maybe someone can tell me what happen and how i can fix it ?

    Topzone Url = https://l2topzone.com/totalvotes.php?id=6150

     

    public static int getTopZoneVotes()
    {
    	int votes = 0;
    	boolean lineFound = false;
    	try
    	{
    		URL url = new URL(Config.VOTES_SITE_TOPZONE_URL);
    		InputStream is = url.openStream();
    		try (
    			BufferedReader br = new BufferedReader(new InputStreamReader(is)))
    		{
    			String line;
    			while ((line = br.readLine()) != null)
    			{
    				if (line.contains("Votes:<br>"))
    				{
    					votes = Integer.parseInt(line.split("<br>")[1].split("<")[0]);
    					lineFound = true;
    				}
    				
    			}
    		}
    	}
    	catch (IOException e)
    	{
    		System.out.println("TOPZONE is offline. We will check reward as it will be online again.");
    		e.printStackTrace();
    	}
    	if (!lineFound)
    		System.out.println("The line wasn't found in TopZone, check site in case they updated.");
    	return votes;
    }

     

  5. Hello guys  i want a little help, i want to make hp & mp potion to dont consume ...  mpId = 728 / hpId = 1539

    with that check mp potion does not consume, the same with hp id.

    final L2ItemInstance item = activeChar.getInventory().getItemByItemId(potion);
    final int itemId = item.getItemId();
    if (itemId != 728)
    {
        activeChar.destroyItem("Consume", item.getObjectId(), 1, null, false);
    }

    but when i used mp and hp potion together it doesn't work and consume them, i'm confused why happened that ?

    final L2ItemInstance item = activeChar.getInventory().getItemByItemId(potion);
    final int itemId = item.getItemId();
    if (itemId != 728 || itemId != 1539)
    {
        activeChar.destroyItem("Consume", item.getObjectId(), 1, null, false);
    }

    and maybe someone can tell me what is this ?

    <set name="itemConsumeIdOT" val="2131"/>
    <set name="itemConsumeCountOT" val="70"/>

     

  6. 3 hours ago, Dragic said:

    If the code is correct and you do right the compile you will not get errors. So if you get error you did something wrong or the code is not correct. If want to find the problem you can decompile the fixed interface and open multisell wnd and take a look!

     

    Anyway if this solved lock it.

     

    8CzrxSg.png

     

     Thanks again lock topic!!!

  7. 3 hours ago, Dragic said:

    Your welcome, dont wait the others to do for you a job that you will spend max 5 minutes to end it. Better try it by your self ill be more useful for you because this will help you to learn more things so if this solved request for lock this topic. 

     

    you are right but i have some errors when i compile it...

  8.  

    16 hours ago, Dragic said:

    You have to learn how to compile/Decompite Interface.u

     

    Use MAXCHEATERS or Google Search or Youtube you will find a guide in 5 seconds.

     

    Better learn to do it by your self this will help you to do more things! 

     

     

    Guide Preview:

     

     

     

    Thats Cool Thanks !!!

×
×
  • Create New...