SRL Archive - Jr. Member General Help and Discussion

Development/debugging techniques


bonsai

2013-11-07 07:26:47

I was curious if anyone had tips to share on methods for debugging and playing with things while developing new logic. I'm primarily thinking about color finding and boxing. For example, is it better to use dist or w/h for a given purpose. Would split/cluster work better than tpa2atpa? What is the result if more than one color is used? etc.

I've been mostly running little hack scripts against a live runescape session and using smartImage.draw type functions to display the results. It's very clumsy since you have to keep poking the client to stay logged in. And I would rather not be logged in (or worse logging in over and over).

I've seen some posts using a debug window but I haven't spent time figuring out it's use and value. I haven't noticed documentation on it.

It would be useful to capture a bitmap/screenshot and be able to run many scenarios against it to see what works best. With the ability to draw on it so you can check out the benefits of one approach over another.

What do you folks who have been around the block do during the development cycle?

TIA for the input.

Ian

2013-11-07 08:00:39

There are various drawing on SMART functions here: http://docs.villavu.com/srl-6/drawing.html
You can also have Simba paint onto a debug window (a new one will open) using some of the debug functions like debugTPA and debugATPA here: http://docs.villavu.com/srl-6/debug.html

Before SRL6 I used the SMART drawing functions, but after the move to OGL mode / SMART8.3 my SMART drawing doesn't work so I use debugATPA.

SMART drawing should work for you though, I think it's just me that SMART drawing doesn't work.

As for color gathering and checking, ACA is the thing to use.

As for is w or h better, it depends what you're trying to find. I think cluster is faster than split, but I haven't tested them against each other after being satisfied with cluster's speed.

bg5

2013-11-07 08:21:38

You can make screenshot, paste it to mspaint and target it as a client…

…Do TPA searches and debug them in debug window, it's not realy hard:

var w,h,bmp:integer;
begin
GetClientDimensions(w,h);
bmp := BitmapFromClient(0,0,w-1,h-1);
{
draw your ATPAs on bmp e.x. DrawATPABitmap()
}
DisplayDebugImgWindow(w,h);
DrawBitmapDebugImg(bmp);
end.

or

you can use my ETL to draw things on MSPaint:
http://villavu.com/forum/showthread.php?t=106263

Ashaman88

2013-11-07 09:10:06

Check out some of my old scripts - they usually have pretty good debug modes (not sure if all debug functions I used work in srl-6, as BMW was saying)

Enslaved

2013-11-07 11:29:26

Would be an idea to add a just in time debugging system into the compiler, it could also be simply done by adding breakpoints into your scripts.