Results 1 to 10 of 10

Thread: Setting Run

  1. #1
    Join Date
    Mar 2007
    Posts
    1,223
    Mentioned
    0 Post(s)
    Quoted
    5 Post(s)

    Setting Run

    I have a simple question which would be appreciated and repped if answered.
    Can someone make a little thing which finds out if run is 100% or not...?
    Thanks.

  2. #2
    Join Date
    Apr 2007
    Location
    Perth, Australia
    Posts
    3,926
    Mentioned
    3 Post(s)
    Quoted
    2 Post(s)

    Default

    SRL has a niftly little function called GetMMLevels which returns the level of the 3 Minimap level displays: HP, Prayer and Energy. So:

    SCAR Code:
    function IsEnergy100: Boolean;
    var
      Colour: string; Level: Integer;
    begin
      Level := GetMMLevels('energy', Colour);
      Result := Level = 100;
    end;

    Something like that should work.

  3. #3
    Join Date
    Mar 2007
    Posts
    1,223
    Mentioned
    0 Post(s)
    Quoted
    5 Post(s)

    Default

    Thanks Rep++

    So if I wanted it to check if the rune is over 75% i do this?
    SCAR Code:
    function IsEnergy100: Boolean;
    var
      Colour: string; Level: Integer;
    begin
      Level := GetMMLevels('energy', Colour);
      if Result := Level > 75 then
     Blah blah?
    end;
    and are you sure that the string is energy and not run? and where did "level" come from did you make that up or did you get it from the actual function..and one last thing can you tell me where you find these "little functions"?

  4. #4
    Join Date
    Jan 2008
    Location
    California, US
    Posts
    2,765
    Mentioned
    0 Post(s)
    Quoted
    0 Post(s)

    Default

    In SRL folder...And to set run you can do SetRun(True) You could also do this to set it if it gets higher

    SCAR Code:
    Procedure AutoSetRun;
    var
      Colour : string; Level: Integer;
    begin
      Level := GetMMLevels('energy', Colour);
     if Level >= 75 then
    SetRun(True);
    end;

  5. #5
    Join Date
    Jun 2007
    Location
    La Mirada, CA
    Posts
    2,484
    Mentioned
    1 Post(s)
    Quoted
    3 Post(s)

    Default

    if you want to simply just check then you dont need the if then statement around the result ... Level is the var stored as a integer for GetMMLevels since that function returns an integer...

    your result is comparing Level to the integer you tell it to...like

    Result := Level = 100; will return true if its 100 and false for anything else and dont use ( := ) that is setting it equal to something ( = ) compares it

    Result := Level > 75; will return true if its greater than but not equal to 75
    Result := Level >= 75; will return true if its greater than or equal to 75

    Result := Level < 75; will do the opposite of ^
    Result := Level <= 75;

    SCAR Code:
    function IsEnergy100: Boolean;
    var
      Colour: string;
      Level: Integer;
    begin
      Level := GetMMLevels('energy', Colour);
      Result := Level > 75;
    end;

    you can find these 'little functions' in the SRL Manual

    open scar -> help -> SRL Manual

    or by simply just knowing what is in SRL and knowing what happens in each update and looking through the files...

    "Failure is the opportunity to begin again more intelligently" (Henry Ford)


  6. #6
    Join Date
    Mar 2007
    Posts
    1,223
    Mentioned
    0 Post(s)
    Quoted
    5 Post(s)

    Default

    Quote Originally Posted by HyperSecret View Post
    if you want to simply just check then you dont need the if then statement around the result ... Level is the var stored as a integer for GetMMLevels since that function returns an integer...

    your result is comparing Level to the integer you tell it to...like

    Result := Level = 100; will return true if its 100 and false for anything else and dont use ( := ) that is setting it equal to something ( = ) compares it

    Result := Level > 75; will return true if its greater than but not equal to 75
    Result := Level >= 75; will return true if its greater than or equal to 75

    Result := Level < 75; will do the opposite of ^
    Result := Level <= 75;

    SCAR Code:
    function IsEnergy100: Boolean;
    var
      Colour: string;
      Level: Integer;
    begin
      Level := GetMMLevels('energy', Colour);
      Result := Level > 75;
    end;

    you can find these 'little functions' in the SRL Manual

    open scar -> help -> SRL Manual

    or by simply just knowing what is in SRL and knowing what happens in each update and looking through the files...
    Thanks a LOt Rep+! And does this mean I dont need SetRun(true) and the "if" and "then"? So if i put this:
    SCAR Code:
    function IsEnergy100: Boolean;
    var
      Colour: string;
      Level: Integer;
    begin
      Level := GetMMLevels('energy', Colour);
      Result := Level > 75;
    end;

    it will set rune to true if it is greater than 75%? If not, what else do I add?

  7. #7
    Join Date
    Jun 2007
    Location
    La Mirada, CA
    Posts
    2,484
    Mentioned
    1 Post(s)
    Quoted
    3 Post(s)

    Default

    SCAR Code:
    function IsEnergy75: Boolean;
    var
      Colour: string;
      Level: Integer;
    begin
      Level := GetMMLevels('energy', Colour);
      Result := Level > 75;
    end;

    {in your code then do}

    if IsEnergy75 then SetRun(True);

    that will check and if the run/energy is greater than 75 it will set run on and if its 75 or less it will just not set run...

    and there are many ways of doing this but that is the simplest right now, if you need more help you can add my msn since ive been replying to you threads a bit...if you have more questions...off to bed right now tho have midterm 2morrow

    "Failure is the opportunity to begin again more intelligently" (Henry Ford)


  8. #8
    Join Date
    Apr 2008
    Location
    Northwest england
    Posts
    1,179
    Mentioned
    0 Post(s)
    Quoted
    0 Post(s)

    Default

    nice zeph , i didnt know that ty
    Blank!

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

    Default

    i cant get any of the special commands to work such as SetRun
    or GetMMLevel

    it says that they are unknown identifies
    please help or show me somewhere that can help cuz ive been at this for hours trying to figure it out on my own

  10. #10
    Join Date
    Jan 2008
    Location
    California, US
    Posts
    2,765
    Mentioned
    0 Post(s)
    Quoted
    0 Post(s)

    Default

    You need to download SRL.

Thread Information

Users Browsing this Thread

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

Similar Threads

  1. Setting up AI, of a sort?
    By Sandstorm in forum OSR Help
    Replies: 4
    Last Post: 12-20-2008, 11:28 PM
  2. Setting TPA help plz!
    By Drakan in forum OSR Help
    Replies: 10
    Last Post: 05-20-2008, 12:07 AM
  3. Need help setting up antirandoms;
    By Shock Norris in forum OSR Help
    Replies: 6
    Last Post: 09-20-2007, 05:55 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
  •