Dismiss Notice
Wynncraft, the Minecraft MMORPG. Play it now on your Minecraft client at (IP): play.wynncraft.com. No mods required! Click here for more info...

Tool Python Dps Calculator

Discussion in 'Your Work' started by --, Oct 2, 2016.

Tags:
Thread Status:
Not open for further replies.
  1. --

    -- The world's most popular Minecraft server

    Messages:
    1,401
    Likes Received:
    1,674
    Trophy Points:
    136
    'God DAMN!', I hear you shout. 'Why is there no SIMPLE, CONVENIENT, EASY-TO-USE, COMMAND-LINE-BASED DAMAGE-PER-SECOND CALCULATOR?', you continue, sobbing and tearing your hair out in turns.

    Well, worry no more, because soon you'll be calculating so much damage per second that you WON'T WANT TO STOP! Run this SIMPLE PYTHON PROGRAM (clicky clicky) and it will SOLVE YOUR PROBLEMS! Hell, maybe even BRUSH YOUR TEETH for you! IT WORKS, FOLKS! And all for the price of ABSOLUTELY FUCKING FREE! All you need is a COMPUTER, INTERNET, and a KEYBOARD!

    'How do I use this ANTIQUATED, counter-intuitively OBSOLETE PIECE OF SHIT?', I hear you ask. IT IS EASY!
    • Download the FILE before it DOWNLOADS YOU
    • Save it as a PYTHON FILE in a directory of YOUR CHOOSING
    • Navigate to that directory of YOUR CHOOSING in the COMMAND PROMPT
    • RUN IT AND CALCULATE DAMAGE-PER-SECOND UNTIL IT BEGINS TO CRY
    THERE HAS NEVER BEEN A BETTER TIME TO INVEST IN THE WORLD OF DAMAGE-PER-SECOND THAN TODAY!

    Edit: obviously you need Python 3.x and the requests library.
    Edit 2: of course it's not a virus, which you would know if you cared to view the source code at the link above before making unintelligent, uninformed comments
    Edit 3: updated with correct attack speed values, courtesy of @StarDraco123
     
    Last edited: Oct 2, 2016
  2. Jared2183

    Jared2183 Well-Known Adventurer VIP

    Messages:
    2,605
    Likes Received:
    559
    Trophy Points:
    67
    Guild:
    Minecraft:
    um....I feel like this is a virus
     
  3. --

    -- The world's most popular Minecraft server

    Messages:
    1,401
    Likes Received:
    1,674
    Trophy Points:
    136
    OK
     
  4. RicochetfromtheD

    RicochetfromtheD 赵二

    Messages:
    1,039
    Likes Received:
    1,111
    Trophy Points:
    128
    Minecraft:
    Just give us the goddamn algorithm
     
  5. pretzellover33

    pretzellover33 Eater of pretzul- ahem, Pretzels HERO

    Messages:
    547
    Likes Received:
    419
    Trophy Points:
    70
    Minecraft:
    how...

    average damage multiplied by attacks per second equals dps
     
  6. Jared2183

    Jared2183 Well-Known Adventurer VIP

    Messages:
    2,605
    Likes Received:
    559
    Trophy Points:
    67
    Guild:
    Minecraft:
     
  7. pretzellover33

    pretzellover33 Eater of pretzul- ahem, Pretzels HERO

    Messages:
    547
    Likes Received:
    419
    Trophy Points:
    70
    Minecraft:
    There is no download actually, you just copy the code and put it in your own python thingamabob.
     
  8. Jared2183

    Jared2183 Well-Known Adventurer VIP

    Messages:
    2,605
    Likes Received:
    559
    Trophy Points:
    67
    Guild:
    Minecraft:
    how do I download it? it shows me a page full of code
     
  9. RicochetfromtheD

    RicochetfromtheD 赵二

    Messages:
    1,039
    Likes Received:
    1,111
    Trophy Points:
    128
    Minecraft:
    tank you
     
  10. --

    -- The world's most popular Minecraft server

    Messages:
    1,401
    Likes Received:
    1,674
    Trophy Points:
    136
    http://pastebin.com/GSnQx9BU

    Examine this source code very carefully, then tell me again that it's a virus
    ________________________________
    Select all -> save as .py file
     
  11. Jared2183

    Jared2183 Well-Known Adventurer VIP

    Messages:
    2,605
    Likes Received:
    559
    Trophy Points:
    67
    Guild:
    Minecraft:
    wait what if I don't have python....
     
  12. RicochetfromtheD

    RicochetfromtheD 赵二

    Messages:
    1,039
    Likes Received:
    1,111
    Trophy Points:
    128
    Minecraft:
    Guys I have a better algorithm:

    def dps(aps,damage):
    print aps*damage
     
  13. --

    -- The world's most popular Minecraft server

    Messages:
    1,401
    Likes Received:
    1,674
    Trophy Points:
    136
    You need Python 3 and the requests library

    Ye but does yours fetch the required variables from the Wynncraft API?
     
  14. Jared2183

    Jared2183 Well-Known Adventurer VIP

    Messages:
    2,605
    Likes Received:
    559
    Trophy Points:
    67
    Guild:
    Minecraft:
    oh youre a coder? ;o
     
  15. RicochetfromtheD

    RicochetfromtheD 赵二

    Messages:
    1,039
    Likes Received:
    1,111
    Trophy Points:
    128
    Minecraft:
    No...
    I give up
    ________________________________
    I wouldn't call myself that.
     
  16. ploo

    ploo Famous Adventurer VIP+

    Messages:
    913
    Likes Received:
    3,880
    Trophy Points:
    157
    Minecraft:
    ThomAnn100 and RicochetfromtheD like this.
  17. --

    -- The world's most popular Minecraft server

    Messages:
    1,401
    Likes Received:
    1,674
    Trophy Points:
    136
    I'm going to post the entire source code of the program. Read it carefully (I'm assuming you possess basic literacy skills), and tell me if it's a virus.

    # Wynncraft DPS calculator

    import requests, json

    print('\n:: ------------------- WYNNCRAFT DPS CALCULATOR ------------------- ::\n:: DPS values for super fast and super slow weapons are approximate ::\n')

    # Get item name as string
    item_name = str(input('Item name : '))

    payload = {'action': 'itemDB', 'search': item_name}

    # Fetch JSON with parameters itemDB and item name
    r = requests.get('https://api.wynncraft.com/public_api.php', params = payload)

    # Get JSON data
    json_data = r.json()

    # Get specific values
    official_name = json_data['items'][0]['name']
    lore = str(json_data['items'][0]['addedLore'])
    attack_speed = json_data['items'][0]['attackSpeed']
    damage = json_data['items'][0]['damage']

    # Map weapon attack speed strings to int values
    weapon_time_dict = {
    'SUPER_FAST': 4,
    'VERY_FAST': 2.5,
    'FAST': 1.9,
    'NORMAL': 1.7,
    'SLOW': 1.3,
    'VERY_SLOW': 0.8,
    'SUPER_SLOW': 0.4
    }

    # Map uppercase attack speed strings to more readable strings
    weapon_lower_dict = {
    'SUPER_FAST': 'Super fast',
    'VERY_FAST': 'Very fast',
    'FAST': 'Fast',
    'NORMAL': 'Normal',
    'SLOW': 'Slow',
    'VERY_SLOW': 'Very slow',
    'SUPER_SLOW': 'Super slow'
    }

    # Get average weapon damage
    weapon_damages = damage.split('-')
    weapon_approx_damage = (int(weapon_damages[1]) + int(weapon_damages[0])) / 2

    # Calculate dps
    dps = weapon_approx_damage * weapon_time_dict.get(attack_speed)

    # Print everything
    print('Lore : ' + lore)
    print('Attack speed: ' + weapon_lower_dict.get(attack_speed))
    print('Damage : ' + damage)
    print('Avg damage : ' + '%.2f' % weapon_approx_damage)
    print('\n:: -------------- ::')
    print(':: DPS : ' + '%.2f' % dps + ' ::')
    print(':: -------------- ::')
     
    Stag2001 likes this.
  18. StarDraco123

    StarDraco123 (・8・) VIP+

    Messages:
    871
    Likes Received:
    482
    Trophy Points:
    95
    Guild:
    Minecraft:
    Funnily enough that info is wrong, selvut posted the actual speeds somewhere I have a pic of it on my phone but meh (unless it changed inbetween when selvut said it and now I'm pretty sure his values are more accurate)
    Edit: from selvuts post
    Super slow is 0.5
    Very slow is 0.7
    Slow is 1.3
    Normal is 2.0
    Fast is 2.6
    Very fast is 3.3
    Super fast is 4.0
     
    Last edited: Oct 2, 2016
    ThomAnn100 and Stag2001 like this.
  19. ploo

    ploo Famous Adventurer VIP+

    Messages:
    913
    Likes Received:
    3,880
    Trophy Points:
    157
    Minecraft:
    Ohh ok ty
    ________________________________
    11/10 virus... (sarcasm is real)
     
  20. RicochetfromtheD

    RicochetfromtheD 赵二

    Messages:
    1,039
    Likes Received:
    1,111
    Trophy Points:
    128
    Minecraft:
    quick question: Spell damage follow the same multiplier right?
     
Thread Status:
Not open for further replies.