bumpp
|
so i tried to add everythingrs vote command work on vencillio but for some reason it doesnt work .-.
here is how it looks so far :
Code:case "reward": //Our vote API from EverythingRS.com //By default this will work with Project Insanity sources, but it is very easy to make it //work with anything (Vencillio/RuneSource, Hyperion, Matrix, etc) //Things you will need to change in order to make it work with a different server are: //1. "String playerName = c.playerName" . Change that to whatever your source uses to fetch the username //2. "c.sendMessage" . Change that to how the server sends the player message packet. //3. "c.getItems().addItem" . Change that to how the server handles adding a new item. //And that's it. After tweaking those 3 things, you can get it to work with any source. //If you want me to personally add the code for a specific server, please leave a post on our thread //And we will personally add the snippet for your current server base new Thread() { public void run(String[] command) { try { int id = Integer.parseInt(command[1]); String playerName = player.getUsername(); final String request = com.everythingrs.vote.Vote.validate("not telling u", playerName, id); String[][] errorMessage = { { "error_invalid", "There was an error processing your request." }, { "error_non_existent_server", "This server is not registered at EverythingRS." }, { "error_invalid_reward", "The reward you're trying to claim doesn't exist" }, { "error_non_existant_rewards", "This server does not have any rewards set up yet." }, { "error_non_existant_player", "There is not record of user " + playerName + " make sure to vote first" }, { "not_enough", "You do not have enough vote points to recieve this item" } }; for (String[] message : errorMessage) { if (request.equalsIgnoreCase(message[0])) { player.send(new SendMessage(message[1])); return; } } if (request.startsWith("complete")) { int item = Integer.valueOf(request.split("_")[1]); int amount = Integer.valueOf(request.split("_")[2]); String itemName = request.split("_")[3]; int remainingPoints = Integer.valueOf(request.split("_")[4]); player.getInventory().add(new Item(item, amount)); player.send(new SendMessage("You have recieved the item " + itemName + ". You have " + remainingPoints + " points left.")); } } catch (Exception e) { player.send(new SendMessage("Our API services are currently offline. We are working on bringing it back up")); e.printStackTrace(); } } }.start(); return true;
bumpp
it just doesnt work, nothing happens if i do ::reward 1 , not even error etc .-.
here is PI command, would be awesome if someone can change it to vencillio . will rep and thank.
Code:if (playerCommand.startsWith("reward")) { //Our vote API from EverythingRS.com //By default this will work with Project Insanity sources, but it is very easy to make it //work with anything (Vencillio/RuneSource, Hyperion, Matrix, etc) //Things you will need to change in order to make it work with a different server are: //1. "String playerName = c.playerName" . Change that to whatever your source uses to fetch the username //2. "c.sendMessage" . Change that to how the server sends the player message packet. //3. "c.getItems().addItem" . Change that to how the server handles adding a new item. //And that's it. After tweaking those 3 things, you can get it to work with any source. //If you want me to personally add the code for a specific server, please leave a post on our thread //And we will personally add the snippet for your current server base String[] args = playerCommand.split(" "); new Thread() { public void run() { try { int id = Integer.parseInt(args[1]); String playerName = c.playerName; final String request = com.everythingrs.vote.Vote.validate("secret_key", playerName, id); String[][] errorMessage = { { "error_invalid", "There was an error processing your request." }, { "error_non_existent_server", "This server is not registered at EverythingRS." }, { "error_invalid_reward", "The reward you're trying to claim doesn't exist" }, { "error_non_existant_rewards", "This server does not have any rewards set up yet." }, { "error_non_existant_player", "There is not record of user " + playerName + " make sure to vote first" }, { "not_enough", "You do not have enough vote points to recieve this item" } }; for (String[] message : errorMessage) { if (request.equalsIgnoreCase(message[0])) { c.sendMessage(message[1]); return; } } if (request.startsWith("complete")) { int item = Integer.valueOf(request.split("_")[1]); int amount = Integer.valueOf(request.split("_")[2]); String itemName = request.split("_")[3]; int remainingPoints = Integer.valueOf(request.split("_")[4]); c.getItems().addItem(item, amount); c.sendMessage("You have recieved the item " + itemName + ". You have " + remainingPoints + " points left."); } } catch (Exception e) { c.sendMessage("Our API services are currently offline. We are working on bringing it back up"); e.printStackTrace(); } } }.start(); }
bump, can anyone convert it for me? :C
this is where i get error.... :C
« Previous Thread | Next Thread » |
Thread Information |
Users Browsing this ThreadThere are currently 1 users browsing this thread. (0 members and 1 guests) |