Results 1 to 7 of 7

Thread: Xp gained question..

  1. #1
    Join Date
    May 2007
    Posts
    54
    Mentioned
    0 Post(s)
    Quoted
    0 Post(s)

    Default Xp gained question..

    Sorry for all the noob questions :P

    I just wanted to know how I could use the treexp function to write how much xp the person has gained by chopping x amount of trees. Heres the function if needed:

    SCAR Code:
    function GetTreeExp(TreeName: string): Extended;
    var
      TreeXP: Extended;
    begin
      case LowerCase(TreeName) of
        'tree': TreeXP := 25;
        'oak': TreeXP := 37.5;
        'willow': TreeXP := 62.5;
        'yew': TreeXP := 175;
      end;
      Result := TreeXP;
    end;

  2. #2
    Join Date
    May 2007
    Location
    Canada
    Posts
    261
    Mentioned
    0 Post(s)
    Quoted
    0 Post(s)

    Default

    Well, if I understand you correctly, you want to calculate how much EXP the person has gained? You could check to see if inv is full, and if it is then count the number of logs that the person has in their inv, and then do the number of logs x EXP.
    On vacation from July 2nd till middle of August


    Account Creator and Tutorial Island Runner (member | public) Errors fixed


    Check out my Complete forms tutorial. It will teach you everything you need to know about forms.

  3. #3
    Join Date
    Jan 2007
    Location
    Kansas
    Posts
    3,760
    Mentioned
    1 Post(s)
    Quoted
    3 Post(s)

    Default

    SCAR Code:
    {.include SRL/SRL/Misc/FindXP.scar}

    That contains the exp for pretty much any action in rs so just do
    SCAR Code:
    ExpGained:=YourItem*InvCount


  4. #4
    Join Date
    Oct 2006
    Posts
    2,297
    Mentioned
    1 Post(s)
    Quoted
    0 Post(s)

    Default

    Xp:= GetTreeExp('oak');//> example
    //you have to make a var from it

    than you count how many logs you've chopped (look at bobarkinator's post)

    and than something like this:
    XpGained:= LogsCount* Xp;

    and you have got your xp that's gained

    OTHER WAY
    or you can just get wc experience in begin of script and at the end, just before logging out, check exp again, like this:

    OldXP:= GetXP('woodcutting);//at begin of script, when just logged in
    NewXp:= GetXP('woodcutting);//at end of script, b4 logging out
    XpGained:= NewXP - OldXP;

    you see?
    [QUOTE=Santa_Clause;277761]I love you too TSN :p[/QUOTE]
    [CENTER][URL="http://www.stats.srl-forums.com/sigs"][IMG]http://www.stats.srl-forums.com/sigs/1324.png[/IMG][/URL][/CENTER]

  5. #5
    Join Date
    May 2007
    Location
    Some where fun.
    Posts
    2,891
    Mentioned
    1 Post(s)
    Quoted
    5 Post(s)

    Default

    Quote Originally Posted by tim46 View Post
    Well, if I understand you correctly, you want to calculate how much EXP the person has gained? You could check to see if inv is full, and if it is then count the number of logs that the person has in their inv, and then do the number of logs x EXP.
    um

    calculator

    how many logs u want to do x xp per log = the xp person has gained.

    edit: didnt no what you ment sorry.

  6. #6
    Join Date
    Apr 2007
    Posts
    3,152
    Mentioned
    3 Post(s)
    Quoted
    1 Post(s)

    Default

    OTHER WAY
    or you can just get wc experience in begin of script and at the end, just before logging out, check exp again, like this:

    OldXP:= GetXP('woodcutting);//at begin of script, when just logged in
    NewXp:= GetXP('woodcutting);//at end of script, b4 logging out
    XpGained:= NewXP - OldXP;

    you see?
    bad way(what happens if u loggout before it checks)
    SCAR Tutorials: The Form Tutorial | Types, Arrays, and Classes
    Programming Projects: NotePad | Tetris | Chess


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

    Default

    Alternatively you could do it like this -

    1. Count the number of logs in your inventory, either by counting dtm/bitmap, or using CountItemsColor, then store it to a variable.
    2. Multiply that number by the exp gained by chopping one log, either just the number or the function you posted. Store this number to a variable.

    So say I wanted to count then calculate the experience gained from mining addy ores. I would do this:

    SCAR Code:
    ExperienceGained := ExperienceGained + ((CountItemsColor('inv', AddyColour, 5) * 95)

    Experience gained is the variable, declared as an integer. AddyColour is a const I made, just of the colour of the addy ore in the inventory. 5 is the colour tol, and 95 is the amount of exp gained from one. If you want the total amount of exp gained, you need to add the variable onto itself each time, like I have done. Otherwise it will overwrite itself.

    Hope I helped, if you have any questions ask

Thread Information

Users Browsing this Thread

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

Similar Threads

  1. just a question
    By Wolygon in forum OSR Help
    Replies: 4
    Last Post: 07-18-2008, 02:20 PM
  2. question: two actually
    By soupnatizzle in forum OSR Help
    Replies: 1
    Last Post: 04-17-2007, 03:15 AM
  3. Macro x 10 money/skills gained via scar Multiplied
    By -=uber*1337=- in forum News and General
    Replies: 10
    Last Post: 04-13-2007, 05:25 AM

Posting Permissions

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