Poll: Do you like it?

Be advised that this is a public poll: other users can see the choice(s) you selected.

Results 1 to 7 of 7

Thread: GetAmtNeeded

  1. #1
    Join Date
    Apr 2007
    Posts
    2,593
    Mentioned
    0 Post(s)
    Quoted
    0 Post(s)

    Default GetAmtNeeded

    SCAR Code:
    {*******************************************************************************
    function GetAmtNeeded(Skill:string; XPPerItem : integer) : integer;
    By: Elkins121
    Description: Returns amount of items needed to advance to next level.
                 Ex. WriteLn('Amount Needed := ' + GetAmtNeeded('Mining', 65));
    *******************************************************************************}

    function GetAmtNeeded(Skill:string; XPPerItem : integer) : integer;
    var
    SkillLvlCurr, SkillLvlNxt,SkillXPNeeded,AmtNeeded : integer;
    begin
    SkillLvlCurr:=GetXP(Skill);
    ClearDebug;
    SkillLvlNxt:=NextLevelAt(Skill);
    ClearDebug;
    SkillXPNeeded:=SkillLvlNxt - SkillLvlCurr;
    ClearDebug;
    AmtNeeded:=SkillXPNeeded/XPPerItem;
    ClearDebug;
    Result := AmtNeeded;
    end;


    Tell me what you think...

  2. #2
    Join Date
    Apr 2007
    Location
    Australia
    Posts
    4,163
    Mentioned
    9 Post(s)
    Quoted
    19 Post(s)

    Default

    Could be useful if you wanted to make a script that would do an action until the next level up or something

  3. #3
    Join Date
    Dec 2006
    Location
    Banville
    Posts
    3,914
    Mentioned
    12 Post(s)
    Quoted
    98 Post(s)

    Default

    Standards....
    The jealous temper of mankind, ever more disposed to censure than
    to praise the work of others, has constantly made the pursuit of new
    methods and systems no less perilous than the search after unknown
    lands and seas.

  4. #4
    Join Date
    Jun 2007
    Location
    NSW, Australia.
    Posts
    541
    Mentioned
    0 Post(s)
    Quoted
    0 Post(s)

    Default

    Thats a nice idea actually, I like it

    Kinda shorted, untested.

    SCAR Code:
    function ItemsNeededForLevel(Skill : String; XPPerItem : Integer) : Integer;
    begin
      Result := Ceil((NextLevelAt(Skill) - GetXP(Skill)) / XPPerItem);
    end;
    Quote Originally Posted by RAM View Post
    I sam sofa king wee todd did ! ~RAM
    My SRL Army Blog.


  5. #5
    Join Date
    Apr 2007
    Posts
    2,593
    Mentioned
    0 Post(s)
    Quoted
    0 Post(s)

    Default

    Thanks for the shortenedness Pancakes!!

    Quote Originally Posted by Pancakes View Post
    Thats a nice idea actually, I like it

    Kinda shorted, untested.




    SCAR Code:
    function ItemsNeededForLevel(Skill : [COLOR=#000000][B]String[/B][/COLOR]; XPPerItem : Integer) : Integer;
    begin
     Result := Ceil((NextLevelAt(Skill) - GetXP(Skill)) / XPPerItem);
    end;


  6. #6
    Join Date
    Jul 2007
    Location
    Right now? Chair.
    Posts
    8,488
    Mentioned
    3 Post(s)
    Quoted
    12 Post(s)

    Default

    looks good, but what is up with all the ClearDebugs?
    you only need one at the beginning, because when your doing those calculations it doesn't write anything into the debug box.
    RMagician

    I & I know Zion. It is in the spirit, body and mind of every one of us
    RMouse(obj: TMSIObject): boolean;

  7. #7
    Join Date
    Apr 2007
    Posts
    2,593
    Mentioned
    0 Post(s)
    Quoted
    0 Post(s)

    Default

    Just my way of fixing something that isn't broken...

Thread Information

Users Browsing this Thread

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

Posting Permissions

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