Results 1 to 9 of 9

Thread: Calculate combat

  1. #1
    Join Date
    May 2007
    Location
    baltimore, md
    Posts
    836
    Mentioned
    0 Post(s)
    Quoted
    8 Post(s)

    Default Calculate combat

    Code:
    {********************************************}
    {Function CalculateCombat(A,S,D,H,P,R,M: integer): extended;
     This will calculate your combat level as close as possible. A stands
     for attack, S for strength, D for defence, H for hitpoints, P for
     prayer, R for range, and M for mage.
     By: jhildy
    {********************************************}
    Function CalculateCombat(A,S,D,H,P,R,M: integer): extended;
    var L: array [0..6] of extended;
    var Base,melee,range,mage: extended;
    begin
      L[0]:=D*100;
      L[1]:=H*100;
      if p mod 2 = 0 then
      l[2]:=P*50
      else if p mod 2 <> 0 then
      l[2]:=(p-1)*50;
      Base:=(l[0]+l[1]+l[2])/400;
      l[3]:=A*130;
      l[4]:=s*130;
      if r mod 2 = 0 then
      l[5]:=r*195
      else if r mod 2 <> 0 then
      l[5]:= (((r-1)+(r*2))*65);
      if m mod 2 = 0 then
      l[6]:=m*195
      else if m mod 2 <> 0 then
      l[6]:=(((m-1)+(m*2))*65);
      melee:=(l[3]+l[4])/400;
      range:=l[5]/400;
      mage:=l[6]/400;
      if (melee > range) and (melee > mage) then
      result:=melee+base
      else if (range > melee) and (range > mage) then
      result:=range+base
      else if (mage > melee) and (mage > range) then
      result:=mage+base
    end;
    there you go calculates combat as exact as possible.

  2. #2
    Join Date
    Jun 2007
    Location
    Minnesota
    Posts
    773
    Mentioned
    0 Post(s)
    Quoted
    0 Post(s)

    Default

    Nice! Combat is supposed to be super hard to calculate?

  3. #3
    Join Date
    May 2007
    Location
    baltimore, md
    Posts
    836
    Mentioned
    0 Post(s)
    Quoted
    8 Post(s)

    Default

    it was on the runescape forums how to i just put it in scar terms.

  4. #4
    Join Date
    May 2007
    Location
    NSW, Australia
    Posts
    2,823
    Mentioned
    3 Post(s)
    Quoted
    25 Post(s)

    Default

    Nice man! looks like a bunch of letters an numbers to me though :*(

  5. #5
    Join Date
    Oct 2006
    Location
    Ireland
    Posts
    855
    Mentioned
    0 Post(s)
    Quoted
    0 Post(s)

    Default

    Ooo very nice. Is this the official formula or a player-made one?

  6. #6
    Join Date
    Aug 2007
    Posts
    1,404
    Mentioned
    1 Post(s)
    Quoted
    0 Post(s)

    Default

    I know this is impossible, but still:
    SCAR Code:
    Writeln(FloatToStr(CalculateCombat(1,99,99,99,99,99,99)))
    That writes out 0? Why?

    But a very nice script Thumbs up

    -Knives

  7. #7
    Join Date
    May 2007
    Location
    baltimore, md
    Posts
    836
    Mentioned
    0 Post(s)
    Quoted
    8 Post(s)

    Default

    well idk i havn't figured out the bugs but this is the official formula taken from the runescape forums.

  8. #8
    Join Date
    Oct 2006
    Location
    Texas
    Posts
    1,450
    Mentioned
    1 Post(s)
    Quoted
    1 Post(s)

    Default

    Wow, worked for me. I put in my exact tank ranger stats and it told me his cmb lvl which was correct. Very nice work .

  9. #9
    Join Date
    Mar 2007
    Posts
    674
    Mentioned
    0 Post(s)
    Quoted
    4 Post(s)

    Default

    Very Nice!!

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Similar Threads

  1. calculate the values and draw chart
    By Laimonas171 in forum C#/Visual Basic Help and Tutorials
    Replies: 2
    Last Post: 12-26-2008, 09:12 AM
  2. Calculate Rate?
    By pianoman933 in forum OSR Help
    Replies: 3
    Last Post: 11-30-2008, 09:38 PM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •