Skip to content
View in the app

A better way to browse. Learn more.

Tip.It Forum

A full-screen app on your home screen with push notifications, badges and more.

To install this app on iOS and iPadOS
  1. Tap the Share icon in Safari
  2. Scroll the menu and tap Add to Home Screen.
  3. Tap Add in the top-right corner.
To install this app on Android
  1. Tap the 3-dot menu (⋮) in the top-right corner of the browser.
  2. Tap Add to Home screen or Install app.
  3. Confirm by tapping Install.

Having troubles with RS Calculator

Featured Replies

Hey, I recently got permission to make a calculator for Runescape in my Visual Basic class...

 

 

 

Now I want to be efficient and not have something like

 

 

 

If single.parse(me.uiLevelTextBox.text) = 70 Then



exp=823662

 

 

 

 

 

 

 

But how would you convert this to code in VB? I saw his Javascript code and the Python code, but when I implement something similar in VB it always comes out off

 

 

 

 

 

 

 

Equation:

 

 

 

http://maddogcarter.com/phil/runescape/equation.gif

 

 

 

 

 

 

 

Javascript:

 

 

 

document.close();



document.open();



document.writeln('Begin JavaScript output:');



document.writeln('');







points = 0;



output = 0;



minlevel = 2;		// first level to display



maxlevel = 500;		// last level to display







for (lvl = 1; lvl <= maxlevel; lvl++)



{



points += Math.floor(lvl + 300 * Math.pow(2, lvl / 7.));



if (lvl >= minlevel)



	document.writeln('Level ' + (lvl) + ' - ' + output + ' xp');



output = Math.floor(points / 4);



}







document.writeln('');



document.close();

 

 

 

 

 

 

 

Python:

 

 

 

points = 0



for level in range(1,100):



diff = int(level + 300 * math.pow(2, float(level)/7) )



points += diff



str = "Level %d = %d" % (level + 1, points / 4)



print str

smithie3.jpg

I just posted something! ^_^ to the terrorist...er... kirbybeam.
Hey, I recently got permission to make a calculator for Runescape in my Visual Basic class...

 

 

 

Now I want to be efficient and not have something like

 

 

 

If single.parse(me.uiLevelTextBox.text) = 70 Then



exp=823662

 

 

 

 

 

 

 

But how would you convert this to code in VB? I saw his Javascript code and the Python code, but when I implement something similar in VB it always comes out off

 

 

 

 

 

 

 

Equation:

 

 

 

http://maddogcarter.com/phil/runescape/equation.gif

 

 

 

 

 

 

 

Javascript:

 

 

 

document.close();

 

 

 

document.open();

 

 

 

document.writeln(Begin JavaScript output:);

 

 

 

document.writeln(<PRE>);

 

 

 

 

 

 

 

points = 0;

 

 

 

output = 0;

 

 

 

minlevel = 2; // first level to display

 

 

 

maxlevel = 500; // last level to display

 

 

 

 

 

 

 

for (lvl = 1; lvl <= maxlevel; lvl++)

 

 

 

{

 

 

 

points += Math.floor(lvl + 300 * Math.pow(2, lvl / 7.));

 

 

 

if (lvl >= minlevel)

 

 

 

document.writeln(Level + (lvl) + - + output + xp);

 

 

 

output = Math.floor(points / 4);

 

 

 

}

 

 

 

 

 

 

 

document.writeln(</PRE>);

 

 

 

document.close();

 

 

 

 

 

 

 

Python:

 

 

 

points = 0



for level in range(1,100):



diff = int(level + 300 * math.pow(2, float(level)/7) )



points += diff



str = "Level %d = %d" % (level + 1, points / 4)



print str

 

 

 

You know, it's actually way easier if you just define an Array with all the elements set. But should you really want to use that formula:

 

 

 

 

 

 

 

Dim points = 0



Dim output = 0



Dim minlevel = 2



Dim maxlevel = 150



Dim lvl As Integer



Dim outputStr As String







For lvl = 1 To maxlevel



   points = points + Math.Floor(lvl + 300 * Math.Pow(2, (lvl / 7)))



   If lvl >= minlevel Then



        outputStr = outputStr + vbNewLine + "Level " + lvl + ": " + output + " xp"



   End If



   output = Math.Floor(points / 4)



Next







' Do whatever you want with the outputStr here.



 

 

 

 

 

 

 

 

 

 

 

PS: I used a Firefox extension to colorize your javascript source. However pretty it looks, it seems to have killed the quotes. I'll mail the author to have that corrected :P

  • Author

We haven't gotten into arrays yet :\

 

 

 

 

 

 

 

*skips ahead in book a little*

 

 

 

 

 

 

 

thanks... for some reason I forgot to do level+300 >.<

smithie3.jpg

I just posted something! ^_^ to the terrorist...er... kirbybeam.
  • Author

Ok, I have an array set, but I'm missing a level here :P

 

 

 

I hope to have that fixed soon, but 199 levels is a lot to go through :|

smithie3.jpg

I just posted something! ^_^ to the terrorist...er... kirbybeam.

Create an account or sign in to comment

Important Information

By using this site, you agree to our Terms of Use.

Account

Navigation

Search

Search

Configure browser push notifications

Chrome (Android)
  1. Tap the lock icon next to the address bar.
  2. Tap Permissions → Notifications.
  3. Adjust your preference.
Chrome (Desktop)
  1. Click the padlock icon in the address bar.
  2. Select Site settings.
  3. Find Notifications and adjust your preference.