Some of you may know that I developed a DPS calculator a while back, but it didn't actually work because I totally forgot about the weapon speed. Anyways, here is the source code of the working one, with speed added. This source doesn't have to be for WoW players necessarily, but it can also be used to learn simple calculations in VB6. I'll provide a small explanation of the code as well.
What you need in your project:
>Standard EXE
>4 Textboxes
-Name: txtMinimum
-Name: txtMaximum
-Name: txtSpeed
-Name: txtDPS
>1 Command button
-Name: cmdCalculate
Add this whole code into your project:
Basically, this code calculates the average of both the minimum and maximum damages of the weapon, then divides them by the speed to obtain how much damage the weapon would cause each second.
If you use this in your programs, please give credit!
What you need in your project:
>Standard EXE
>4 Textboxes
-Name: txtMinimum
-Name: txtMaximum
-Name: txtSpeed
-Name: txtDPS
>1 Command button
-Name: cmdCalculate
Add this whole code into your project:
Code:
'Developed by Blupig. Please give credit if you use this in your programs.
Option Explicit
Dim FullNum As Double
Dim RoundNum As Double
Private Sub Calculation()
FullNum = (CDbl(txtMinimum.Text) + CDbl(txtMaximum.Text)) / 2 / CDbl(txtSpeed.Text)
RoundNum = Round(FullNum, 1)
txtDPS.Text = RoundNum
End Sub
Private Sub cmdCalculate_Click()
Calculation
End Sub
Private Sub txtMaximum_Change()
If txtMaximum.Text < txtMinimum.Text Then
MsgBox "Your minimum weapon damage is higher than your maximum damage. Please change it.", vbExclamation, "Error"
txtMaximum.SetFocus
Exit Sub
End If
End Sub
Basically, this code calculates the average of both the minimum and maximum damages of the weapon, then divides them by the speed to obtain how much damage the weapon would cause each second.
If you use this in your programs, please give credit!














