SRL Archive - General Botting Help

Simple Debug Question


iBlank

2014-05-27 21:51:49

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?

Dervish

2014-05-27 21:54:11

Can you post scripts and "debug information" examples ? :)

iBlank

2014-05-27 21:58:02

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

Dervish

2014-05-27 22:06:19

From: iBlank
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 ._.)

iBlank

2014-05-27 22:11:46

From: Dervish
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…

Foundry

2014-05-27 22:39:21

From: iBlank
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…


DisableSRLDebug := true;

iBlank

2014-05-27 22:42:58

From: Foundry
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


DisableSRLDebug := True;
ClearDebug;

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


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.

Turpinator

2014-05-27 23:21:47

From: iBlank
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
disableSRLDebug = true;
/before/ the
setupSRL;
line.

iBlank

2014-05-27 23:55:56

From: Turpinator
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!

Ashaman88

2014-05-28 08:52:37

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

Turpinator

2014-05-28 09:11:33

From: Ashaman88
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.

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

...

if (disableSRLDebug) then
exit;

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

iBlank

2014-05-28 12:49:55

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


From: Turpinator
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.

Ashaman88

2014-05-28 14:18:49

From: iBlank
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

iBlank

2014-05-28 17:35:09

From: Ashaman88
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.