LukaFurlan 0 Posted November 1, 2016 Popular Post Report Share Posted November 1, 2016 Hello, so I created website that offers free highscores hosting service. Creating highscores takes no more then 4 minutes! So let me tell you what to do First go to This is the hidden content, please Sign In or Sign Up and click Create highscores button Then fill registration form and click Sign up This is the hidden content, please Sign In or Sign Up Website will then take you to your newly created dashboard. In dashboard you can add any URL to your highscore page or add different game modes by completing these forms This is the hidden content, please Sign In or Sign Up You can also change your highscores theme (theme examples will be at the end of the thread) I have provided two examples on how to install highscores server sided, I will explain how to install on ruse based servers in this thread For first you have to create new class in com.ruse called HighscoresHandler with these contents: package com.ruse; import java.sql.Connection; import java.sql.DriverManager; import java.sql.ResultSet; import java.sql.SQLException; import com.ruse.model.Skill; import com.ruse.world.entity.impl.player.Player; import com.mysql.jdbc.Statement; public class HighscoresHandler implements Runnable{ /** * Secret key */ final static String secret = ""; /** * Username that is used for mysql connection */ final static String user = ""; private Player player; public HighscoresHandler(Player player) { this.player = player; } /** * Function that handles everything, it inserts or updates * user data in database */ @Override public void run() { /** * Players username */ final String username = player.getUsername(); /** * Represents game mode * If you want to set game modes do this: */ final int gameMode = 0; /** * Represents overall xp */ final long overallXp = player.getSkillManager().getTotalExp(); /** * Represents attack xp */ final long attackXp = player.getSkillManager().getExperience(Skill.ATTACK); /** * Represents defence xp */ final long defenceXp = player.getSkillManager().getExperience(Skill.DEFENCE); /** * Represents strength xp */ final long strengthXp = player.getSkillManager().getExperience(Skill.STRENGTH); /** * Represents constitution xp */ final long constitutionXp = player.getSkillManager().getExperience(Skill.CONSTITUTION); /** * Represents ranged xp */ final long rangedXp = player.getSkillManager().getExperience(Skill.RANGED); /** * Represents prayer xp */ final long prayerXp = player.getSkillManager().getExperience(Skill.PRAYER); /** * Represents magic xp */ final long magicXp = player.getSkillManager().getExperience(Skill.MAGIC); /** * Represents cooking xp */ final long cookingXp = player.getSkillManager().getExperience(Skill.COOKING); /** * Represents woodcutting xp */ final long woodcuttingXp = player.getSkillManager().getExperience(Skill.WOODCUTTING); /** * Represents fletching xp */ final long fletchingXp = player.getSkillManager().getExperience(Skill.FLETCHING); /** * Represents fishing xp */ final long fishingXp = player.getSkillManager().getExperience(Skill.FISHING); /** * Represents firemaking xp */ final long firemakingXp = player.getSkillManager().getExperience(Skill.FIREMAKING); /** * Represents crafting xp */ final long craftingXp = player.getSkillManager().getExperience(Skill.CRAFTING); /** * Represents smithing xp */ final long smithingXp = player.getSkillManager().getExperience(Skill.SMITHING); /** * Represents mining xp */ final long miningXp = player.getSkillManager().getExperience(Skill.MINING); /** * Represents herblore xp */ final long herbloreXp = player.getSkillManager().getExperience(Skill.HERBLORE); /** * Represents agility xp */ final long agilityXp = player.getSkillManager().getExperience(Skill.AGILITY); /** * Represents thieving xp */ final long thievingXp = player.getSkillManager().getExperience(Skill.THIEVING); /** * Represents slayer xp */ final long slayerXp = player.getSkillManager().getExperience(Skill.SLAYER); /** * Represents farming xp */ final long farmingXp = player.getSkillManager().getExperience(Skill.FARMING); /** * Represents runecrafting xp */ final long runecraftingXp = player.getSkillManager().getExperience(Skill.RUNECRAFTING); /** * Represents hunter xp */ final long hunterXp = player.getSkillManager().getExperience(Skill.HUNTER); /** * Represents construction xp */ final long constructionXp = player.getSkillManager().getExperience(Skill.CONSTRUCTION); /** * Creates new instance of jdbc driver * if that driver exists */ try { Class.forName("com.mysql.jdbc.Driver").newInstance(); } catch (InstantiationException | IllegalAccessException | ClassNotFoundException e1) { e1.printStackTrace(); } /** * Sets Connection variable to null */ Connection connection = null; /** * Sets Statement variable to null */ Statement stmt = null; /** * Attempts connecting to database */ try { connection = DriverManager.getConnection("jdbc:mysql://198.211.123.88:3306/admin_scores_data", user, secret); } catch (SQLException e) { e.printStackTrace(); return; } /** * Checks if connection isnt null */ if (connection != null) { try { stmt = (Statement) connection.createStatement(); ResultSet rs = stmt.executeQuery("SELECT COUNT(*) AS count FROM `"+user+"_scores` WHERE username='" +username+ "'"); if(rs.next()) { if(rs.getInt("count") > 0) { stmt.executeUpdate("UPDATE `"+user+"_scores` SET overall_xp = '"+overallXp+"', attack_xp = '"+attackXp+"', defence_xp = '"+defenceXp+"', strength_xp = '"+strengthXp+"', constitution_xp = '"+constitutionXp+"', ranged_xp = '"+rangedXp+"', prayer_xp = '"+prayerXp+"', magic_xp = '"+magicXp+"', cooking_xp = '"+cookingXp+"', woodcutting_xp = '"+woodcuttingXp+"', fletching_xp = '"+fletchingXp+"', fishing_xp = '"+fishingXp+"', firemaking_xp = '"+firemakingXp+"', crafting_xp = '"+craftingXp+"', smithing_xp = '"+smithingXp+"', mining_xp = '"+miningXp+"', herblore_xp = '"+herbloreXp+"', agility_xp = '"+agilityXp+"', thieving_xp = '"+thievingXp+"', slayer_xp = '"+slayerXp+"', farming_xp = '"+farmingXp+"', runecrafting_xp = '"+runecraftingXp+"', hunter_xp = '"+hunterXp+"', construction_xp = '"+constructionXp+"' WHERE username = '"+username+"'"); } else { stmt.executeUpdate("INSERT INTO `"+user+"_scores` (username, mode, overall_xp, attack_xp, defence_xp, strength_xp, constitution_xp, ranged_xp, prayer_xp, magic_xp, cooking_xp, woodcutting_xp, fletching_xp, fishing_xp, firemaking_xp, crafting_xp, smithing_xp, mining_xp, herblore_xp, agility_xp, thieving_xp, slayer_xp, farming_xp, runecrafting_xp, hunter_xp, construction_xp) VALUES ('"+username+"', '"+gameMode+"', '"+overallXp+"', '"+attackXp+"', '"+defenceXp+"', '"+strengthXp+"', '"+constitutionXp+"', '"+rangedXp+"', '"+prayerXp+"', '"+magicXp+"', '"+cookingXp+"', '"+woodcuttingXp+"', '"+fletchingXp+"', '"+fishingXp+"', '"+firemakingXp+"', '"+craftingXp+"', '"+smithingXp+"', '"+miningXp+"', '"+herbloreXp+"', '"+agilityXp+"', '"+thievingXp+"', '"+slayerXp+"', '"+farmingXp+"', '"+runecraftingXp+"', '"+hunterXp+"', '"+constructionXp+"')"); } } stmt.close(); connection.close(); } catch (SQLException e1) { e1.printStackTrace(); } } else { System.out.println("Failed to make connection!"); } return; } } Please fill your secret and user with ones provided on dashboard This is the hidden content, please Sign In or Sign Up After you have done that click save and close this class. Next open up PlayerHandler.java and search for if(player.logout() || exception) { under that add new Thread(new HighscoresHandler(player)).start(); save and close PlayerHandler class and compile! You have now installed highscores server-sided too. Player data will be sent everytime you log out. This is the hidden content, please Sign In or Sign Up This is the hidden content, please Sign In or Sign Up This is the hidden content, please Sign In or Sign Up This is the hidden content, please Sign In or Sign Up If you have any questions, please ask! This is the hidden content, please Sign In or Sign Up 5 Link to comment Share on other sites More sharing options...
acesucks 1,311 Posted November 1, 2016 Report Share Posted November 1, 2016 I like the idea good luck with your project Link to comment Share on other sites More sharing options...
Satdown 4 Posted November 2, 2016 Report Share Posted November 2, 2016 thanks for the tut. Link to comment Share on other sites More sharing options...
l2nn 12 Posted December 1, 2016 Report Share Posted December 1, 2016 wow thanks man Link to comment Share on other sites More sharing options...
OfficialLegend 12 Posted December 2, 2016 Report Share Posted December 2, 2016 I use this and its great! Link to comment Share on other sites More sharing options...
sanfor 1 Posted December 18, 2016 Report Share Posted December 18, 2016 Thanks for it LukaFurlan Link to comment Share on other sites More sharing options...
noorsyed 1 Posted March 29, 2017 Report Share Posted March 29, 2017 nice dude might use it Link to comment Share on other sites More sharing options...
nilsbulk 0 Posted April 9, 2020 Report Share Posted April 9, 2020 Thank you for this, this will be handy for my first release Link to comment Share on other sites More sharing options...
Lolroker 5 Posted May 2, 2020 Report Share Posted May 2, 2020 Wow cool tyty broooo love it Link to comment Share on other sites More sharing options...
SweatyRS 0 Posted May 12, 2020 Report Share Posted May 12, 2020 This looks dope. Hope your keeping active in the rsps community need more people like ya! Link to comment Share on other sites More sharing options...
sedveka 6 Posted October 19, 2021 Report Share Posted October 19, 2021 thank you for this Link to comment Share on other sites More sharing options...
xx501xx 0 Posted January 13, 2022 Report Share Posted January 13, 2022 awesome!!!!!!! Link to comment Share on other sites More sharing options...
wulfite 0 Posted January 19, 2022 Report Share Posted January 19, 2022 thank you Link to comment Share on other sites More sharing options...
Ary3x 0 Posted February 14, 2022 Report Share Posted February 14, 2022 Cool will check out thanks Link to comment Share on other sites More sharing options...
christopherfinn 0 Posted February 19, 2023 Report Share Posted February 19, 2023 thanks! Link to comment Share on other sites More sharing options...
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now