Results 1 to 5 of 5

Thread: Levels gained

  1. #1
    Join Date
    Feb 2006
    Location
    Australia
    Posts
    628
    Mentioned
    15 Post(s)
    Quoted
    105 Post(s)

    Default Levels gained

    I made this code a while ago to check if you have gained any levels in combat and how many.
    Code:
                           //By krazy_meerkat
    {^^^^^^^^^^^^^^^         CHECKCHATAREAMSG         ^^^^^^^^^^^^^}
    {Checks the last sentence in the chat box and returns true if any part of that matches
    the string it's looking for}
    {^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^}
    
    Function CheckChatAreaMsg(Text: String) : Boolean;
    Begin
      result:= IsTextInAreaEx(20 , 415, 479, 433, x, y, Text, 40, CharChatChars, False, True, 0, 1, 0);
    End;
    And the main code:
    Code:
    procedure LevelCheck; //by Krazy_Meerkat, how many levels you have gained.
    begin
    If(CheckChatAreaMsg('hitpoints')=true)Then
    begin
    hitpoints:=hitpoints+1
    e:=(random(4))
    if(e=1)then
    SendKeysHuman2('Alright, another hitpoint level!' + chr(13));
    if(e=2)then
    begin
    if(hitpoints=1)then
    nummy:=('')
    if(not(hitpoints=1))then
    nummy:=('s')
    SendKeysHuman2('Sweet I got ' + (Inttostr(hitpoints)) + ' hitpoint level' + nummy + chr(13));
    end;
    if(e=3)then
    SendKeysHuman2('I just hp leveled' + chr(13));
    if(e=4)then
    SendKeysHuman2('Nice' + chr(13));
    wait(random(5000) + random(845));
    end else;
    If(CheckChatMsg('Congratulations')=true)Then
    begin
    other:=other+1
    e:=(random(4))
    if(e=1)then
    SendKeysHuman2('Alright, another ' + speech + ' level!' + chr(13));
    if(e=2)then
    begin
    if(other=1)then
    nummy:=('')
    if(not(other=1))then
    nummy:=('s')
    SendKeysHuman2('Yeah got ' + (Inttostr(other)) + ' ' + speech + ' level' + nummy + chr(13));
    end;
    if(e=3)then
    SendKeysHuman2('About time -.-' + chr(13));
    if(e=4)then
    SendKeysHuman2('Yeah!!' + chr(13));
    wait(random(5000) + random(845));
    end;
    end;
    Use it in a report like this:
    Code:
    if(Combat=1)then
    speech:=('attack')
    if(Combat=2)then
    speech:=('strength')
    if(Combat>2)then
    speech:=('defence')
    AddToReport ('Gained ' + Inttostr(other) + ' ' + speech + ' levels')
    AddToReport ('and ' + Inttostr(hitpoints) + ' hitpoints levels.')
    The variables used:
    speech,nummy,e: String;
    speech is just the attack style, used for the report. Optional
    nummy is a variable used for randomchat about gaining a level, depending on whether you've gained more than one level or not, it becomes an 's'. Optional
    e is just a variable used for random numbers in randomchat. Optional

    hitpoints,other,CharChatChars,Combat: Integer;
    hitpoints, used to count how many hitpoints levels you have gained. Neccessary.
    other, it will count how many attack,str,def levels you have gained (it does not need any input for your attack style). Neccessary.
    CharChatChars is used for randomchat, add a line at the beginning of the main part of your script which says this:
    Code:
    CharChatChars:=  LoadChars2(AppPath  +  'CharsChat2\');
    Optional.
    Combat is just a number which represents your attack style (top to bottom). It is used for the report but can easily be replaced with your own variable. Replacable

    Squig was used, so it should be completely compatable with SRL.

  2. #2
    Join Date
    Feb 2006
    Location
    California-Foster City
    Posts
    742
    Mentioned
    0 Post(s)
    Quoted
    1 Post(s)

    Default

    erm that tex tis loaded in SRL? Err... i thought we had something like that... ill check.
    The Welcoming Party
    Don't be a Fakawi! Get 25 hours of sleep a day!

  3. #3
    Join Date
    Feb 2006
    Location
    Australia
    Posts
    628
    Mentioned
    15 Post(s)
    Quoted
    105 Post(s)

    Default

    Oh ok.. I was just putting in my two cents

  4. #4
    Join Date
    Feb 2006
    Posts
    920
    Mentioned
    0 Post(s)
    Quoted
    0 Post(s)

    Default

    Quote Originally Posted by Krazy_Meerkat
    Oh ok.. I was just putting in my two cents
    very nice of you, I must say..

  5. #5
    Join Date
    Feb 2006
    Posts
    71
    Mentioned
    0 Post(s)
    Quoted
    0 Post(s)

    Default

    this is one i have used that I made that is much simpler


    Program Lvl;
    {.include Srl/SRL.scar}

    Var
    J,T,L:integer;




    Procedure CheckLvl1;
    begin
    J:= GetSkillAmount('mining')
    Writeln('Current Mining Level Is '+inttostr(GetSkillAmount('mining')));
    end;

    Procedure CheckLvl;
    begin
    L:= GetSkillAmount('mining');
    T:=L-J;
    Writeln('Current Mining Level Is '+inttostr(GetSkillAmount('mining')));
    Writeln('You have Gained '+inttostr(T)+' Levels');
    end;

    begin
    SetupSrl;
    checklvl1;
    checklvl;
    end.
    <3 SRL

Thread Information

Users Browsing this Thread

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

Similar Threads

  1. Best Places To train/auto (low levels and High levels)
    By hobohotel33 in forum Skill Guides
    Replies: 32
    Last Post: 03-09-2009, 08:26 PM
  2. Xp gained question..
    By Scarf4ce in forum OSR Help
    Replies: 6
    Last Post: 06-21-2007, 02:11 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
  •