Results 1 to 14 of 14

Thread: Simple Debug Question

  1. #1
    Join Date
    Mar 2012
    Posts
    426
    Mentioned
    0 Post(s)
    Quoted
    9 Post(s)

    Default Simple Debug Question

    Hello! I haven't been around for two years so I am a little rusty. I was a proficient (in my eyes, at least) with writing scripts before I quit playing Runescape so hopefully I can get back into the groove.

    My question is fairly simple but I haven't been able to find an answer for it. Hopefully I haven't been looking in the wrong places. I have used a couple of scripts and they all seem to constantly print debug information. I have read through the scripts and I can't find a command or line that is causing this to happen. I also remember that this was not the case two years ago.

    So my question is, can I turn off the constant debugging and only have my progress reports printed?

    Thanks!

    P.S. - Am I using the chat wrong or is there never anyone talking in it?
    - My Scripts (Beginning to Update to SRL 6) -

  2. #2
    Join Date
    Dec 2007
    Posts
    2,766
    Mentioned
    2 Post(s)
    Quoted
    37 Post(s)

    Default

    Can you post scripts and "debug information" examples ?

  3. #3
    Join Date
    Mar 2012
    Posts
    426
    Mentioned
    0 Post(s)
    Quoted
    9 Post(s)

    Default

    Thanks for the quick response!

    So far every script has done it for me. But Coh3n's script below can be an example:

    http://villavu.com/forum/showthread.php?t=47111

    It posts information like this. Maybe this is just normal now but it use to not be the case?


    [0:00:03]: -- setupSRL()
    [0:00:03]: ---- Setting up SRL...
    [0:00:03]: ---- initSmart():
    [0:00:03]: ------ Attempting to pair to a previously spawned client
    [0:00:03]: ------ smartPairToExistingClient():
    [0:00:03]: -------- Found 1 free client(s), attempting to pair to one...
    [0:00:03]: ---------- smartSetAsTarget(): Succesfully set SMART[13040] as Simba's target
    [0:00:03]: -------- Succesfully paired to a existing client, SMART[13040]
    [0:00:03]: ------ smartPairToExistingClient(): result = true
    [0:00:03]: ------ Succesfully initialized via pairing to a previously spawned client
    [0:00:03]: ---- initSmart()
    [0:00:03]: ------ smartSetupDrawing(): Succesfully setup SMART drawing
    [0:00:03]: ---- Waiting up to 5 minutes for RS to load...
    [0:00:03]: ------ TRSActionBar.__findButton(): Found the actionbar button @ {X = 566, Y = 314}
    [0:00:03]: ------ TRSActionBar.__find(): result = true (height = 75)
    [0:00:03]: ------ Dynamic interfaces have been set.
    [0:00:03]: ---- Client is ready.
    [0:00:03]: ---- Setup SRL in 188ms.
    [0:00:03]: -- setupSRL(): True
    [0:00:03]: -- TPlayerArray.setup()
    [0:00:03]: ---- Loaded player: ak47auto
    [0:00:03]: -- TPlayerArray.setup(): Success
    [0:00:03]: Loading, please wait...
    [0:00:03]: -- TPlayer.login()
    [0:00:03]: ---- Already logged in
    [0:00:03]: ---- Logged in: ak47auto
    [0:00:03]: ------ TRSGameTab.__initTabs(): Setup gametab properties
    [0:00:03]: -- TPlayer.login(): True
    [0:00:03]: -- TRSMinimap._getSymbolColor()
    [0:00:03]: ---- Loaded symbol: Fishing Spot
    [0:00:03]: ---- Found symbol bitmap 42
    [0:00:03]: -- TRSMinimap._getSymbolColor(): -1
    [0:00:04]: PLAYER: Find_PlayerLocation: Ak47Auto: Location = Bank
    - My Scripts (Beginning to Update to SRL 6) -

  4. #4
    Join Date
    Dec 2007
    Posts
    2,766
    Mentioned
    2 Post(s)
    Quoted
    37 Post(s)

    Default

    Quote Originally Posted by iBlank View Post
    Thanks for the quick response!

    So far everyone script has done it for me. But Coh3n's script below can be an example:

    http://villavu.com/forum/showthread.php?t=47111

    It posts information like this. Maybe this is just normal now but it use to not be the case?


    [..]
    I see, that's just normal and very useful for scripters to find where a script messes up and stuff.
    You should leave it the way it is in my opinion, but if it is really bugging you, just do ClearDebug;'s and call for progress reports more often in the script I guess ^^.

    (Though I agree that his form of debugging is hardcore ._.)

  5. #5
    Join Date
    Mar 2012
    Posts
    426
    Mentioned
    0 Post(s)
    Quoted
    9 Post(s)

    Default

    Quote Originally Posted by Dervish View Post
    I see, that's just normal and very useful for scripters to find where a script messes up and stuff.
    You should leave it the way it is in my opinion, but if it is really bugging you, just do ClearDebug;'s and call for progress reports more often in the script I guess ^^.

    (Though I agree that his form of debugging is hardcore ._.)
    Thanks!

    So there is no way to just turn it off though? Like I currently have a script that runs 6 hours consistently so I don't really want or need the additional debug info. I have added the clear debugs and called the progress report, but without literally clearing it and calling the progress report after every action, the progress report is pushed way up within seconds...
    - My Scripts (Beginning to Update to SRL 6) -

  6. #6
    Join Date
    Jul 2013
    Location
    An horse
    Posts
    300
    Mentioned
    9 Post(s)
    Quoted
    120 Post(s)

    Default

    Quote Originally Posted by iBlank View Post
    Thanks!

    So there is no way to just turn it off though? Like I currently have a script that runs 6 hours consistently so I don't really want or need the additional debug info. I have added the clear debugs and called the progress report, but without literally clearing it and calling the progress report after every action, the progress report is pushed way up within seconds...
    Simba Code:
    DisableSRLDebug := true;
    Currently lurking while messing around with dll injection. Will continue contributing after I finish my quest.

  7. #7
    Join Date
    Mar 2012
    Posts
    426
    Mentioned
    0 Post(s)
    Quoted
    9 Post(s)

    Default

    Quote Originally Posted by Foundry View Post
    Simba Code:
    DisableSRLDebug := true;
    Exactly what I was looking for. Thank you so much.

    Edit:

    Looks like that won't even let my progress report print haha.

    If anyone else is curious, my solution is to use

    Simba Code:
    DisableSRLDebug := True;
    ClearDebug;

    before I enter into my main loop. Then my main loop has

    Simba Code:
    DisableSRLDebug := False;
    ClearDebug;
    PrintReport;
    DisableSRLDebug := True;

    This keeps all the other debug info out of the box except for my most recent progress report. Thanks for the help guys.
    - My Scripts (Beginning to Update to SRL 6) -

  8. #8
    Join Date
    Jan 2012
    Posts
    1,596
    Mentioned
    78 Post(s)
    Quoted
    826 Post(s)

    Default

    Quote Originally Posted by iBlank View Post
    Exactly what I was looking for. Thank you so much.

    Edit:

    Looks like that won't even let my progress report print haha.
    no no no. put
    Simba Code:
    disableSRLDebug = true;
    /before/ the
    Simba Code:
    setupSRL;
    line.

  9. #9
    Join Date
    Mar 2012
    Posts
    426
    Mentioned
    0 Post(s)
    Quoted
    9 Post(s)

    Default

    Quote Originally Posted by Turpinator View Post
    no no no.
    Hmmm. Still didn't print my progress report when I moved it in front of setupSRL but what I posted above works. I'll have to look at it tomorrow to see why that is. Off to bed for tonight. Thanks for the help guys!
    - My Scripts (Beginning to Update to SRL 6) -

  10. #10
    Join Date
    Dec 2011
    Location
    Hyrule
    Posts
    8,662
    Mentioned
    179 Post(s)
    Quoted
    1870 Post(s)

    Default

    Don't use print() for your progress report. Use writeln instead. Turning off debug turns off print functions I believe

  11. #11
    Join Date
    Jan 2012
    Posts
    1,596
    Mentioned
    78 Post(s)
    Quoted
    826 Post(s)

    Default

    Quote Originally Posted by Ashaman88 View Post
    Don't use print() for your progress report. Use writeln instead. Turning off debug turns off print functions I believe
    Nice catch. i was under the assumption he was using writeln. And correct, print() will not work if disableSRLDebug is true.

    Simba Code:
    procedure print(txt: string; debugType: TDebug = TDebug.DEBUG);
    var
      debugMSG: string;
    begin

    ...

      if (disableSRLDebug) then
        exit;

      if (debugType <> TDebug.LOG) then
        writeln(debugMSG);
    end;

  12. #12
    Join Date
    Mar 2012
    Posts
    426
    Mentioned
    0 Post(s)
    Quoted
    9 Post(s)

    Default

    Quote Originally Posted by Ashaman88 View Post
    Don't use print() for your progress report. Use writeln instead. Turning off debug turns off print functions I believe
    Quote Originally Posted by Turpinator View Post
    Nice catch. i was under the assumption he was using writeln. And correct, print() will not work if disableSRLDebug is true.
    Thank you both! I was using print. I switched over to WriteLn and it is working fine.
    - My Scripts (Beginning to Update to SRL 6) -

  13. #13
    Join Date
    Dec 2011
    Location
    Hyrule
    Posts
    8,662
    Mentioned
    179 Post(s)
    Quoted
    1870 Post(s)

    Default

    Quote Originally Posted by iBlank View Post
    Thank you both! I was using print. I switched over to WriteLn and it is working fine.
    Yeah it threw me off when I first started scripting SRL-6 too

  14. #14
    Join Date
    Mar 2012
    Posts
    426
    Mentioned
    0 Post(s)
    Quoted
    9 Post(s)

    Default

    Quote Originally Posted by Ashaman88 View Post
    Yeah it threw me off when I first started scripting SRL-6 too
    Trying to get the hang of it again! My college classes and internship have no relation to scripting or programming what so ever so I feel like I have forgotten all of it ha.
    - My Scripts (Beginning to Update to SRL 6) -

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
  •