Results 1 to 20 of 20

Thread: HP above heads, Drawing onto smart window.

  1. #1
    Join Date
    Nov 2006
    Location
    'Pergamino, BA, Argentina';
    Posts
    473
    Mentioned
    0 Post(s)
    Quoted
    6 Post(s)

    Default HP above heads, Drawing onto smart window.

    Okay, with a bit of help from Widget, i managed to make an "hp above heads" script, but it only works if the player's MAX HP is above 55.

    the script outputs looks something like this:
    SCAR Code:
    user1
    max hp is: 76
    current hp is: 70
    hp ratio is: 96

    Now what i need someone to teach me/do it for me and share the script credits 50/50 is how to draw some text to the SMART window, just like this http://www.villavu.com/forum/showthread.php?t=33699 or JuKKa's Air Crafter.

    Okay, here is the code, its a bit messy, and dont look at standars lol:

    SCAR Code:
    program New;
    {.include SRL/SRL/Misc/SMART.scar}
    {.include srl/srl.scar}
    {.Include SRL\SRL\Reflection\Reflection.Scar}

    const
    //SMART setup
    WorldNumber = 119;
    Signed      = true;//true/false
    UseSMART    = false;//

    function GetPlayersMaxHp(player:string):integer;
    var
    page: string;
    begin
      page := GetPage('http://hiscore.runescape.com/hiscorepersonal.ws?user1=' + player);
      page := Between('Hitpoints','<tr',page);
      page := Between('</td>','</tr>',page);
      page := Between('</td>','d>',page);
      page := Between('<td class="alL">','</t',page);
      if page = '' then
      begin
      result := 1;
      exit;
      end;
      result := strtoint(page);
    end;






    procedure theplayer;
    var
    Me : array of Tplayer;
    i, o : integer;
    u: string;
    begin
    Me := Getplayers;
    for i := 0 to High(Me) do
    begin
    Writeln(Me[i].Name);
     Writeln('ratio '+inttostr(Me[i].HpRatio));
     u := Me[i].Name;
     o := GetPlayersMaxHp(u);
     Writeln('Max HP IS: '+inttostr(o));
     Writeln('Current HP is: '+inttostr(o * Me[i].HpRatio / 100));
     
     wait(200+random(100));
     end;
    end;




    begin

        SmartSetupEx(worldnumber, false, signed, false);
       // while not SmartReady do wait(100);
       wait(10000);
        SetTargetDC(SmartGetDC);
        SetupSRL;
        theplayer;
    end.

  2. #2
    Join Date
    Apr 2007
    Location
    The Netherlands
    Posts
    5,553
    Mentioned
    0 Post(s)
    Quoted
    0 Post(s)

    Default

    Show me the code I might can help
    ~Hermen

  3. #3
    Join Date
    Dec 2006
    Location
    Program TEXAS home of AUTOERS
    Posts
    7,934
    Mentioned
    26 Post(s)
    Quoted
    237 Post(s)

    Default

    yeah go ahead post the code here.

  4. #4
    Join Date
    Nov 2006
    Location
    'Pergamino, BA, Argentina';
    Posts
    473
    Mentioned
    0 Post(s)
    Quoted
    6 Post(s)

  5. #5
    Join Date
    Jan 2007
    Posts
    8,876
    Mentioned
    123 Post(s)
    Quoted
    327 Post(s)

    Default

    Humm.... We can't really do much... I don't think reflection can reflect what levels other ppl got...

  6. #6
    Join Date
    Nov 2006
    Location
    'Pergamino, BA, Argentina';
    Posts
    473
    Mentioned
    0 Post(s)
    Quoted
    6 Post(s)

    Default

    Quote Originally Posted by Zytex! View Post
    Humm.... We can't really do much... I don't think reflection can reflect what levels other ppl got...
    I already managed to get the levels, using the Hiscores, but only if the HP is above 55. I just got this idea, you know, with the assist system, won't we be able to get the others' levels? Idk since i never used that system.

  7. #7
    Join Date
    Feb 2007
    Location
    SparklesProd.com
    Posts
    2,406
    Mentioned
    1 Post(s)
    Quoted
    0 Post(s)

    Default

    Great idea using the high scores and hp ratio via reflection. Gl with it.

  8. #8
    Join Date
    Nov 2006
    Location
    'Pergamino, BA, Argentina';
    Posts
    473
    Mentioned
    0 Post(s)
    Quoted
    6 Post(s)

    Default

    Quote Originally Posted by Sp0rky View Post
    Great idea using the high scores and hp ratio via reflection. Gl with it.
    Ty, i already done that, now i'm waiting for Almost(the guy who made that item and stats editor) to answer me, so we can input the hp numbers above heads using something like his script does.

  9. #9
    Join Date
    Dec 2006
    Location
    Copy pastin to my C#
    Posts
    3,788
    Mentioned
    8 Post(s)
    Quoted
    29 Post(s)

    Default

    ffs... Why can't anyone believe me in that it's no use, if you choose Disable Smart you won't see debug, if you choose debug and thus Enable Smart, you can't play.

    And if you try painting on the game canvas, you'll just lag if you want to see it properly...

  10. #10
    Join Date
    Nov 2006
    Location
    'Pergamino, BA, Argentina';
    Posts
    473
    Mentioned
    0 Post(s)
    Quoted
    6 Post(s)

    Default

    Quote Originally Posted by n3ss3s View Post
    ffs... Why can't anyone believe me in that it's no use, if you choose Disable Smart you won't see debug, if you choose debug and thus Enable Smart, you can't play.

    And if you try painting on the game canvas, you'll just lag if you want to see it properly...
    I'm just doing it as a challenge, as i read someone said that it couldn't be done :P. And its a good way to learn a bit about this. Now could everyone tell me why doesnt this get the up text? It compiles but it displays nothinh, i mean "UpText is: "

    SCAR Code:
    procedure theplayer1;
    var
    Me :  Tplayer;
    i : integer;
    begin
    jj := GetUpText;
    WriteLn('UpText is: '+jj);
    jj := between(' ', ' (lev', jj);
    WriteLn('name using UpText is: '+jj);
    Me := Getplayer(jj);
    //for i := 0 to High(Me) do
     Writeln('ratio '+inttostr(Me.HpRatio));
     u := Me.Name;
     o := GetPlayersMaxHp(u);
     Writeln('Max HP IS: '+inttostr(o));
     Writeln('Current HP is: '+inttostr(o * Me.HpRatio / 100));
    end;

  11. #11
    Join Date
    Feb 2007
    Posts
    211
    Mentioned
    0 Post(s)
    Quoted
    0 Post(s)

    Default

    Quote Originally Posted by n3ss3s View Post
    ffs... Why can't anyone believe me in that it's no use, if you choose Disable Smart you won't see debug, if you choose debug and thus Enable Smart, you can't play.

    And if you try painting on the game canvas, you'll just lag if you want to see it properly...
    Using the current options you have available I am agreeing with n3ss3s, what happens when you are in a crowded area? and constantly drawing on the game canvas itself would start causing issues. Unless you can think of a simple way to make a new canvas over the runescape window similar to how smart does, without locking out key/mouse strokes it would be viable. You could do it in something like C++ fairly easy, but i believe without a plugin for scar you might be limited. I am not a scar expert i could easily be wrong but from my experience I am agreeing with n3ss3s

    Does it run but not do

    SCAR Code:
    WriteLn('UpText is: '+jj);

    Or is it throwing an error on compile?

    An alternative if show their health on your titlebar
    Current Project: Catching up on what I missed, re-writing some old includes I done in the past.
    Upcoming Project: Open For Suggestions

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

    Default

    jj := rs_getuptext;

    not

    jj := GetUpText;

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


  13. #13
    Join Date
    Feb 2007
    Posts
    211
    Mentioned
    0 Post(s)
    Quoted
    0 Post(s)

    Default

    Quote Originally Posted by HyperSecret View Post
    jj := rs_getuptext;

    not

    jj := GetUpText;
    SCAR Code:
    function GetUpText: string;
    begin
      Result := rs_GetUpText;
    end;

    =P
    Current Project: Catching up on what I missed, re-writing some old includes I done in the past.
    Upcoming Project: Open For Suggestions

  14. #14
    Join Date
    Nov 2006
    Location
    'Pergamino, BA, Argentina';
    Posts
    473
    Mentioned
    0 Post(s)
    Quoted
    6 Post(s)

    Default

    Quote Originally Posted by Seroko View Post
    SCAR Code:
    function GetUpText: string;
    begin
      Result := rs_GetUpText;
    end;

    =P
    =)

    And yea, i also tried with rs_GetUpText; before posting this, still does not worl :/

    @Seroko: It compiles, but shows "Uptext is: "

  15. #15
    Join Date
    Feb 2007
    Posts
    211
    Mentioned
    0 Post(s)
    Quoted
    0 Post(s)

    Default

    Edit~ not sure testing stuff ._.
    Current Project: Catching up on what I missed, re-writing some old includes I done in the past.
    Upcoming Project: Open For Suggestions

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

    Default

    Please refer to this link for further discussion, this is the official release I believe, no reason to have multiple threads.

    http://www.villavu.com/forum/showthr...3?goto=newpost

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


  17. #17
    Join Date
    Jan 2007
    Location
    Kansas
    Posts
    3,760
    Mentioned
    1 Post(s)
    Quoted
    3 Post(s)

    Default

    Meh, it'd just be easier to write the HP Ratio above the heads so it works for everyone.


  18. #18
    Join Date
    Nov 2006
    Location
    'Pergamino, BA, Argentina';
    Posts
    473
    Mentioned
    0 Post(s)
    Quoted
    6 Post(s)

    Default

    Quote Originally Posted by Bobarkinator View Post
    Meh, it'd just be easier to write the HP Ratio above the heads so it works for everyone.
    Well, actually the Hp bar shows the radio, just not in numbers but in a graphical way.

  19. #19
    Join Date
    Jan 2007
    Location
    Kansas
    Posts
    3,760
    Mentioned
    1 Post(s)
    Quoted
    3 Post(s)

    Default

    Quote Originally Posted by Shady? View Post
    Well, actually the Hp bar shows the radio, just not in numbers but in a graphical way.
    Yeah, but you tell me the percent exactly based off the HP Bar


  20. #20
    Join Date
    Nov 2006
    Location
    'Pergamino, BA, Argentina';
    Posts
    473
    Mentioned
    0 Post(s)
    Quoted
    6 Post(s)

Thread Information

Users Browsing this Thread

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

Similar Threads

  1. MSN Users - Heads Up
    By rogeruk in forum News and General
    Replies: 43
    Last Post: 12-07-2007, 02:44 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
  •