Jump to content

Visual Basic Functions for RuneScape (not macroing type)


mdekok3000

Recommended Posts

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

Link to comment
Share on other sites

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

Link to comment
Share on other sites

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

Link to comment
Share on other sites

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

Link to comment
Share on other sites

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

Link to comment
Share on other sites

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

Link to comment
Share on other sites

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;

}

Link to comment
Share on other sites

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

Link to comment
Share on other sites

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.

Link to comment
Share on other sites

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]

Link to comment
Share on other sites

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 account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...

Important Information

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