l2topzone.com
l2topzone.com
l2topzone.com
l2topzone.com
l2topzone.com
l2topzone.com
l2topzone.com

Author Topic: vote/reward  (Read 10003 times)

0 Members and 1 Guest are viewing this topic.

OfflineMarkus

  • Newbie
  • *
  • Posts: 10
  • L2topzone Votes: 1
  • Servers reviews: 0
  • Reputation: +0/-0
  • L2topzone.com
    Re: vote/reward
    « Reply #20 on: March 23, 2016, 01:30:56 PM »
    90% here using frozen
    Can you send me the vote reward script you are using with your l2j, or maybe you can send me link where I can see your vote reward script?
    Code: [Select]
    if (_topzone)
    {
    final int topzone_votes = getTopZoneVotes();

    if (topzone_votes != -1)
    {
    LOGGER.info("[AutoVoteReward] Server TOPZONE Votes: " + topzone_votes);
    Announcements.getInstance().gameAnnounceToAll("Vote System - TOPZONE Votes: " + topzone_votes + ".");

    if (topzone_votes != 0 && topzone_votes >= getTopZoneVoteCount() + PowerPakConfig.VOTES_FOR_REWARD)
    {
    _already_rewarded = new ArrayList<>();

    final Collection<L2PcInstance> pls = L2World.getInstance().getAllPlayers();

    Announcements.getInstance().gameAnnounceToAll("Vote System - Great! All Players Rewarded!");

    // L2ItemInstance item;
    for (final L2PcInstance player : pls)
    {
    if (player != null && !player.isInOfflineMode() && player.isOnline() == 1)
    {
    if (player._active_boxes <= 1 || (player._active_boxes > 1 && checkSingleBox(player)))
    {
    final Set<Integer> items = PowerPakConfig.VOTES_REWARDS_LIST.keySet();
    for (final Integer i : items)
    {
    // item = player.getInventory().getItemByItemId(i);

    // TODO: check on maxstack for item
    player.addItem("reward", i, PowerPakConfig.VOTES_REWARDS_LIST.get(i), player, true);
    }
    }
    }
    }
    setTopZoneVoteCount(topzone_votes);
    }

    Announcements.getInstance().gameAnnounceToAll("Vote System - Next TOPZONE Reward On " + (getTopZoneVoteCount() + PowerPakConfig.VOTES_FOR_REWARD) + " Votes.");
    // site web
    Announcements.getInstance().gameAnnounceToAll("Vote On Banners In Website: " + PowerPakConfig.SERVER_WEB_SITE);
    }
    }

    if (_topzone && _hopzone && _l2network && PowerPakConfig.VOTES_SYSYEM_STEP_DELAY > 0)
    {
    try
    {
    Thread.sleep(PowerPakConfig.VOTES_SYSYEM_STEP_DELAY / 2);
    }
    catch (final InterruptedException e)
    {
    if (Config.ENABLE_ALL_EXCEPTIONS)
    e.printStackTrace();
    }
    }


    But that does not include the agent topzone.

    I think that has been changed somewhat, before not you return the votes on the navigator web paste (http://l2topzone.com/totalvotes.php?id=13073  example)) in the url, now Yes. But it still does not return them to the server.
    « Last Edit: March 23, 2016, 01:35:55 PM by Markus »

    l2topzone.com
    l2topzone.com
    l2topzone.com
    l2topzone.com
    l2topzone.com

    OfflineMarkus

    • Newbie
    • *
    • Posts: 10
    • L2topzone Votes: 1
    • Servers reviews: 0
    • Reputation: +0/-0
    • L2topzone.com
      Re: vote/reward
      « Reply #21 on: March 23, 2016, 01:48:33 PM »
      Code: [Select]
      try
          {
               url = new URL(Config.VOTE_SYSTEM_PAGE_TOPZONE);
               URLConnection con = url.openConnection();
               con.addRequestProperty("User-Agent", "L2TopZone");
               isr = new InputStreamReader(con.getInputStream());
               in = new BufferedReader(isr);
               String inputLine;
               
               while ((inputLine = in.readLine()) != null)
               {
                  if (inputLine.contains("<div class=\"rank\"><div class=\"votes2\">Votes:<br>"))
                  {
                     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);
                  }
               }
          }

      Is my code for Topzone.
      « Last Edit: March 23, 2016, 03:33:13 PM by xzone »

      Onlinexzone

      • Read our rules
      • Hero Member
      • *****
      • Posts: 660
      • L2topzone Votes: 52
      • Servers reviews: 159
      • Reputation: +10480/-0
        • l2topzone
      Re: vote/reward
      « Reply #22 on: March 23, 2016, 03:40:08 PM »
      Do you know java to make this part
      Code: [Select]
      while ((inputLine = in.readLine()) != null)
               {
                  if (inputLine.contains("<div class=\"rank\"><div class=\"votes2\">Votes:<br>"))
                  {
                     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);
                  }
               }

      to read this link http://l2topzone.com/tv.php?id=13038 where can be found total votes for your server without any design. Like that will never be a problem to read total votes.
      « Last Edit: March 23, 2016, 03:49:04 PM by xzone »

      OfflineMarkus

      • Newbie
      • *
      • Posts: 10
      • L2topzone Votes: 1
      • Servers reviews: 0
      • Reputation: +0/-0
      • L2topzone.com
        Re: vote/reward
        « Reply #23 on: March 23, 2016, 04:03:45 PM »
        I'll try and look for the way to do it.

        I've already seen as it has been, without any formatting.

        Ok.

        No I wanted to annoy you with my forms, sorry

        You is very friendly

        thx very much

        Sorry for my english

        Onlinexzone

        • Read our rules
        • Hero Member
        • *****
        • Posts: 660
        • L2topzone Votes: 52
        • Servers reviews: 159
        • Reputation: +10480/-0
          • l2topzone
        Re: vote/reward
        « Reply #24 on: March 23, 2016, 04:15:51 PM »
        I'll try and look for the way to do it.

        I've already seen as it has been, without any formatting.

        Ok.

        No I wanted to annoy you with my forms, sorry

        You is very friendly

        thx very much

        Sorry for my english

        Yes we have create today a new link where votes can be seen without any formatting, just pure clean number. Like that will be more easy for all this vote rewards to read this total votes.

        Onlinexzone

        • Read our rules
        • Hero Member
        • *****
        • Posts: 660
        • L2topzone Votes: 52
        • Servers reviews: 159
        • Reputation: +10480/-0
          • l2topzone
        Re: vote/reward
        « Reply #25 on: March 23, 2016, 04:21:52 PM »
        Ok we have find a why to make it work, please replace your code above with this one:
        Code: [Select]
        try
            {
                 url = new URL(Config.VOTE_SYSTEM_PAGE_TOPZONE);
                 URLConnection con = url.openConnection();
                 con.addRequestProperty("User-Agent", "L2TopZone");
                 isr = new InputStreamReader(con.getInputStream());
                 in = new BufferedReader(isr);
                 String inputLine;
                 
                 while ((inputLine = in.readLine()) != null)
                 {
                   
                       return Integer.valueOf(inputLine);
                 
                 }
            }

        And add the link i have provide you above in your config.
        And test it please to see if is working.

        OfflineMarkus

        • Newbie
        • *
        • Posts: 10
        • L2topzone Votes: 1
        • Servers reviews: 0
        • Reputation: +0/-0
        • L2topzone.com
          Re: vote/reward
          « Reply #26 on: March 24, 2016, 06:50:16 AM »
          Hi, I have seen that the system has returned to what it was and i like to contribute to the change of code that already works, at least with the counting system.

          Code: [Select]
          try
          {
          url = new URL(Config.VOTE_SYSTEM_PAGE_TOPZONE);
          URLConnection con = url.openConnection();
          con.addRequestProperty("User-Agent", "L2TopZone");
          isr = new InputStreamReader(con.getInputStream());
          in = new BufferedReader(isr);
          String inputLine;

          while ((inputLine = in.readLine()) != null)
          {
          if (inputLine.contains("<div class=\"votes2\">Votes:<br>"))
          {
          String i = inputLine.replace("<div class=\"votes2\">Votes:<br>", "");
          i = i.replace("</div>", "");
          i = i.trim();
          int o = Integer.parseInt(i);
          return Integer.valueOf(o);
          }
          }
          }



          Have to go this way on my server, I believe that others can change anything.

          What can compare with my previous code, and compare the difference.

          I hope you help

          bye

           

          Sitemap