Jump to content

Apaec's Splashing Calculator


Apaec

Recommended Posts

Hey guys,

 

As you may or may not know, I recently got back into playing legit. Yep, no botting - however it's sometimes hard to keep my patience! The closest i've gotten to botting is splashing xD. Anyway, I needed some way of finding out how many major runes I would need for my goal, so I wrote a quick program in java to calculate the number of splashes you would need to get from your current exp to your target level goal (as well as the exp between your current experience and your target level). Heres a quick screenshot or two:

 

MLDYi4t.png

 

Source:

import java.awt.EventQueue;

import javax.swing.JFrame;
import javax.swing.JPanel;
import javax.swing.border.EmptyBorder;
import javax.swing.JSpinner;
import javax.swing.SpinnerNumberModel;
import javax.swing.JLabel;
import javax.swing.JButton;
import javax.swing.SwingUtilities;
import javax.swing.UIManager;

import java.awt.event.ActionListener;
import java.awt.event.ActionEvent;
import java.text.NumberFormat;

public class Gui extends JFrame {

	private static final long serialVersionUID = 1L;
	private JPanel contentPane;
	private static final int[] XP = { 0, 83, 174, 276, 388, 512, 650, 801, 969,
			1154, 1358, 1584, 1833, 2107, 2411, 2746, 3115, 3523, 3973, 4470,
			5018, 5624, 6291, 7028, 7842, 8740, 9730, 10824, 12031, 13363,
			14833, 16456, 18247, 20224, 22406, 24815, 27473, 30408, 33648,
			37224, 41171, 45529, 50339, 55649, 61512, 67983, 75127, 83014,
			91721, 101333, 111945, 123660, 136594, 150872, 166636, 184040,
			203254, 224466, 247886, 273742, 302288, 333804, 368599, 407015,
			449428, 496254, 547953, 605032, 668051, 737627, 814445, 899257,
			992895, 1096278, 1210421, 1336443, 1475581, 1629200, 1798808,
			1986068, 2192818, 2421087, 2673114, 2951373, 3258594, 3597792,
			3972294, 4385776, 4842295, 5346332, 5902831, 6517253, 7195629,
			7944614, 8771558, 9684577, 10692629, 11805606, 13034431, 14391160 };

	public static void main(String[] args) {
		EventQueue.invokeLater(new Runnable() {
			public void run() {
				try {
					Gui frame = new Gui();
					frame.setVisible(true);
				} catch (Exception e) {
					e.printStackTrace();
				}
			}
		});
	}

	public Gui() {
		setTitle("Splashing Calculator By Apaec");
		setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
		setBounds(100, 100, 323, 220);
		contentPane = new JPanel();
		contentPane.setBorder(new EmptyBorder(5, 5, 5, 5));
		contentPane.setLayout(null);
		setContentPane(contentPane);
		try {
			UIManager
					.setLookAndFeel("com.sun.java.swing.plaf.windows.WindowsLookAndFeel");
			SwingUtilities.updateComponentTreeUI(this);
		} catch (Exception e) {
		}

		final JSpinner currentXp = new JSpinner();
		currentXp.setModel(new SpinnerNumberModel(new Integer(0),
				new Integer(0), null, new Integer(1)));
		currentXp.setBounds(140, 11, 160, 27);
		contentPane.add(currentXp);

		JLabel lblCurrentExp = new JLabel("Current Exp:");
		lblCurrentExp.setBounds(10, 11, 120, 27);
		contentPane.add(lblCurrentExp);

		JLabel lblTargetLevel = new JLabel("Target Level:");
		lblTargetLevel.setBounds(10, 42, 120, 27);
		contentPane.add(lblTargetLevel);

		final JSpinner TargetLvl = new JSpinner();
		TargetLvl.setModel(new SpinnerNumberModel(2, 2, 99, 1));
		TargetLvl.setBounds(140, 42, 160, 27);
		contentPane.add(TargetLvl);

		final JSpinner ExpPerSplash = new JSpinner();
		ExpPerSplash.setModel(new SpinnerNumberModel(new Double(6), new Double(
				0), null, new Double(1)));
		ExpPerSplash.setBounds(140, 73, 160, 27);
		contentPane.add(ExpPerSplash);

		JLabel lblExpPerSplash = new JLabel("Exp Per Splash:");
		lblExpPerSplash.setBounds(10, 73, 120, 27);
		contentPane.add(lblExpPerSplash);

		final JLabel Splashes = new JLabel();
		Splashes.setText("Splashes Required:");
		Splashes.setBounds(10, 155, 290, 17);
		contentPane.add(Splashes);

		final JLabel lblRemainingExp = new JLabel();
		lblRemainingExp.setText("Remaining Exp:");
		lblRemainingExp.setBounds(10, 136, 290, 17);
		contentPane.add(lblRemainingExp);

		JButton btnCalculate = new JButton("Calculate");
		btnCalculate.addActionListener(new ActionListener() {
			public void actionPerformed(ActionEvent arg0) {
				Splashes.setText("Splashes Required: "
						+ NumberFormat.getIntegerInstance().format(
								(int) Math.ceil((XP[(Integer) TargetLvl
										.getValue() - 1] - (Integer) currentXp
										.getValue())
										/ (double) ExpPerSplash.getValue())));
				lblRemainingExp.setText("Remaining Exp: "
						+ NumberFormat.getIntegerInstance().format(
								XP[(Integer) TargetLvl.getValue() - 1]
										- (Integer) currentXp.getValue()));
			}
		});
		btnCalculate.setBounds(10, 104, 290, 27);
		contentPane.add(btnCalculate);
	}
}
 

(I used windowbuilder (eclipse plugin) so forgive the formatting)

 

Anyway, here's the download link: https://mega.co.nz/#!zFYiQRgC!5rEDa66t7GuZOjpfQYUU1Oli_LnXPHKMwsUNBxGFnnM

 

Enjoy & hope it helps smile.png

 

~Apaec

Edited by Apaec
Link to comment
Share on other sites

Or you could just use a calculator...

 

Meh, it's kinda effort to find out the exp of your target level, subtract your exp from that to calculate the remaining exp, and then divide by your exp per splash to get an unformatted, unrounded number. But essentially, yes, you could just use a calculator.

Link to comment
Share on other sites

Meh, it's kinda effort to find out the exp of your target level, subtract your exp from that to calculate the remaining exp, and then divide by your exp per splash to get an unformatted, unrounded number. But essentially, yes, you could just use a calculator.

 

More effort then writing a whole script to do a 3 and a half minute process...? But it's cool I guess. gj.

Link to comment
Share on other sites

  • 2 weeks later...
  • 5 years later...

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...