Announcement

Collapse
No announcement yet.

Tradeskill success calculator

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

  • Tradeskill success calculator

    I threw this javascript/HTML form together based on the information posted in this EQTraders FAQ link . I hope it's usefull to some of you.

    Code:
    <html>
    <title>Success Rate Calculator</title>
    <script language="javascript"><!-- //
    function determine() {
      triv  = document.Calc.Trivial.value / 1.0;
        if (triv == 0) document.Calc.Trivial.value = 17;
      skill = document.Calc.Skill.value / 1.0;
      mod = 1.0;
      for (i=0; i < document.Calc.Mods.length; i++) {
        if (document.Calc.Mods[i].selected) {
          mod = document.Calc.Mods[i].value;}}
      effskill = document.Calc.EffSkill.value / 1.0;
      success = document.Calc.Success.value / 1.0;
    
      if (success == 0) {
        if (skill == 0) document.Calc.Skill.value = 21;
        effskill = Math.floor(skill * mod);
        if (effskill >= 252) effskill = 252;
        document.Calc.EffSkill.value = effskill;
        if (triv >= 68) success = Math.ceil(effskill-3/4*triv+51.5);
        if (triv <  68) success = Math.round(effskill-triv+66);
        if (success <= 5)  success = 5;
        if (success >= 95) success = 95;
        document.Calc.Success.value = success; }
      else {
        if (triv >= 68) effskill = Math.round(success + 3/4 * triv - 51.5);
        if (triv < 68)  effskill = success + triv - 66;
        document.Calc.EffSkill.value = effskill;
        skill = Math.ceil(effskill / mod);
        document.Calc.Skill.value = skill;
      } 
    }
    //--!></script>
    </head>
    <body>
    <form name="Calc">
      <table>
        <tr><td>Trivial   : </td>
            <td><input type="text" name="Trivial" size="5" /></td></tr>
        <tr><td>Skill     : </td>
            <td><input type="text" name="Skill"   size="5" /></td></tr>
        <tr><td>Modifiers : </td>
            <td><select name="Mods" width="7">
                  <option value="1.00" SELECTED> None</item>
                  <option value="1.01"> 1% Mod</item>
                  <option value="1.02"> 2% Mod</item>
                  <option value="1.03"> 3% Mod</item>
                  <option value="1.05"> 5% Mod</item>
                  <option value="1.10">10% Mod</item>
                  <option value="1.15">15% Mod</item>
                </select></td></tr>
        <tr><td>Eff. Skill: </td>
            <td><input type="text" name="EffSkill" size="5" /></td></tr>
        <tr><td colspan="2"><hr /></td></tr>
        <tr><td>Success   : </td>
            <td><input type="text" name="Success" size="5" /></td></tr>
        <tr><td colspan="2">
          <input type="button" name="Submit" value="Submit" onclick="determine();" />
          <input type="reset" name="Reset" value="Reset" /></td></tr>
      </table>
    </form>
    </body>
    </html>
    p.s. if you put it in a more usefull form, let me know, please

    Tairne Toirrdhealbhaigh
    41 Druid on Kane Bayle
    243 Baker
    188 Smith
    163 Tailor
    200 Everything else I can be =)
    101 Drinker (hic')
    Happy tradeskiller,
    Taairrne Ecplecticos
    (Level 18 Drakkin Ranger)
    Minds of Power
    Antonius (Kane) Bayle

    200 Fletcher
    (0) Smith (depends on cultural recipes)

  • #2
    I took what you did, and attempted to turn it into a C program.

    I'm not a Windows programmer, so runs in a command shell vs. a nice gui, but I gave it a good menu structure, so the program won't end until you tell it (preventing the window from closing early and you not seeing the calculated result.)

    Source Code is included.

    It is coded in ANSI C, so it should compile on just about any C compiler. My cheapo-open source compiler requires a .cpp extension. You can change it to .c and it compiles just fine (tested that in a Linux box as a secondary compile using .c)

    It can calculate success rate based on trivial, skill, and modifiers, and tries to caluclate trivial based on success rate, skill, and modifiers.

    Let me know what you think.

    ==

    EDIT: 09-25-03

    I feel so silly for putting the wrong file in the .zip file instead of the real source. I've fixed it so that it does contain the proper files.
    Attached Files
    Last edited by llaffer; 09-25-2003, 09:05 AM.


    Comment


    • #3
      Source Code is included.
      Yeah, source code IS included... but not the source for trivial.exe.

      Any chance on getting the correct source posted? Pretty please? :-P

      san
      Gangleri Deaesir <Para Praxis>

      Comment


      • #4
        See my edit in my initial post 2 above ...


        Comment


        • #5
          Ok. Since I'm often bored while at work... I VB-ized trivial.c.

          Should be self-explanatory. But, I did add one more calculation... I like to know what skill level I need to be at in order to have a certain percentage of success. For example, the trivial for the Trueshot Longbow is estimated at 235. I want to know what skill level I need in order to have a 25% chance of success. With no modifiers, that's roughly a skill level of 149.

          The math may be off by a few tenths, but it's probably close enough for most folks. Of course the source file is included and everyone is welcome to hack it up and do what they want with it.

          Tested on a handful of PCs with diffrerent versions of Windoze, found no glaring issues.

          Enjoy.
          San
          Attached Files
          Gangleri Deaesir <Para Praxis>

          Comment


          • #6
            skill needed for given % and triv

            The original html script has that capability:

            clear the form
            Type the trivial in the Trivial field
            Select the modifier % (if applicable)
            Type the desired % in the success field
            Click Submit
            Happy tradeskiller,
            Taairrne Ecplecticos
            (Level 18 Drakkin Ranger)
            Minds of Power
            Antonius (Kane) Bayle

            200 Fletcher
            (0) Smith (depends on cultural recipes)

            Comment


            • #7
              I'm surprised that no one as yet has done the obvious and posted the page on a Web site somewhere.

              I modified the code somewhat and broke it down into two calculators. You can use them here:

              http://kyros.info/Tradeskills/

              Hope you find it useful.

              Edit:
              I also added a number of error checks and assumptions, but I didn't bother to put in checks for things like non-numerical data. Play around with it, give me your feedback. The JavaScript source is here:

              http://kyros.info/Tradeskills/TradeskillCalculator.asp

              Edit 2: Silly Web host won't let me link directly to the file, so I made an ASP file that just spits the JavaScript out.
              Last edited by KyrosKrane; 09-30-2003, 03:47 AM.
              Sir KyrosKrane Sylvanblade
              Master Artisan (300 + GM Trophy in all) of Luclin (Veeshan)
              Master Fisherman (200) and possibly Drunk (2xx + 20%), not sober enough to tell!
              Lightbringer, Redeemer, and Valiant servant of Erollisi Marr

              Comment

              Working...
              X