Results 1 to 10 of 10

Thread: Using prayer pots.

  1. #1
    Join Date
    Dec 2011
    Location
    Kosovo
    Posts
    831
    Mentioned
    0 Post(s)
    Quoted
    6 Post(s)

    Default Using prayer pots.

    I have never done anything with pots. I need something to after my prayer is in red to drink 2 doses of potion. Anyone can help with this?
    Goals:
    Understanding TPAs
    Making Proggy for fighting
    Getting on SRL members
    Get 500 posts

  2. #2
    Join Date
    Feb 2012
    Location
    DON'T PM ME ASKING FOR STUFF
    Posts
    2,170
    Mentioned
    38 Post(s)
    Quoted
    423 Post(s)

    Default

    you could do a DTM and whack the tolerence up? Theres also something to do with the icons around the minimaps I can't remember where i found it. Try looking in simba which had

    'energy' etc

    edit:

    GetMMLevels inside gametab.simba



    Simba Code:
    (*
    GetMMLevels
    ~~~~~~~~~~~

    .. code-block:: pascal

        Function GetMMLevels(LevelType : String;var ColorSign : String): integer;

    Returns the level shown next to the minimap.
    Colorsign returns the color of the text (Green,Yellow,Orange,Red).
    Returns -1 if failed.

    .. note::

        by Raymond / Wizzup / Sabzi / NCDS

    Example:

    .. code-block:: pascal
    *)

    function GetMMLevels(LevelType: string; var ColorSign: string): Integer;
    var
      Colors : TIntegerArray;
      Signs: TStringArray;
      P: TPointArray;
      I: Integer;
      B: TBox;
    begin;
      Result := -1;
      ColorSign := '';
      case LowerCase(Leveltype) of
        'health', 'hp', 'hitpoints', 'constitution': B := IntToBox(719,27,745,43);
        'prayer', 'pray'                           : B := IntToBox(735,66,762,82);
        'run','energy'                             : B := IntToBox(735,103,762,122);
        'summon', 'summoning'                      : B := IntToBox(719,119,745,156);
      else
        begin;
          srl_Warn('GetMMLevels', 'Invalid LevelType: ''' + LevelType + '', warn_AllVersions);
          Exit;
        end;
      end;
      Colors := [65280, 65535, 2070783, 255];
      Signs  := ['Green', 'Yellow', 'Orange', 'Red'];
      for I := 0 to 3 do
      begin
        With B do
          FindColorsTolerance(P, Colors[i], x1, y1, x2, y2, 30);
        if Length(P) < 1 then
          Continue;
        Result := StrToIntDef(GetNumbers(GetTextAtExWrap(B.X1, B.Y1, B.X2, B.Y2, 0, 4, 4, Colors[i], 20, statChars)), -1);
        if (Result > -1) then
        begin
          ColorSign := Signs[i];
          Exit;
        end;
      end;
    end;
    Last edited by xtrapsp; 04-21-2012 at 10:17 AM.

  3. #3
    Join Date
    Dec 2011
    Location
    Kosovo
    Posts
    831
    Mentioned
    0 Post(s)
    Quoted
    6 Post(s)

    Default

    I know how to get the DTMs. But how to use it. Can I do like hp. When hp is red then do stuff. And make for pray if red open inv tab and click 2 times a pot. or click till green?
    Goals:
    Understanding TPAs
    Making Proggy for fighting
    Getting on SRL members
    Get 500 posts

  4. #4
    Join Date
    Feb 2012
    Location
    DON'T PM ME ASKING FOR STUFF
    Posts
    2,170
    Mentioned
    38 Post(s)
    Quoted
    423 Post(s)

    Default

    Quote Originally Posted by begginer View Post
    I know how to get the DTMs. But how to use it. Can I do like hp. When hp is red then do stuff. And make for pray if red open inv tab and click 2 times a pot. or click till green?
    Look above I think that'l work

  5. #5
    Join Date
    Dec 2011
    Location
    Kosovo
    Posts
    831
    Mentioned
    0 Post(s)
    Quoted
    6 Post(s)

    Default

    Looks too complicated to me.
    Goals:
    Understanding TPAs
    Making Proggy for fighting
    Getting on SRL members
    Get 500 posts

  6. #6
    Join Date
    Feb 2012
    Location
    DON'T PM ME ASKING FOR STUFF
    Posts
    2,170
    Mentioned
    38 Post(s)
    Quoted
    423 Post(s)

    Default

    Quote Originally Posted by begginer View Post
    Looks too complicated to me.
    havent personally used it but i think it would be along the lines of

    Simba Code:
    procedure CheckPrayer;
    begin
      Prayer:= GetMMLevels('pray', Color);
      writeln('Prayer: ' + IntToStr(Health) + ', Color: ' + Color);
    end;

    so If Prayer > 20 then

    Something like that I assume
    Last edited by xtrapsp; 04-21-2012 at 10:25 AM.

  7. #7
    Join Date
    Dec 2011
    Location
    Kosovo
    Posts
    831
    Mentioned
    0 Post(s)
    Quoted
    6 Post(s)

    Default

    Yeah, should be like that. If it works like health it would be easier.
    Goals:
    Understanding TPAs
    Making Proggy for fighting
    Getting on SRL members
    Get 500 posts

  8. #8
    Join Date
    Mar 2007
    Posts
    5,125
    Mentioned
    275 Post(s)
    Quoted
    901 Post(s)

    Default

    I used this for my bandit script

    Simba Code:
    Function PrayerLevel: Integer;
    var
      ColourString: String;
    begin
      Result:= GetMMLevels('Prayer', ColourString);
    end;

    Simba Code:
    if (PrayerLevel < 200) then
    begin
    writeln('Prayer level is under 200');
     Pot('prayer');
    end;

    Forum account issues? Please send me a PM

  9. #9
    Join Date
    Feb 2012
    Location
    DON'T PM ME ASKING FOR STUFF
    Posts
    2,170
    Mentioned
    38 Post(s)
    Quoted
    423 Post(s)

    Default

    Quote Originally Posted by [J]ustin View Post
    I used this for my bandit script

    Simba Code:
    Function PrayerLevel: Integer;
    var
      ColourString: String;
    begin
      Result:= GetMMLevels('Prayer', ColourString);
    end;

    Simba Code:
    if (PrayerLevel < 200) then
    begin
    writeln('Prayer level is under 200');
     Pot('prayer');
    end;
    I wasn't far off

  10. #10
    Join Date
    Dec 2011
    Location
    Kosovo
    Posts
    831
    Mentioned
    0 Post(s)
    Quoted
    6 Post(s)

    Default

    I need to declare POT right?
    Goals:
    Understanding TPAs
    Making Proggy for fighting
    Getting on SRL members
    Get 500 posts

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
  •