Page 1 of 2 12 LastLast
Results 1 to 25 of 36

Thread: SMART Debug info [RSBOT like]

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

    Default SMART Debug info [RSBOT like]

    If some people can look through my code and try and piont out things i can do to reduce lag.

    Save this as includes/srl/srl/misc/smart2.scar

    You must have this as the smart over writes the get mouse pos

    SCAR Code:
    function IsKeyDown(C:Char): Boolean;
     // BETA. Not sure if it works. ~Wizzup?
    begin
      Result := SmartIsKeyDown(ord(c));
    end;

    procedure MoveMouse(x, y: Integer);
    begin
      SmartMoveMouse(x, y);
    end;

    procedure HoldMouse(x, y: Integer; left: Boolean);
    begin
      SmartHoldMouse(x, y, left);
    end;

    procedure ReleaseMouse(x, y: Integer; left: Boolean);
    begin
      SmartReleaseMouse(x, y, left);
    end;

    procedure KeyUp(key: Byte);
    begin
      If Key = 13 Then
        Key := 10;
      SmartReleaseKey(key);
    end;

    procedure KeyDown(key: Byte);
    begin
      If Key = 13 Then
        Key := 10;
      SmartHoldKey(key);
    end;

    procedure SendKeys(S: String);
    begin
      SmartSendKeys(S);
    end;


    function GetColor(x, y: Integer): Integer;
    begin
      result:= SmartGetColor(x, y);
    end;


    procedure SmartSetTarget;
    var
      Smart_Bitmap: Integer;
    begin
      Smart_Bitmap:= BitmapFromString(765,503,'');
      GetBitmapCanvas(Smart_Bitmap).Handle:= SmartGetDC;
      SetTargetBitmap(Smart_Bitmap);
      FreeBitmap(Smart_Bitmap);
    end;

    function FindWindow(Title: String): Boolean;
    begin
      result:= true;
    end;

    procedure ActivateClient;
    begin
    end;

    function FindWindowBySize(Width, Height: Integer): Boolean;
    begin
      result:= true;
    end;

    procedure SmartSetupEx(worldnumber: integer; safe, signed, superdetail: boolean);
    var
      prefix: string;
    begin
      prefix := ReadINI('World' + IntToStr(worldnumber), 'Prefix', AppPath + 'includes\SRL\SCSS\worlds.ini');
      if(prefix = '')then
      begin
        writeln('Invalid world number or corrupted world list. Please review your settings');
        TerminateScript;
      end;
      SmartSetup(prefix, safe, signed, superDetail);
    end;

    Procedure SaveScreenshot(s : string);
    var
      TempBMP : integer;
      TempS : String;
    begin;
      Temps := s;
      While FileExists(Temps) do
      begin;
        Temps := ExtractFilePath(s) + Copy(ExtractFileName(Temps),1,LastPos('.',ExtractFileName(Temps))-1) + '2' + ExtractFileExt(s);
        Writeln(Temps);
      end;
      TempBMP := BitmapFromString(765,503,'');
      Try
        CopyClientToBitmap(TempBMP,0,0,765,503);
        SaveBitmap(TempBMP, Temps);
      Except
      end;
      FreeBitmap(TempBMP);
    end;




    Then run this

    SCAR Code:
    {credits to JuKKa and everyone who helped JuKKa and every one who helped me
    Other main credits to N3ss3s for GetPaintBitmap and also to Lee Lok Hin for beating me to putting in tiles also to bobarkinator for the concept of small chars instead of upchars}


    program ReflectionAid;
    {.include SRL/SRL/Misc/Smart2.scar}
    {.include srl/srl.scar}
    {.include srl/srl/reflection/reflection.scar}

    var
      i, x,y :integer;

    Function GetPaintBitmap(sX, sY: Integer; Text: TStringArray; Dist: Integer): Integer;
    Var
       TPA: TPointArray;
       H, Q, B: Integer;
    Begin
      Result := BitmapFromString(sX, sY, '');
      For B := 0 To High(Text) Do
      Begin
        TPA := LoadTextTPA(Text[b], SmallChars, H);
        For Q := 0 To High(TPA) Do
          FastSetPixel(Result, TPA[q].x, TPA[q].y + B * Dist, 16777215);
      End;
    End;


    Procedure ClearSMARTCanvas;
    Var
      BMP: Integer;
      SMARTCanvas, Canvas: TCanvas;
    Begin
      BMP := BitmapFromString(765, 503, '')
      SMARTCanvas := GetBitmapCanvas(BMP);
      Canvas := GetBitmapCanvas(BMP);
      SMARTCanvas.handle := SmartGetDebugDC;
      CopyCanvas(Canvas, SMARTCanvas, 0, 0, 765, 503, -1000, -1000, 1000, 1000);
      FreeBitmap(BMP);
    End;


    Procedure ShowNPCInfo;
    Var
      SCanvas, Canvas, InfoCanvas: TCanvas;
      BMP: Integer;
      Text: TStringArray;
      NPCs: array of TNPC;
    begin
      NPCs:=getnpcs;
      if not(LoggedIn) then Exit;
      SmartSetDebug(True);
      BMP := BitmapFromString(765, 503, '');
      SCanvas := GetBitmapCanvas(BMP);
      InfoCanvas := GetBitmapCanvas(BMP);
      SCanvas.handle := SmartGetDebugDC;
      getmousepos(x,y);
      for i := 0 to high(NPCs) do
      begin
        if InRange(NPCs[i].MS.X,X-30,X+30) and InRange(NPCs[i].MS.Y,Y-30,Y+30) then
          begin
            Text := [
                  'NPC Name : '+NPCs[i].Name,
                  'NPC ID   : '+IntToStr(NPCs[i].NPCType),
                  'NPC Tiles : ('+IntToStr(NPCs[i].Tile.X)+', '+IntToStr(NPCs[i].Tile.Y)+')']
            Canvas := GetBitmapCanvas(GetPaintBitmap(400,200,text,10));
            safeCopyCanvas(Canvas, SCanvas, 0, 0, 400, 200, 0,0,400,200);
            While IsMouseButtonDown(True) do
              Wait(30);
          end;
      end;
      FreeBitmap(BMP);
    end;

    Procedure ShowAnimInfo;
    Var
      SCanvas, Canvas: TCanvas;
      BMP, Anim: Integer;
      Text: TStringArray;

    begin
      if not(loggedin) then Exit;
      Anim:=SmartGetFieldInt(SmartGetFieldArrayObject(0,NPCArray,
      SmartGetFieldArrayInt(0,NPCIndexArray,i)),CharAnim);
      SmartSetDebug(True);
      BMP := BitmapFromString(765, 503, '');
      SCanvas := GetBitmapCanvas(BMP);
      SCanvas.handle := SmartGetDebugDC;
      Text := [
        'Animation: '+inttostr(anim),
        'Tiles    : ('+IntToStr(getmypos.x)+', '+IntToStr(getmypos.y)+')']
      Canvas := GetBitmapCanvas(GetPaintBitmap(400,200,text,15));
      safeCopyCanvas(Canvas, SCanvas, 0, 0, 400, 200, 0,0,400,200);

      FreeBitmap(BMP);
    end;

    Procedure SetupSMART;
    Begin
      SmartSetup('world37', false, false, False);
      SetTargetDC(SmartGetDC);
      If Not (LoggedIn) Then
        While Not (SmartGetColor(360, 172) = 13158) Do
          Wait(100);
    End;

    Procedure Setup;
    begin
      setupsmart;
      setupsrl;
      //setupreflection;
    end;

    Procedure DoInfo;
    Var
      FirstLoop : Boolean;
    begin
      FirstLoop:=false;
      ClearSMARTCanvas;
      if isfkeydown(11) then
      Repeat
        Showaniminfo;
        If not firstloop then
          while isfkeydown(11) do
            wait(10);
        firstloop:=true;
        wait(100);
      until isfkeydown(11);
      if isfkeydown(9) then
        writeln('Tiles    : ('+IntToStr(getmypos.x)+', '+IntToStr(getmypos.y)+')')
      else
        shownpcinfo;
    end;

    begin
      setup;
      ClearSMARTCanvas;
      repeat
        DoInfo;
        wait(100);
      until false;
    end.


    Then select the Runescape client in the smart window with the crosshairs

    then mouse over an NPC
    User name i noob i cba editing it out
    i dont care if it gets stolen if it does and i get it back i would still report ip tho =p




    Changes log

    There has been some changes before this but this is the changes from now

    Made text closer together and put an else function in the isfkeydown so it doesn't do both things.

    Made a slight change to the animation procedure.

    Made it so Info is displayed in top left corner to make it look tidier
    Made it so that on left click Displayed NPC Info will be paused (stops flickering)


    Pressing F9 will now writeln your tile co-ords it does not matter if smart is enabled or not.
    Blank!

  2. #2
    Join Date
    Aug 2007
    Location
    in a random little world
    Posts
    5,778
    Mentioned
    0 Post(s)
    Quoted
    7 Post(s)

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

    Default

    Ill update it for items when we have hooks and stuff =p
    Blank!

  4. #4
    Join Date
    Aug 2007
    Location
    in a random little world
    Posts
    5,778
    Mentioned
    0 Post(s)
    Quoted
    7 Post(s)

  5. #5
    Join Date
    Aug 2007
    Location
    irc://irc.rizon.net:6667/srl
    Posts
    1,566
    Mentioned
    1 Post(s)
    Quoted
    0 Post(s)

    Default

    Looks good, move the paint to the top left or bottom right of the main screen tho?

    "Far better it is to dare mighty things, to win glorious triumphs, even though checkered by failure, than to take rank with those poor spirits who neither enjoy much nor suffer much because they live in the gray twilight that knows neither victory nor defeat."
    — Theodore Roosevelt

  6. #6
    Join Date
    Apr 2007
    Posts
    994
    Mentioned
    1 Post(s)
    Quoted
    0 Post(s)

    Default

    At [-jebus-], It probably paints next to your mouse. Nice make though, slight question. Username in screenie?

    SCAR Code:
    {credits to JuKKa and everyone who helped JuKKa and every one who helped me}
    program ReflectionAid;
    {.include SRL/SRL/Misc/Smart2.scar}
    {.include srl/srl.scar}
    {.include srl/srl/reflection/reflection.scar}

    var
      i, x,y :integer;
      NPCs: array of TNPC;

    Function GetPaintBitmap(sX, sY: Integer; Text: TStringArray; Dist: Integer): Integer;
    Var
       TPA: TPointArray;
       H, Q, B: Integer;
    Begin
      Result := BitmapFromString(sX, sY, '');
      For B := 0 To High(Text) Do
      Begin
        TPA := LoadTextTPA(Text[b], UpChars, H);
        For Q := 0 To High(TPA) Do
          FastSetPixel(Result, TPA[q].x, TPA[q].y + B * Dist, 16777215);
      End;
    End;


    Procedure ClearSMARTCanvas;
    Var
      BMP: Integer;
      SMARTCanvas, Canvas: TCanvas;
    Begin
      BMP := BitmapFromString(765, 503, '')
      SMARTCanvas := GetBitmapCanvas(BMP);
      Canvas := GetBitmapCanvas(BMP);
      SMARTCanvas.handle := SmartGetDebugDC;
      CopyCanvas(Canvas, SMARTCanvas, 0, 0, 765, 503, -1000, -1000, 1000, 1000);
      FreeBitmap(BMP);
    End;


    Procedure ShowNPCInfo;
    Var
      SCanvas, Canvas: TCanvas;
      BMP, Sec: Integer;
      Text: TStringArray;

    begin
      if not(LoggedIn) then Exit;
      NPCs := GetNPCs;
      SmartSetDebug(True);
      BMP := BitmapFromString(765, 503, '');
      SCanvas := GetBitmapCanvas(BMP);
      SCanvas.handle := SmartGetDebugDC;
      getmousepos(x,y);
      for i := 0 to high(NPCs) do
      begin
        if InRange(NPCs[i].MSX,X-30,X+30) and inrange(NPCs[i].MSY,Y-30,Y+30) then
          begin
            Text := [
                  'NPC Name : '+NPCs[i].Name,
                  'NPC ID   : '+IntToStr(NPCs[i].NPCType)]
            Canvas := GetBitmapCanvas(GetPaintBitmap(400,200,text,25));
            safeCopyCanvas(Canvas, SCanvas, 0, 0, 400, 200, NPCs[i].MSX,NPCs[i].MSY , NPCs[i].MSX + 400, NPCs[i].MSY + 200);
          end;
      end;
      FreeBitmap(BMP);
    end;

    Procedure ShowAnimInfo;
    Var
      SCanvas, Canvas: TCanvas;
      BMP, Sec, Anim: Integer;
      Text: TStringArray;

    begin
      if not(loggedin) then Exit;
      Anim:=getanimation;
      SmartSetDebug(True);
      BMP := BitmapFromString(765, 503, '');
      SCanvas := GetBitmapCanvas(BMP);
      SCanvas.handle := SmartGetDebugDC;
      getmypos(x,y);
      begin
        Text := [
        'Animation: '+inttostr(GetAnimation),
        'Tiles Position   x: '+IntToStr(x)+' y: '+IntToStr(y)]
        Canvas := GetBitmapCanvas(GetPaintBitmap(400,200,text,25));
        safeCopyCanvas(Canvas, SCanvas, 0, 0, 400, 200, 0,0,400,200);
      end;
      FreeBitmap(BMP);
    end;

    Procedure SetupSMART;
    Begin
      SmartSetupEx(136, false, false, False);
      SetTargetDC(SmartGetDC);
      If Not (LoggedIn) Then
        While Not (SmartGetColor(360, 172) = 13158) Do
          Wait(100);
    End;

    Procedure Setup;
    begin
      setupsmart;
      setupsrl;
      setupreflection;
    end;

    begin
      setup;
      ClearSMARTCanvas;
      repeat
        ClearSMARTCanvas;
        shownpcinfo;
        wait(100);
        if isfkeydown(11) then
          showaniminfo;
        wait(100);
      until false;
    end.

    I added both tile position and animation, but you must press F11 to get them.

    Credits to Yakman's Canvas Tutorial, I swallowed it.


    EDIT:
    [QUOTE]<GoF`> oh no its Raymooond
    <Raymooond> Heya
    <GoF`> is it ray or some other ray?
    <LeeLokHin> No idea
    <LeeLokHin> Raymond, what's the game you like the most?
    <Raymooond> Runescape
    <-- LeeLokHin has kicked Raymooond from #srl (Faker.)[/QUOTE]

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

    Default

    Suggestion, make the text smaller


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

    Default

    {credits to JuKKa and everyone who helped JuKKa and every one who helped me}
    GetPaintBitmap is fully by me...

    Bob is right btw, make it SmallChars.

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

    Default

    Darn you lee lok kin i was gunna do that today =p oh well saves me time

    N3ss3s when will object recognition me finished?

    And lee dont you dare put object stuff in i wanna =p


    User is a low level uneeded account if it gets robbed i dont really care.

    [-jesus-] i want it over the person when the objects come into play then i will see what would be better, for now we will just vote (post if it should go in over the char or in top left corner)

    N3ss3s You where meant to be in credits by name simply cos i knew you helped JuKKa and some of he funcs where yours oh well your there now, if you want to writeme out one of them big green rectangles to put above it you can =p
    Blank!

  10. #10
    Join Date
    Aug 2007
    Location
    in a random little world
    Posts
    5,778
    Mentioned
    0 Post(s)
    Quoted
    7 Post(s)

    Default

    i found a bug in this script
    its not serious or anything but it is sort of annoying after a little while

    if you hover over a npc that is in the bottom right hand corner of the game screen then the writing comes up larger on the main screen

    i hope you manage to fix it or find out what is causing it

    ~shut

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

    Default

    Ye ive noticed it b4 but have no idea how to fix
    yay people are using it, i think it has something to do with n3ss3s's getpaintbitmap im going to move text closer aswell
    Blank!

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

    Default

    Let me explain my function, Dist is the distance between the texts if you enter multiple strings to the TSA.


    The fail shit that makes the text big is in CopyCanvas, not my function...

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

    Default

    Oh kk yer i know what dist was i was looking at the code =p
    do you know what is wrong with the copy canvas?
    shuold i use safe copy canvas
    Blank!

  14. #14
    Join Date
    May 2007
    Location
    Location:= USA
    Posts
    238
    Mentioned
    0 Post(s)
    Quoted
    0 Post(s)

    Default

    nevermind at this.
    Please, I need money, and you don't lose anything, except get money! Join BUX.TO with http://bux.to/?r=twistedvip50

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

    Default

    erm twisted we already have that and i dont think that will work properly
    Blank!

  16. #16
    Join Date
    May 2007
    Location
    Location:= USA
    Posts
    238
    Mentioned
    0 Post(s)
    Quoted
    0 Post(s)

    Default

    SCAR Code:
    begin
      setup;
      ClearSMARTCanvas;
      repeat
        ClearSMARTCanvas;
        shownpcinfo;
        wait(100);
        if isfkeydown(11) then
        repeat
          showaniminfo;
        until isfkeydown(11);
      until false;
    end.

    Make that the main loop, so it will stay up instead of u having to hold it down to read, until you press f11 again
    Please, I need money, and you don't lose anything, except get money! Join BUX.TO with http://bux.to/?r=twistedvip50

  17. #17
    Join Date
    Jul 2007
    Location
    Massachusetts
    Posts
    896
    Mentioned
    0 Post(s)
    Quoted
    0 Post(s)

    Default

    This should help a lot of people with reflection! Nice Job!

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

    Default

    Made some more changes read bottom of thread.
    Blank!

  19. #19
    Join Date
    May 2008
    Location
    127.0.0.1
    Posts
    705
    Mentioned
    1 Post(s)
    Quoted
    6 Post(s)

    Default

    wow very helpful for my new script im making!
    <Wizzup> And he's a Christian
    <Wizzup> So he MUST be trusted
    ___________________________________________
    <Wizzup> she sounds like a dumb bitch

  20. #20
    Join Date
    May 2008
    Posts
    266
    Mentioned
    0 Post(s)
    Quoted
    0 Post(s)

    Default

    I really like all of the hard work being put into Reflection, just have one question.

    What is the main goal of all of these reflection stuff? make another RsBot?
    What would be the advantages?

  21. #21
    Join Date
    Aug 2007
    Location
    in a random little world
    Posts
    5,778
    Mentioned
    0 Post(s)
    Quoted
    7 Post(s)

    Default

    Quote Originally Posted by jose89 View Post
    I really like all of the hard work being put into Reflection, just have one question.

    What is the main goal of all of these reflection stuff? make another RsBot?
    What would be the advantages?
    it will make scripts more flawless so they can run better and so the character wont get banned

    ~shut

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

    Default

    we arnt making another rsbot

    scar>rsbot

    scar+reflection>GOD

    rsbot has flawless walking scar has easily made failsafes and accurate object finding scar+reflection = ultimate pwnage its almost flawless we can walk perfectly and interact perfeactly and have great colour finding fialsafes

    scars colour and shape detection is why it is greater than any other bot, but with reflection we overcome 90% of the downsides of using scar to rsbot
    Blank!

  23. #23
    Join Date
    Dec 2006
    Location
    Sweden
    Posts
    10,812
    Mentioned
    3 Post(s)
    Quoted
    16 Post(s)

    Default

    Quote Originally Posted by Waddo View Post
    we arnt making another rsbot

    scar>rsbot

    scar+reflection>GOD


    rsbot has flawless walking scar has easily made failsafes and accurate object finding scar+reflection = ultimate pwnage its almost flawless we can walk perfectly and interact perfeactly and have great colour finding fialsafes

    scars colour and shape detection is why it is greater than any other bot, but with reflection we overcome 90% of the downsides of using scar to rsbot
    I think you should change the >'s to <'s... RSBot is better than SCAR in ways of doing complex stuff. And SCAR and Reflection is not better than God..


    Send SMS messages using Simba
    Please do not send me a PM asking for help; I will not be able to help you! Post in a relevant thread or make your own! And always remember to search first!

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

    Default

    God is fictional IMHO .'. Scar is greater than god
    Blank!

  25. #25
    Join Date
    May 2007
    Location
    Location:= USA
    Posts
    238
    Mentioned
    0 Post(s)
    Quoted
    0 Post(s)

    Default

    So you're an atheist?
    Please, I need money, and you don't lose anything, except get money! Join BUX.TO with http://bux.to/?r=twistedvip50

Page 1 of 2 12 LastLast

Thread Information

Users Browsing this Thread

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

Similar Threads

  1. Is this possible? Debug box thing ^^
    By Nexhou in forum OSR Help
    Replies: 2
    Last Post: 07-07-2008, 06:16 PM
  2. Around The Web Info
    By TViYH in forum General
    Replies: 0
    Last Post: 02-23-2008, 10:24 PM
  3. whole 55 lines to debug
    By HarryJames in forum OSR Help
    Replies: 3
    Last Post: 03-19-2007, 08:35 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
  •