Results 1 to 5 of 5

Thread: if (HPPercent < 786) then

  1. #1
    Join Date
    Dec 2006
    Posts
    185
    Mentioned
    0 Post(s)
    Quoted
    0 Post(s)

    Default if (HPPercent < 786) then

    I need help with this script that I am making. Just having problems with this one procedure


    Simba Code:
    program SecretForNow;

    {$DEFINE SMART}
    {$i SRL\SRL.scar}

      Procedure DeclarePlayers;
      begin
        HowManyPlayers := 1;
        NumberOfPlayers(HowManyPlayers);
        CurrentPlayer := 0;

        with Players[0] do
        begin
          Name        := 'dfgd';
          Pass        := 'sdfsdf';
          Pin         := '';
          BoxRewards  := ['XP','xp','lamp'];
          LampSkill   := 'Runecrafting';
          Active      := True;
        end;
      end;



    procedure SetupChar;

    begin

    SetAngle(True);
    MakeCompass('S');
    Retaliate(True);
    end;


     procedure WalkToPad;

    Begin
    if (HPPercent < 786) then

    begin
      Mouse(651, 37, 1, 1, True);

     End;
      End;



    Begin

        Smart_Server:=35;
        SetupSRL;
         DeclarePlayers
        Repeat
        WalkToPad;
        Until (false)
    End.

    I need it so that if it is under the (#) Hp, itll run to the co-ord's but with this script, It will run to the co-ord's even with full hp. I need help, please

    Thank you.

  2. #2
    Join Date
    Feb 2006
    Location
    Tracy/Davis, California
    Posts
    12,631
    Mentioned
    135 Post(s)
    Quoted
    418 Post(s)

    Default

    That's because HPPercent is a PERCENT.
    So 0-100% are only things that will work, no such thing as 786%?!

    So make it like HpPercent < 25
    That way if you have less than 25% of your HP left, it will run.

  3. #3
    Join Date
    Feb 2011
    Location
    The Future.
    Posts
    5,600
    Mentioned
    396 Post(s)
    Quoted
    1598 Post(s)

    Default

    Umm I don't know if you know this.. but your doing if % < 786.. 786%?! Edit: Ahh got ninja'd -_-

    try this:

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

    Function CheckHP: Boolean;
    begin
       if (HPLevel < 786) then
        //do whatever you want..
    end;
    I am Ggzz..
    Hackintosher

  4. #4
    Join Date
    Nov 2011
    Posts
    1,268
    Mentioned
    17 Post(s)
    Quoted
    217 Post(s)

    Default

    I had trouble with this and HPPercent was returning true for less than 50% when I had 990/990 lp.

    I am using this to check if one needs eating:


    Simba Code:
    if FindColorTolerance(x, y, 255, 724, 27, 745, 44, 5) then
    begin
     //Do this
    end;

    This will detect the red numbers next to the hp counter. These numbers turn red when you are under 25% of your max lp, replace 255 with the color for orange and it will eat between 25% and 50%. This is what I came up to counter HPPercent not working right. The 255 is the color and 5 is the tolerance.
    GLH Tutorial ~ OpenGL Scripting
    http://villavu.com/forum/showthread.php?p=1292150

    GLH Scripts ~ Abyssal Scripts
    http://villavu.com/forum/showthread.php?p=1293187
    Current Projects:
    A) DemiseSlayer Pro (Released/100%).
    B) Demise Power Miner(Released/100%).
    C) Demise Pyramid Plunder(Planning Stage/0%).

  5. #5
    Join Date
    Dec 2006
    Posts
    185
    Mentioned
    0 Post(s)
    Quoted
    0 Post(s)

    Default

    Thanks everyone!

    Haha it works

    I just put 50%, now I have to implement an anti ban incase it dies >.<

    Can someone help me add this into the script? like

    if run percentage is over 50, turn run on? I couldn't find it anywhere.

    Sorry for the triple post but,

    I got the run statement, but how do I make it so that it only clicks the run symbol once?


    Simba Code:
    procedure RunOn;
    begin
      if not (LoggedIn) then
        Exit;
      begin
        if RunEnergy(55) then
        begin
         Mouse(728, 111, 1, 1, True);
        end;
      end;
    end;
    Last edited by Zyt3x; 12-28-2011 at 03:03 AM. Reason: merged 3 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
  •