Visual Basic help menu

Shout-Out

User Tag List

Results 1 to 6 of 6
  1. #1
    B14d3r11's Avatar Sergeant Major
    Reputation
    9
    Join Date
    Jan 2007
    Posts
    179
    Thanks G/R
    0/0
    Trade Feedback
    0 (0%)
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Visual Basic help

    I have a program which works, I was just wondering if there are any ways to make the code "neater" or more optimized. Cause as its running now it has 11500+ Lines of code (Its not even 100% done its like 66%) and over 620,000 Characters.

    Its a random loot generator, kind of like those from D2 or D3
    The longest part isn't defining what loot gets dropped but, what Affixes each piece has.
    If asked I can provide some of my work to show what i've been doing but my problem is, each time i define that it has 1 affix i have to do the generation once, if its 2, the code section is twice as long because im doing the same 1 affix generation but twice for 2 different slots.

    Visual Basic help
  2. #2
    Selvyre's Avatar Active Member
    Reputation
    30
    Join Date
    Jul 2013
    Posts
    104
    Thanks G/R
    0/1
    Trade Feedback
    1 (100%)
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    I had some code like this that I just cleaned up the other day(at least the kind of code I think you are describing). Go through the code and find out what changes per generation im guessing just names and stats or something. Find what you can and make it dynamic. What I mean by that is move that code into a method/function and change the dynamic pieces to parameters of that method/function. Then when the generation happens instead of copy pasting 100 lines of code and changing a few names you can just run the method and put in some parameters based on the occasion. I don't know if this will work since I haven't seen the code yet, but if you need help you can post the code here and I will be more than happy to try and fix it up
    Skype: Argixx
    Coding Experience: Java: 8 years, c++: 4 years, python: lolk, c#: might as well be java, AutoIt: 1 year

  3. #3
    B14d3r11's Avatar Sergeant Major
    Reputation
    9
    Join Date
    Jan 2007
    Posts
    179
    Thanks G/R
    0/0
    Trade Feedback
    0 (0%)
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Originally Posted by Selvyre View Post
    I had some code like this that I just cleaned up the other day(at least the kind of code I think you are describing). Go through the code and find out what changes per generation im guessing just names and stats or something. Find what you can and make it dynamic. What I mean by that is move that code into a method/function and change the dynamic pieces to parameters of that method/function. Then when the generation happens instead of copy pasting 100 lines of code and changing a few names you can just run the method and put in some parameters based on the occasion. I don't know if this will work since I haven't seen the code yet, but if you need help you can post the code here and I will be more than happy to try and fix it up
    Gotta upload it as a .txt file lol its too big for Pastebin & this site.
    http://filebeam.com/ff818720bae07a60892d78d70f0fec55

    As a side note, like you're avatar. I own Pax Jax on LoL
    Last edited by B14d3r11; 07-04-2014 at 10:17 PM.

  4. #4
    abuckau907's Avatar Active Member
    Reputation
    49
    Join Date
    May 2009
    Posts
    225
    Thanks G/R
    0/0
    Trade Feedback
    0 (0%)
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    loops ?

    One loop for each item you will make and another for each of the afflixes?

    This should be like 150 lines of code not 11k : p

    something like..

    For itemNumber As Int32 = 1 to 8 '' (?)
    For afflictNumber As Int32 = 1 to 5 '' (?)

    Select Case itemAf
    Case 1 to 15
    Case 16 to 30
    Case 31 to 50
    ...
    End select
    Next
    Next

    (uploading a pic. of the gui might help too..i'm not quite clear how many items you're generating / stats for each.)
    Some things that can be counted, don't matter. And some things that matter, can't be counted.

  5. #5
    B14d3r11's Avatar Sergeant Major
    Reputation
    9
    Join Date
    Jan 2007
    Posts
    179
    Thanks G/R
    0/0
    Trade Feedback
    0 (0%)
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    There is 8 different affixes, the reason why i had it setup like this is cause if it gets a high enough number it can have 8 affixes at once. So it needs to generate 8 affixes instead of just #8

    Also, its a 2 page Program, where the 1st tab has the variables you can set and the second is just a button with text fields to generate quality and the affixes. There are 8 affixes that CAN be generated but are limited based on quality. And based on what type of item it is there are different sets of affixes (Armor,Weapon,Etc). And each type has around a dozen+ affixes
    Last edited by B14d3r11; 07-29-2014 at 07:42 PM.

  6. #6
    abuckau907's Avatar Active Member
    Reputation
    49
    Join Date
    May 2009
    Posts
    225
    Thanks G/R
    0/0
    Trade Feedback
    0 (0%)
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    mm..I still don't really have a clear picture of what you're trying to do. Anyway, my advice still applies, use loops. probably even nested loops...

    I'm not writing the code for you..and you didn't ask a question, so I'm not sure what to say.

    You can add me on Skype (same username as here) if you need general programming help.
    Some things that can be counted, don't matter. And some things that matter, can't be counted.

Similar Threads

  1. Custom Launcher Help, Using VB (Visual Basics)
    By turbocookie in forum WoW EMU Questions & Requests
    Replies: 0
    Last Post: 03-01-2010, 08:53 AM
  2. Help Visual Basic Urgent
    By supereuropa in forum Programming
    Replies: 2
    Last Post: 09-20-2009, 11:08 AM
  3. Visual Basics [Need help]
    By yunlek in forum World of Warcraft Guides
    Replies: 6
    Last Post: 01-14-2009, 01:11 AM
  4. Help! Visual Basic
    By dUcKyDrEaMeRx3 in forum Programming
    Replies: 2
    Last Post: 12-16-2008, 11:57 AM
  5. [Help] Visual Basic
    By Roger Fang in forum Programming
    Replies: 4
    Last Post: 11-07-2008, 08:25 PM
All times are GMT -5. The time now is 11:54 AM. Powered by vBulletin® Version 4.2.3
Copyright © 2025 vBulletin Solutions, Inc. All rights reserved. User Alert System provided by Advanced User Tagging (Pro) - vBulletin Mods & Addons Copyright © 2025 DragonByte Technologies Ltd.
Google Authenticator verification provided by Two-Factor Authentication (Free) - vBulletin Mods & Addons Copyright © 2025 DragonByte Technologies Ltd.
Digital Point modules: Sphinx-based search