Page 5 of 7 FirstFirst ... 34567 LastLast
Results 101 to 125 of 169

Thread: Projectrs06 SRL Include

  1. #101
    Join Date
    Nov 2012
    Posts
    2,351
    Mentioned
    55 Post(s)
    Quoted
    603 Post(s)

    Default

    Quote Originally Posted by rjj95 View Post
    I got these for you incase your still doing random events dev:

    I am also working on a function that will count colors above your head (count the red colors) and calculate your HP accordingly
    I'm still working on randoms yea gj, was trying to recompile smart for PS but I gave up


    Programming is like trying keep a wall of shifting sand up, you fix one thing but somewhere else starts crumbling

  2. #102
    Join Date
    Sep 2010
    Posts
    5,762
    Mentioned
    136 Post(s)
    Quoted
    2739 Post(s)

    Default

    Quote Originally Posted by DannyRS View Post
    I'm still working on randoms yea gj, was trying to recompile smart for PS but I gave up
    I looked at the source and couldn't understand it at all... maybe because I don't have much java experience :s

    Also, I can't use my private private server maps were from like 2007, looked different

  3. #103
    Join Date
    Jan 2013
    Posts
    12
    Mentioned
    0 Post(s)
    Quoted
    8 Post(s)

    Default

    Good job boys.

  4. #104
    Join Date
    Sep 2010
    Posts
    5,762
    Mentioned
    136 Post(s)
    Quoted
    2739 Post(s)

    Default

    Ok so far I got program to do it I just got to transform into a function/procedure:

    Simba Code:
    Program testP06;
    {$I SRL/SRL.Simba}
    {$I SRL/SRL/Misc/Debug.Simba}
    {$I P06Include/P06Include.Simba}
    Const
      YourHealth = 10;
    var
      GreenP,RedP,MyHP:Integer;
      Health,HealthPercent,AllP,HpPercentMissing,Missing_Health:Extended;
      PercentHP:Extended;
    Procedure ShowHealth;
    Begin
      if (RedP < 1) or (GreenP < 1) Then
      Begin
        Exit;
      End;
      AllP := (RedP + GreenP);
      HpPercentMissing := (RedP/AllP);
      Missing_Health := (MyHP*HpPercentMissing);
      Health := ((MyHp) - (Missing_Health));
      PercentHP := ((RedP/AllP)*100);
      Writeln('I have about ' + ToStr(Health)+ ' HP left');
      Writeln('Percent:' + ToStr(PercentHP));
    End;
    Procedure WriteColors;
    Begin
      Writeln('Green:' + IntToStr(GreenP));
      Writeln('Red:' + IntToStr(RedP));
    End;
    Procedure CountColors;
    Begin
      GreenP := CountColorTolerance(65280,245,140,281,154,3);
      RedP := CountColorTolerance(255,245,140,281,154,3);
    End;
    Begin
      SetupP06Include;
      ActivateClient;
      Wait(500);
      P06_MakeCompassNorth;
      P06_MakeCameraAngleHigh;
      MyHP := YourHealth;
      CountColors;
      WriteColors;
      ShowHealth;
    End.

    Edit- Not making all those functions, they can be built in easily with the script, but feel free to add above one

  5. #105
    Join Date
    Dec 2011
    Location
    U.S.A.
    Posts
    635
    Mentioned
    5 Post(s)
    Quoted
    249 Post(s)

    Default

    There is now SPS for '06 Scape?

  6. #106
    Join Date
    Nov 2012
    Posts
    2,351
    Mentioned
    55 Post(s)
    Quoted
    603 Post(s)

    Default

    Quote Originally Posted by Sawyer View Post
    There is now SPS for '06 Scape?
    Yup, I edited it to work for a PS

    Try it out, more of a BETA test atm, but I can't see too much wrong with it, will add a faster flag detection method later so it can travel paths faster and more efficiently
    Last edited by DannyRS; 02-17-2013 at 09:20 AM.


    Programming is like trying keep a wall of shifting sand up, you fix one thing but somewhere else starts crumbling

  7. #107
    Join Date
    Dec 2011
    Location
    U.S.A.
    Posts
    635
    Mentioned
    5 Post(s)
    Quoted
    249 Post(s)

    Default

    Awesome! Maybe if jagex does bring back 07' Scape, this could possibly be used? Or would the normal SPS be used?

  8. #108
    Join Date
    Nov 2012
    Posts
    2,351
    Mentioned
    55 Post(s)
    Quoted
    603 Post(s)

    Default

    Quote Originally Posted by Sawyer View Post
    Awesome! Maybe if jagex does bring back 07' Scape, this could possibly be used? Or would the normal SPS be used?
    I believe this sps would work, maybe with tiny modifications, don't worry, all the work I have done here, I will do for 07 scape aswell

    Depending on how different it is from a private server, I bet most of this code will work there aswell, I think the game UI and such are simular if not the same between 06-07


    Programming is like trying keep a wall of shifting sand up, you fix one thing but somewhere else starts crumbling

  9. #109
    Join Date
    Dec 2011
    Location
    U.S.A.
    Posts
    635
    Mentioned
    5 Post(s)
    Quoted
    249 Post(s)

    Default

    This would make scripting for the new-old runescape much easier. Thank you .

  10. #110
    Join Date
    Nov 2012
    Posts
    2,351
    Mentioned
    55 Post(s)
    Quoted
    603 Post(s)

    Default

    Quote Originally Posted by Sawyer View Post
    This would make scripting for the new-old runescape much easier. Thank you .
    Scar and srl were around back in 07, theres a bunch of old SRL stuff out there in the records somewhere (SRL3 Coh3n or someone mentioned?) I'll have a look for that one day,

    But when I started P06 Include, it was a learning experience, 07 scape will be a mission I have a better understanding after this, and will be a hell of a lot faster this time round


    Programming is like trying keep a wall of shifting sand up, you fix one thing but somewhere else starts crumbling

  11. #111
    Join Date
    Sep 2010
    Posts
    5,762
    Mentioned
    136 Post(s)
    Quoted
    2739 Post(s)

    Default

    I'm going to abandon my hp detection method and use textwrap for stats to get the current hp

  12. #112
    Join Date
    Jan 2012
    Posts
    1,104
    Mentioned
    18 Post(s)
    Quoted
    211 Post(s)

    Default

    Reading HP is so easy on on old RS.
    Simba Code:
    program Test;
    {$I SRL/SRL.simba}
    {$I SRL/SRL/misc/Debug.simba}



    procedure SetBoxToBounds(var Box : TBox; X1,Y1,X2,Y2 : Integer);
    begin
      if (Box.x1 < X1) then Box.x1 := X1;
      if (Box.x2 > X2) then Box.x2 := X2;
      if (Box.y1 < Y1) then Box.y1 := Y1;
      if (Box.y2 > Y2) then Box.y2 := Y2;
    end;



    procedure DebugTPA_ATPA(TPA: TPointArray; ATPA: Array of TPointArray; First : Integer);
    var
      BMP, Col, x, y, i, width, height: Integer;
      TPABox : TBox;
    begin

      GetClientDimensions(width,height);
      BMP := BitmapFromClient(0,0,width-1,height-1);
      DrawTPABitmap(BMP,TPA,ClWhite);

      for i:=0 to High(ATPA) do
      begin
        if i = First then
          Col := ClRed
        else
          Col := ClPurple;

        TPABox := GetTPABounds(ATPA[i]);
        SetBoxToBounds(TPABox,0,0,width-1,height-1);

        for x := TPABox.x1 to TPABox.x2 do
        begin
          FastSetPixel(BMP,x,TPABox.y1,Col)
          FastSetPixel(BMP,x,TPABox.y2,Col)
        end;
        for y := TPABox.y1 to TPABox.y2 do
        begin
          FastSetPixel(BMP,TPABox.x1,y,Col)
          FastSetPixel(BMP,TPABox.x2,y,Col)
        end;
      end;

      DebugBitmap(BMP);
      FreeBitmap(BMP);
    end;



    function GetHpPercent : Integer;
    var
      CombinedTPA, GreenTPA, RedTPA : TPointArray;
      CombinedATPA, GreenATPA, FinalATPA : Array of TPointArray;
      X1,Y1,X2,Y2, i,j,k, BoxWidth : Integer;
      ExcludeBoxes : Array of TBox;
      TempBox : TBox;
      BadTPA : Boolean;
    begin
      Result := -1;

      X1 := 232;
      Y1 := 139;
      X2 := 287;
      Y2 := 163;

      FindColorsTolerance(GreenTPA,65280,X1,Y1,X2,Y2,0);
      FindColorsTolerance(RedTPA,255,X1,Y1,X2,Y2,0);

      CombinedTPA := CombineTPA(GreenTPA,RedTPA);

      if (High(CombinedTPA) > 0) then
      begin

        SplitTPAWrap(CombinedTPA,1,CombinedATPA);

        SetArrayLength(ExcludeBoxes,0);
        j := 0;
        for i:=0 to High(CombinedATPA) do
        begin
          TempBox := GetTPABounds(CombinedATPA[i]);
          BoxWidth := TempBox.x2-TempBox.x1;
          if not (BoxWidth = 29) then
          begin
            SetArrayLength(ExcludeBoxes,j+1);
            ExcludeBoxes[j] := TempBox;
          end;
        end;

        SplitTPAWrap(GreenTPA,1,GreenATPA);

        SetArrayLength(FinalATPA,0);
        k := 0;
        for i:=0 to High(GreenATPA) do
        begin
          BadTPA := False;
          for j:=0 to High(ExcludeBoxes) do
            if PointInBox(MiddleTPA(GreenATPA[i]),ExcludeBoxes[j]) then
              BadTPA := True;
          if not BadTPA then
          begin
            SetArrayLength(FinalATPA,k+1);
            FinalATPA[k] := GreenATPA[i];
          end;
        end;

        SortATPAFrom(FinalATPA,Point(260,151));

        DebugTPA_ATPA(GreenTPA,FinalATPA,-1);

        if (Length(FinalATPA) < 1) then Exit;

        TempBox := GetTPABounds(FinalATPA[0]);
        BoxWidth := TempBox.x2-TempBox.x1;

        Result := Round(BoxWidth*100/29);

      end;
    end;



    var
      HPLevel, HPPerc : integer;

    begin
      ClearDebug;

      HPLevel := 11;
      repeat
        HPPerc := GetHPPercent;
        if (HPPerc = -1) then
          Writeln('HP: cant find HP bar.')
        else
          Writeln('HP: ' + IntToStr(Round(HPLevel*HPPerc/100)));
      until False;
    end.
    Reading percent from HP bar is not 100% accurate but it works fine.
    It works only at highest camera angle.
    Last edited by Shatterhand; 02-17-2013 at 02:30 PM.

  13. #113
    Join Date
    Sep 2010
    Posts
    5,762
    Mentioned
    136 Post(s)
    Quoted
    2739 Post(s)

    Default

    Quote Originally Posted by Shatterhand View Post
    Reading HP is so easy on on old RS.
    Simba Code:
    program Test;
    {$I SRL/SRL.simba}
    {$I SRL/SRL/misc/Debug.simba}



    procedure SetBoxToBounds(var Box : TBox; X1,Y1,X2,Y2 : Integer);
    begin
      if (Box.x1 < X1) then Box.x1 := X1;
      if (Box.x2 > X2) then Box.x2 := X2;
      if (Box.y1 < Y1) then Box.y1 := Y1;
      if (Box.y2 > Y2) then Box.y2 := Y2;
    end;



    procedure DebugTPA_ATPA(TPA: TPointArray; ATPA: Array of TPointArray; First : Integer);
    var
      BMP, Col, x, y, i, width, height: Integer;
      TPABox : TBox;
    begin

      GetClientDimensions(width,height);
      BMP := BitmapFromClient(0,0,width-1,height-1);
      DrawTPABitmap(BMP,TPA,ClWhite);

      for i:=0 to High(ATPA) do
      begin
        if i = First then
          Col := ClRed
        else
          Col := ClPurple;

        TPABox := GetTPABounds(ATPA[i]);
        SetBoxToBounds(TPABox,0,0,width-1,height-1);

        for x := TPABox.x1 to TPABox.x2 do
        begin
          FastSetPixel(BMP,x,TPABox.y1,Col)
          FastSetPixel(BMP,x,TPABox.y2,Col)
        end;
        for y := TPABox.y1 to TPABox.y2 do
        begin
          FastSetPixel(BMP,TPABox.x1,y,Col)
          FastSetPixel(BMP,TPABox.x2,y,Col)
        end;
      end;

      DebugBitmap(BMP);
      FreeBitmap(BMP);
    end;



    function GetHpPercent : Integer;
    var
      CombinedTPA, GreenTPA, RedTPA : TPointArray;
      CombinedATPA, GreenATPA, FinalATPA : Array of TPointArray;
      X1,Y1,X2,Y2, i,j,k, BoxWidth : Integer;
      ExcludeBoxes : Array of TBox;
      TempBox : TBox;
      BadTPA : Boolean;
    begin
      Result := -1;

      X1 := 232;
      Y1 := 139;
      X2 := 287;
      Y2 := 163;

      FindColorsTolerance(GreenTPA,65280,X1,Y1,X2,Y2,0);
      FindColorsTolerance(RedTPA,255,X1,Y1,X2,Y2,0);

      CombinedTPA := CombineTPA(GreenTPA,RedTPA);

      if (High(CombinedTPA) > 0) then
      begin

        SplitTPAWrap(CombinedTPA,1,CombinedATPA);

        SetArrayLength(ExcludeBoxes,0);
        j := 0;
        for i:=0 to High(CombinedATPA) do
        begin
          TempBox := GetTPABounds(CombinedATPA[i]);
          BoxWidth := TempBox.x2-TempBox.x1;
          if not (BoxWidth = 29) then
          begin
            SetArrayLength(ExcludeBoxes,j+1);
            ExcludeBoxes[j] := TempBox;
          end;
        end;

        SplitTPAWrap(GreenTPA,1,GreenATPA);

        SetArrayLength(FinalATPA,0);
        k := 0;
        for i:=0 to High(GreenATPA) do
        begin
          BadTPA := False;
          for j:=0 to High(ExcludeBoxes) do
            if PointInBox(MiddleTPA(GreenATPA[i]),ExcludeBoxes[j]) then
              BadTPA := True;
          if not BadTPA then
          begin
            SetArrayLength(FinalATPA,k+1);
            FinalATPA[k] := GreenATPA[i];
          end;
        end;

        SortATPAFrom(FinalATPA,Point(260,151));

        DebugTPA_ATPA(GreenTPA,FinalATPA,-1);

        if (Length(FinalATPA) < 1) then Exit;

        TempBox := GetTPABounds(FinalATPA[0]);
        BoxWidth := TempBox.x2-TempBox.x1;

        Result := Round(BoxWidth*100/29);

      end;
    end;



    var
      HPLevel, HPPerc : integer;

    begin
      ClearDebug;

      HPLevel := 11;
      repeat
        HPPerc := GetHPPercent;
        if (HPPerc = -1) then
          Writeln('HP: cant find HP bar.')
        else
          Writeln('HP: ' + IntToStr(Round(HPLevel*HPPerc/100)));
      until False;
    end.
    Reading percent from HP bar is not 100% accurate but it works fine.
    It works only at highest camera angle.
    I can just have the stat tab open and read the text and switch to inventory eat, and back to stat tab

  14. #114
    Join Date
    Nov 2012
    Posts
    2,351
    Mentioned
    55 Post(s)
    Quoted
    603 Post(s)

    Default

    Yea but what could you be doing that needs 100% accuracy, just eat when theres more than a 50% red bar on screen I guess


    Programming is like trying keep a wall of shifting sand up, you fix one thing but somewhere else starts crumbling

  15. #115
    Join Date
    Sep 2010
    Posts
    5,762
    Mentioned
    136 Post(s)
    Quoted
    2739 Post(s)

    Default

    Using the text wouldn't be accurate?

  16. #116
    Join Date
    Jan 2012
    Posts
    1,104
    Mentioned
    18 Post(s)
    Quoted
    211 Post(s)

    Default

    Quote Originally Posted by DannyRS View Post
    Yea but what could you be doing that needs 100% accuracy, just eat when theres more than a 50% red bar on screen I guess
    Its not 100% accurate, that means the HP bar has some default values: 100, 89, 65, 52.. etc. If you have 99 HP level, the HP bar cant represent your current HP accurately.

  17. #117
    Join Date
    Sep 2010
    Posts
    5,762
    Mentioned
    136 Post(s)
    Quoted
    2739 Post(s)

    Default

    Quote Originally Posted by Shatterhand View Post
    Its not 100% accurate, that means the HP bar has some default values: 100, 89, 65, 52.. etc. If you have 99 HP level, the HP bar cant represent your current HP accurately.
    15 red pixels = 10% damage I figured out, the HP bar is 150 pixels large so 75 red pixels would be half hp

    But I would rather read the text, seems to be more accurate

  18. #118
    Join Date
    Nov 2012
    Posts
    2,351
    Mentioned
    55 Post(s)
    Quoted
    603 Post(s)

    Default

    Quote Originally Posted by rjj95 View Post
    15 red pixels = 10% damage I figured out, the HP bar is 150 pixels large so 75 red pixels would be half hp

    But I would rather read the text, seems to be more accurate
    Yea accurate, but if you want to know when to eat for say, an autofighter, might aswell just use above head box,

    And i knew what you meant shatter nothing I can think of would need to know exactly what HP you were on anyway


    Programming is like trying keep a wall of shifting sand up, you fix one thing but somewhere else starts crumbling

  19. #119
    Join Date
    Sep 2010
    Posts
    5,762
    Mentioned
    136 Post(s)
    Quoted
    2739 Post(s)

    Default

    Ima just use text, I can see it now releasing auto fighter: "HALP THEE BOT EATS WHEN IT'S NOT SUPPOSED TOO!!"

  20. #120
    Join Date
    Nov 2012
    Posts
    2,351
    Mentioned
    55 Post(s)
    Quoted
    603 Post(s)

    Default

    Quote Originally Posted by rjj95 View Post
    Ima just use text, I can see it now releasing auto fighter: "HALP THEE BOT EATS WHEN IT'S NOT SUPPOSED TOO!!"
    Meh, either way will be fine lol


    Programming is like trying keep a wall of shifting sand up, you fix one thing but somewhere else starts crumbling

  21. #121
    Join Date
    Feb 2013
    Posts
    8
    Mentioned
    0 Post(s)
    Quoted
    3 Post(s)

    Default

    What does this script actually do sir?

  22. #122
    Join Date
    Nov 2012
    Posts
    2,351
    Mentioned
    55 Post(s)
    Quoted
    603 Post(s)

    Default

    Quote Originally Posted by CHEATGOD View Post
    What does this script actually do sir?
    It's not a script, it makes it 100x easier to make scripts, basically a library

    examples

    Last edited by DannyRS; 02-17-2013 at 07:15 PM.


    Programming is like trying keep a wall of shifting sand up, you fix one thing but somewhere else starts crumbling

  23. #123
    Join Date
    Feb 2013
    Posts
    8
    Mentioned
    0 Post(s)
    Quoted
    3 Post(s)

    Default

    Quote Originally Posted by DannyRS View Post
    It's not a script, it makes it 100x easier to make scripts, basically a library
    Thanks. Now I have to figure out how does one actually start making a script lol. BTW do you have a Skype on which I could talk with you?

  24. #124
    Join Date
    Nov 2012
    Posts
    2,351
    Mentioned
    55 Post(s)
    Quoted
    603 Post(s)

    Default

    Quote Originally Posted by CHEATGOD View Post
    Thanks. Now I have to figure out how does one actually start making a script lol. BTW do you have a Skype on which I could talk with you?
    http://villavu.com/forum/showthread.php?t=44942

    can't really talk atm, but,

    Skype:
    DannyRS DannyRS


    Programming is like trying keep a wall of shifting sand up, you fix one thing but somewhere else starts crumbling

  25. #125
    Join Date
    Feb 2013
    Posts
    8
    Mentioned
    0 Post(s)
    Quoted
    3 Post(s)

    Default

    Quote Originally Posted by DannyRS View Post
    http://villavu.com/forum/showthread.php?t=44942

    can't really talk atm, but,

    Skype:
    Hope I added the right one lol. UK one.

Page 5 of 7 FirstFirst ... 34567 LastLast

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
  •