[Source] WoW DPS Calculator *Working*

Discussion in 'Programming General' started by Blupig, Apr 19, 2008.

[Source] WoW DPS Calculator *Working*
  1. Unread #1 - Apr 19, 2008 at 11:35 AM
  2. Blupig
    Joined:
    Nov 23, 2006
    Posts:
    7,145
    Referrals:
    16
    Sythe Gold:
    1,609
    Discord Unique ID:
    178533992981594112
    Valentine's Singing Competition Winner Member of the Month Winner MushyMuncher Gohan has AIDS Extreme Homosex World War 3 I'm LAAAAAAAME
    Off Topic Participant

    Blupig BEEF TOILET
    $5 USD Donor

    [Source] WoW DPS Calculator *Working*

    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:

    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!
     
< [Control Source] New Hiscores Control for VB 2008 | Coding >

Users viewing this thread
1 guest


 
 
Adblock breaks this site