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.

Visual Basic Functions for RuneScape (not macroing type)

Featured Replies

Public Function Experience(ByVal Lvl As Integer) As Double

   Dim a As Long

   Dim x As Long

   For x = 1 To Lvl - 1

       a = a + Int(x + 300 * (2 ^ (x / 7)))

   Next

   Experience = Int(a / 4)

End Function





Public Function ExperienceToGoalLvl(ByVal YourXP As Double, GoalLvl As Integer) As Double

   ExperienceToGoalLvl = Experience(GoalLvl) - YourXP

End Function





Public Function Level(ByVal XP As Double) As Integer

   Dim A As Integer, i As Long

   If XP >= Experience(99) Then

       Level = 99

       Exit Function

   End If

   For i = 1 To 98

       If XP < Experience(i) Then

           Level = i - 1

           Exit Function

       End If

   Next

End Function





Public Function CombatLvl(atk As Double, def As Double, str As Double, hits As Double, rng As Double, mag As Double, pry As Double) As Double 'Not 100% accurate

   Dim atkstr As Double, defhitspry As Double

   atkstr = atk + str

   defhitspry = ((def + hits) / 4) + (pry / 8)

   If atkstr < mag * 1.5 And rng <= mag Then

       CombatLvl = (mag * 0.4875) + defhitspry

   ElseIf atkstr < rng * 1.5 And rng > mag Then

       CombatLvl = (rng * 0.4875) + defhitspry

   Else

       CombatLvl = (atkstr * 0.325) + defhitspry

   End If

End Function



Private Function CalcGames(XP As Double, GoalLvl As Integer) As Long 'For Pest Control Minigame

   Dim X As Long, Y As Long

   X = XP

   Y = 0

   Do Until X >= Experience(GoalLvl)

       X = X + Int((ExperienceToGoalLvl(X) ^ 2) / 6)

       Y = Y + 1

   Loop

   CalcGames = Y

End Function

hey not everyone can understand that (and me nether)

the bird will always get the early worm

but the mouse will always get the cheese

i am the jedi JOVLA PIAMS of the planet insulin!

i believe that by going through the code quickly it is a program that will gather your combat details from the runescape game and tell you what experience you get from the pest control minigame.... correct me if im wrong please :D

Rsn: Scootenhaben

Combat: 82 ::: Skill Total: 1238

Current Goals: 71/80 Fletching, 51/50 Construction

My understanding of VB is very poor, but that code in no way could be used as macro code.

 

 

 

Although i can't exactly figure the purpose of each, I would very much say it is NOT that....

 

 

 

CoolChris999

Definitely not macro or keylog, it just merely a calculation for RS. I haven't been using Visual Basic very much but here what I can tell. It's just equation, no number entry anywhere.

 

 

 

Public Function Experience(ByVal Lvl As Integer) As Double

   Dim a As Long

   Dim x As Long

   For x = 1 To Lvl - 1

       a = a + Int(x + 300 * (2 ^ (x / 7)))

   Next

   Experience = Int(a / 4)

End Function

 

Calculation for Experience (you enter Lvl). I think what I see wrong with this function is there's no preset variable "a". It going to mess up when you run that function again, right?

 

 

 

 

 


Public Function ExperienceToGoalLvl(ByVal YourXP As Double, GoalLvl As Integer) As Double

   ExperienceToGoalLvl = Experience(GoalLvl) - YourXP

End Function

 

Calculation for how much Experience to Lvl (you enter your xp and goal lvl)

 

 

 


Public Function Level(ByVal XP As Double) As Integer

   Dim A As Integer, i As Long

   If XP >= Experience(99) Then

       Level = 99

       Exit Function

   End If

   For i = 1 To 98

       If XP < Experience(i) Then

           Level = i - 1

           Exit Function

       End If

   Next

End Function

 

Not sure about this, I guess to show level by entering what XP? BTW what's variable "A" for? You didn't use it anywhere in it.

 

 

 


Public Function CombatLvl(atk As Double, def As Double, str As Double, hits As Double, rng As Double, mag As Double, pry As Double) As Double 'Not 100% accurate

   Dim atkstr As Double, defhitspry As Double

   atkstr = atk + str

   defhitspry = ((def + hits) / 4) + (pry / 8)

   If atkstr < mag * 1.5 And rng <= mag Then

       CombatLvl = (mag * 0.4875) + defhitspry

   ElseIf atkstr < rng * 1.5 And rng > mag Then

       CombatLvl = (rng * 0.4875) + defhitspry

   Else

       CombatLvl = (atkstr * 0.325) + defhitspry

   End If

End Function

 

Calculation for combat lvl, you enter all of these ( atk lvl, def lvl, str lvl, health lvl, ranged lvl, magic lvl, prayer lvl )

 

 

 


Private Function CalcGames(XP As Double, GoalLvl As Integer) As Long 'For Pest Control Minigame

   Dim X As Long, Y As Long

   X = XP

   Y = 0

   Do Until X >= Experience(GoalLvl)

       X = X + Int((ExperienceToGoalLvl(X) ^ 2) / 6)

       Y = Y + 1

   Loop

   CalcGames = Y

End Function

 

Out of my scope (I'm F2P).. I guess calculation for Pest Control? you enter Xp and Lvl Goal.

Hacked 10 years old account, permamently quit if Jagex doesn't return items.

 

ventuzz.png

essentially its an xp calculator.

 

 

 

 

 

no worries kids :)

And this is...?

Every path you have trod, through wilderness and through war, has led to this road...

errr... someone wanna hint me on what it's meant to do?

Que?

thhah.gif

I guess you guys didn't read what I say. I'll say it again, but short and simple. It's a calculation equation in Visual Basic code for different parts. Combat level, regular level, experience, experience left to lvl goal, pest control xp. He only posted "equation" in Visual Basic but no program / code to make number entry.

Hacked 10 years old account, permamently quit if Jagex doesn't return items.

 

ventuzz.png

Que?

 

 

 

it's 'qu'est ce-que c'est'

 

 

 

parlez-vous francais monsieur? Moi, je la parle un petit peu.

Que?

 

 

 

it's 'qu'est ce-que c'est'

 

 

 

parlez-vous francais monsieur? Moi, je la parle un petit peu.

 

 

 

sans blague!! mince alors!! je suis un imbecile....

 

 

 

lol, im not flaming you, thats just all i came out with after doing french for 5 years in high school, the last part was what my teacher called me :D

Rsn: Scootenhaben

Combat: 82 ::: Skill Total: 1238

Current Goals: 71/80 Fletching, 51/50 Construction

Que?

 

 

 

it's 'qu'est ce-que c'est'

 

 

 

parlez-vous francais monsieur? Moi, je la parle un petit peu.

 

 

 

sans blague!! mince alors!! je suis un imbecile....

 

 

 

lol, im not flaming you, thats just all i came out with after doing french for 5 years in high school, the last part was what my teacher called me :D

 

 

 

Actually, that's spanish, and it's well written :roll:

 

 

 

Que tios los franceses, se creen que cualquier palabra no inglesa que se paresca a su lengua, es frances mal escrito xP

diosesgif11vg.gif

Pkmario

Porygon 64

Black Charlizard

I made an app for Pest Control Experience, seeing how many points is needed based on the difference of your level and the level's experience that you wanted. Although mine was in Actionscript and therefore slightly less 1337-esque and more readable, of course mine does go along with some button as you can see.

 

 

 

prayer=false;

yourLvl_txt.text=1;

yourExp_txt.text=0

yourGoal_txt.text=2;

button.onRelease=function(){

yourLvl=Number(yourLvl_txt.text);

yourExp=Number(yourExp_txt.text);

yourGoal=Number(yourGoal_txt.text);

formula(yourLvl,yourExp,yourGoal);

}

prayerBTN.onRelease=function(){

if(prayer==false){

	prayer=true;

}

if(prayer==true){

	prayer=false;

}

}

formula=function(level,experience,goal){

//setting the total goal exp to zero

total=0;

//Experience formula for goal experience

for(a=1;a<=goal-1;a++){

	total+=Math.floor(a+300*Math.pow(2,a/7));

}

total=Math.floor(total/4);

//Now find the differene between the goal total and your experience.

difference=total-experience;

//Find the number of points you need to reach your goal

if(prayer==false){

points=Math.ceil(difference/Math.floor(Math.pow(level,2)/6));

}

if(prayer==true){

	points=Math.ceil(difference/Math.floor(Math.pow(level,2)/12));

}

points_txt.text=points;

}

Que quieres Mario, no se enteran... :roll:

magikjandro5mu.gif

 

Thx axeraider for the sig :D

Lol it seems that not too many people understand visual basic. I do (I know I'm not the only one though), and it looks pretty good. BTW is this the right section for this?

RSN: Hellomoron

Cool 8-) .

 

Thanks for explaining ventuzz.

Looking for a signature to use on here ...

its a combat calculator, like the one on tip.it calcs

 

 

 

what os the point of posting it here?

I'm kinda a vb pro.ill pm you when I get home(on break at work browsing the forms on my cell)ill help ya out with anything you need.I have made combat calcs and such for personal use.I can give you the source if you'd like.

prayerBTN.onRelease=function(){ 

  if(prayer==false){ 

     prayer=true; 

  } 

  if(prayer==true){ 

     prayer=false; 

  } 

}

 

 

 

Why not just:

 

 

 

prayerBTN.onRelease=function(){ 

  prayer = !prayer;

}

 

 

 

And also for:

 

if(prayer==false){ 

  points=Math.ceil(difference/Math.floor(Math.pow(level,2)/6)); 

  } 

  if(prayer==true){ 

     points=Math.ceil(difference/Math.floor(Math.pow(level,2)/12)); 

  }

 

 

 

Why not either:

 

 

 

if(prayer){

   points=Math.ceil(difference/Math.floor(Math.pow(level,2)/12));

} else {

   points=Math.ceil(difference/Math.floor(Math.pow(level,2)/6));

}

 

 

 

or:

 

 

 

points = prayer ? 

   Math.ceil(difference/Math.floor(Math.pow(level,2)/12)) :

   Math.ceil(difference/Math.floor(Math.pow(level,2)/6));

 

 

 

(but some people don't like the ternary operator)

[sig too big, don't do it again]

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.