Thread: EverythingRS Voting Installation [ANY BASE]

Page 1 of 25 12311 ... LastLast
Results 1 to 10 of 242
  1. #1 EverythingRS Voting Installation [ANY BASE] 
    Extreme Donator

    Genesis's Avatar
    Join Date
    Sep 2010
    Posts
    3,680
    Thanks given
    1,474
    Thanks received
    1,914
    Rep Power
    4724
    EverythingRS - Free Voting Installation

    EverythingRS is a free API system. Here's a quick tutorial on how to get started with voting.

    Getting started

    • First off download our everythingrs-api.jar from [Only registered and activated users can see links. ] and include it into your project.


    Registration and secret key

    • After adding the everything-rs.jar into your project [Only registered and activated users can see links. ], once the account is created you must register onto the toplist as we use the toplist data in many of our api's.
    • Now go to your dashboard and you should see your secret key


    Your voting subdomain!

    • Go to your main panel at [Only registered and activated users can see links. ] . You should now see your voting URL in the "Your API Pages" section
    • (OPTIONAL) If you wish to embed the script on your website you can add the code below directly onto your website. Change "yoursubdomain" to the one that was provided to you


    Spoiler for (optional) embed onto your website:

    Code:
    <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
    <html xmlns="http://www.w3.org/1999/xhtml">
    
    <head>
        <title>Vote</title>
        <style type="text/css">
            body,
            html {
                margin: 0;
                padding: 0;
                height: 100%;
                overflow: hidden;
            }
            
            #content {
                position: absolute;
                left: 0;
                right: 0;
                bottom: 0;
                top: 0px;
            }
        </style>
    </head>
    
    <body>
        <div id="content">
            <iframe width="100%" height="100%" frameborder="0" src="https://yoursubdomain.everythingrs.com/services/vote/" />
        </div>
    </body>
    
    </html>






    Making the auto vote work with your server

    This part is for PI & Ruse but can easily be changed to work with any server. If you have a request for a specific server let me know and I can add it to the tutorial.
    • Add the code below into Commands.java and you're all done!


    For PI

    Spoiler for PI:

    Code:
    			if (playerCommand.startsWith("reward")) {
    				String[] args = playerCommand.split(" ");
    				if (args.length == 1) {
    					c.sendMessage("Please use [::reward id], [::reward id amount], or [::reward id all].");
    					return;
    				}
    				final String playerName = c.playerName;
    				final String id = args[1];
    				final String amount = args.length == 3 ? args[2] : "1";
    
    				com.everythingrs.vote.Vote.service.execute(new Runnable() {
    					@Override
    					public void run() {
    						try {
    							com.everythingrs.vote.Vote[] reward = com.everythingrs.vote.Vote.reward("secret_key",
    									playerName, id, amount);
    							if (reward[0].message != null) {
    								c.sendMessage(reward[0].message);
    								return;
    							}
    							c.getItems().addItem(reward[0].reward_id, reward[0].give_amount);
    							c.sendMessage(
    									"Thank you for voting! You now have " + reward[0].vote_points + " vote points.");
    						} catch (Exception e) {
    							c.sendMessage("Api Services are currently offline. Please check back shortly");
    							e.printStackTrace();
    						}
    					}
    
    				});
    			}



    For Vencillio

    Spoiler for Vencillio:


    In PlayerCommand.java under

    Code:
    switch (parser.getCommand()) {
    Add

    Code:
    	case "reward":
    		if (!parser.hasNext(1)) {
    			player.send(new SendMessage("Please use [::reward id], [::reward id amount], or [::reward id all]."));
    			return true;
    		}
    		final String playerName = player.getUsername();
    		final String id = parser.nextString();
    		final String rewardAmount = parser.hasNext(1) ? parser.nextString() : "1";
    
    		com.everythingrs.vote.Vote.service.execute(new Runnable() {
    			@Override
    			public void run() {
    				try {
    					com.everythingrs.vote.Vote[] reward = com.everythingrs.vote.Vote.reward("secret_key", playerName, id, rewardAmount);
    					if (reward[0].message != null) {
    						player.send(new SendMessage(reward[0].message));
    						return;
    					}
    					player.getInventory().add(new Item(reward[0].reward_id, reward[0].give_amount));
    					player.send(new SendMessage("Thank you for voting! You now have " + reward[0].vote_points + " vote points."));
    				} catch (Exception e) {
    					player.send(new SendMessage("Api Services are currently offline. Please check back shortly"));
    					e.printStackTrace();
    				}
    			}
    
    		});
    		return true;


    For Ruse

    Spoiler for Ruse:


    In CommandPacketListener.java

    under

    Code:
    private static void playerCommands(final Player player, String[] command, String wholeCommand)  {
    Add

    Code for Ruse


    Code:
    		
    		if (command[0].startsWith("reward")) {
    			if (command.length == 1) {
    				player.getPacketSender().sendMessage("Please use [::reward id], [::reward id amount], or [::reward id all].");
    				return;
    			}
    			final String playerName = player.getUsername();
    			final String id = command[1];
    			final String amount = command.length == 3 ? command[2] : "1";
    
    			com.everythingrs.vote.Vote.service.execute(new Runnable() {
    				@Override
    				public void run() {
    					try {
    						com.everythingrs.vote.Vote[] reward = com.everythingrs.vote.Vote.reward("secret_key",
    								playerName, id, amount);
    						if (reward[0].message != null) {
    							player.getPacketSender().sendMessage(reward[0].message);
    							return;
    						}
    						player.getInventory().add(reward[0].reward_id, reward[0].give_amount);
    						player.getPacketSender().sendMessage("Thank you for voting! You now have " + reward[0].vote_points + " vote points.");
    					} catch (Exception e) {
    						player.getPacketSender().sendMessage("Api Services are currently offline. Please check back shortly");
    						e.printStackTrace();
    					}
    				}
    
    			});
    		}


    For Other Servers

    The script is compatible with any base, if you however need help adding it to a specific one, leave a link to the base and I'll add it to the tutorial.


    Fin

    You are now finished adding the auto vote onto your server. Continue if you want to learn how to add and remove items, and adding support for several toplists.


    Adding and removing items

    • Adding and removing items is incredibly simple. Go to you voting dashboard at [Only registered and activated users can see links. ]
    • Once there go to the "Add new reward" section, and you can proceed to enter the reward information (item id, item name, item points, item amount)
    • To remove a reward just press the red "x" button
    • The voting script goes by a point system. So for each vote on a toplist your players will get a certain amount of points which is set by you.
    • To claim an item and use your points type ::reward x in-game






    Adding several toplists

    When registering onto a new toplist and asked for an optional callback use this exactly how it is.

    Code:
    https://callback.everythingrs.com/process.php?i=
    • Once you enter the callback, go onto EverythingRS and in your AutoVote place your toplist id
    • If you want to only show toplists that you are registered on, check the "Do not display listings as "unregistered" if I have decided not to add it"


    Reply With Quote  
     


  2. #2  
    Registered Member
    Join Date
    May 2017
    Posts
    147
    Thanks given
    57
    Thanks received
    47
    Rep Power
    31
    Finally!

    Thank you for the release
    [Only registered and activated users can see links. ]
    Reply With Quote  
     

  3. Thankful user:


  4. #3  
    Extreme Donator

    Genesis's Avatar
    Join Date
    Sep 2010
    Posts
    3,680
    Thanks given
    1,474
    Thanks received
    1,914
    Rep Power
    4724
    Quote Originally Posted by _Jason View Post
    Finally!

    Thank you for the release
    Ofc if you need help setting it up let me know
    • [Only registered and activated users can see links. ]
    • [Only registered and activated users can see links. ]
    • [Only registered and activated users can see links. ]
    • [Only registered and activated users can see links. ]
    • [Only registered and activated users can see links. ]
    • [Only registered and activated users can see links. ]
    • [Only registered and activated users can see links. ]
    • [Only registered and activated users can see links. ]


    1. [Only registered and activated users can see links. ]


    1. [Only registered and activated users can see links. ]
    2. [Only registered and activated users can see links. ]
    Reply With Quote  
     

  5. Thankful user:


  6. #4  
    Vratha Something Different

    Canada's Avatar
    Join Date
    Apr 2016
    Posts
    342
    Thanks given
    36
    Thanks received
    65
    Rep Power
    91
    Damn finally an upgrade from what we have all been using great job on this bud, very simple & understanding.
    Reply With Quote  
     

  7. #5  
    Registered Member
    hc747's Avatar
    Join Date
    Dec 2013
    Age
    21
    Posts
    1,320
    Thanks given
    2,584
    Thanks received
    576
    Rep Power
    566
    The website implementation looks very sleek and clean; wish the same could be said for server sided implementation.
    Spoiler for sig too large:
    [Only registered and activated users can see links. ]
    [Only registered and activated users can see links. ]
    Reply With Quote  
     

  8. #6  
    Registered Member
    Join Date
    May 2017
    Posts
    91
    Thanks given
    36
    Thanks received
    4
    Rep Power
    33
    Quote Originally Posted by Genesis View Post
    Ofc if you need help setting it up let me know
    getting api error (api services are offline)

    EDIT: ::reward1 gives api error and ::reward 1 says i dont have server registered on ERS but i have :C
    Reply With Quote  
     

  9. #7  
    Extreme Donator

    Genesis's Avatar
    Join Date
    Sep 2010
    Posts
    3,680
    Thanks given
    1,474
    Thanks received
    1,914
    Rep Power
    4724
    Quote Originally Posted by welpp View Post
    getting api error (api services are offline)

    EDIT: ::reward1 gives api error and ::reward 1 says i dont have server registered on ERS but i have :C
    Did you replace your secret key here?

    Code:
    final String request = com.everythingrs.vote.Vote.validate("secret_key", playerName, id);
    • [Only registered and activated users can see links. ]
    • [Only registered and activated users can see links. ]
    • [Only registered and activated users can see links. ]
    • [Only registered and activated users can see links. ]
    • [Only registered and activated users can see links. ]
    • [Only registered and activated users can see links. ]
    • [Only registered and activated users can see links. ]
    • [Only registered and activated users can see links. ]


    1. [Only registered and activated users can see links. ]


    1. [Only registered and activated users can see links. ]
    2. [Only registered and activated users can see links. ]
    Reply With Quote  
     

  10. Thankful user:


  11. #8  
    Registered Member
    Join Date
    May 2016
    Posts
    617
    Thanks given
    252
    Thanks received
    59
    Rep Power
    42
    very good system.
    Reply With Quote  
     

  12. Thankful user:


  13. #9  
    Registered Member
    Join Date
    May 2017
    Posts
    91
    Thanks given
    36
    Thanks received
    4
    Rep Power
    33
    Quote Originally Posted by Genesis View Post
    Did you replace your secret key here?

    Code:
    final String request = com.everythingrs.vote.Vote.validate("secret_key", playerName, id);
    oshieet, how i didnt see it x.x

    I dont know if its bug but :
    you're not able to use these rewards : 6199 (mystery box) and 995 (coins)
    says they are already as reward but actually they are not.
    Reply With Quote  
     

  14. Thankful user:


  15. #10  
    Extreme Donator

    Genesis's Avatar
    Join Date
    Sep 2010
    Posts
    3,680
    Thanks given
    1,474
    Thanks received
    1,914
    Rep Power
    4724
    Quote Originally Posted by welpp View Post
    I dont know if its bug but :
    you're not able to use these rewards : 6199 (mystery box) and 995 (coins)
    says they are already as reward but actually they are not.
    Patched, thanks for that

    Have updated the main thread to include Ruse, the script can be used with any base, if you need help adding it with your specific base please let me know and I'll include that too
    • [Only registered and activated users can see links. ]
    • [Only registered and activated users can see links. ]
    • [Only registered and activated users can see links. ]
    • [Only registered and activated users can see links. ]
    • [Only registered and activated users can see links. ]
    • [Only registered and activated users can see links. ]
    • [Only registered and activated users can see links. ]
    • [Only registered and activated users can see links. ]


    1. [Only registered and activated users can see links. ]


    1. [Only registered and activated users can see links. ]
    2. [Only registered and activated users can see links. ]
    Reply With Quote  
     

  16. Thankful user:


Page 1 of 25 12311 ... LastLast

Thread Information
Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Similar Threads

  1. MotivoteRS Installation Tutorial [ANY BASE]
    By funkE in forum Tutorials
    Replies: 146
    Last Post: 08-18-2018, 07:29 AM
  2. Replies: 58
    Last Post: 12-25-2011, 12:16 AM
  3. NPC Autospawn genorator command - any base
    By Wizzy G in forum Snippets
    Replies: 6
    Last Post: 11-01-2010, 12:56 PM
  4. Replies: 11
    Last Post: 08-25-2009, 12:42 AM
  5. Replies: 13
    Last Post: 12-25-2008, 09:54 PM
Posting Permissions
  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •