SRL Archive - S.M.A.R.T.

Smart and DTMs


Flight

2011-03-01 22:34:20

Is anyone else having trouble with finding DTMs or Bitmaps on Smart? Every time I open a new Smart client my previous bitmap/DTM is broken and I have to define a new one, every time… My graphics settings do not change, infact nothing changes except loading up a new Smart client. This is pretty aggravating. :angry: Any ideas? :confused:

NCDS

2011-03-01 23:55:36

Post your function. Could just be how your making them, or searching for them.

MSI has had the same DTM's for a looong time now though.

Flight

2011-03-02 00:33:56

Eh I gave up on trying to use bitmaps on inventory item finding, I'm back to using single-lined colors, as the prove to be more stable then anything I've ever encountered. They work fine now but I think might break in the future. Now I just need to come up with a more efficient way of finding objects, in my case trees. Colors work, but the same colors are used any some many objects surrounding what you're looking for. Eg: Searching for normal trees, I still have issues tracking near-by goblins, bushes/furns on the ground, the grass color, hell even the mini-map even after I told the script NOT to search outside of the main window parameters.

I tried even making the smallest bitmap, composed of 2 or 3 pixels of the tree's 'texture', didn't work, same with making a DTM of a tree. It seems like everyone is relying on reflection now days for things like this, so it's very hard to find someone who has done accurate colors recently, I hope I'm not the only one who doesn't depend on reflection. :(

Echo_

2011-03-02 14:16:30

From: Flight
Eh I gave up on trying to use bitmaps on inventory item finding, I'm back to using single-lined colors, as the prove to be more stable then anything I've ever encountered. They work fine now but I think might break in the future. Now I just need to come up with a more efficient way of finding objects, in my case trees. Colors work, but the same colors are used any some many objects surrounding what you're looking for. Eg: Searching for normal trees, I still have issues tracking near-by goblins, bushes/furns on the ground, the grass color, hell even the mini-map even after I told the script NOT to search outside of the main window parameters.

I tried even making the smallest bitmap, composed of 2 or 3 pixels of the tree's 'texture', didn't work, same with making a DTM of a tree. It seems like everyone is relying on reflection now days for things like this, so it's very hard to find someone who has done accurate colors recently, I hope I'm not the only one who doesn't depend on reflection. :(


Have you tried FindObjCustom?

FindObjCustom(var cx, cy: Integer;Text: TStringArray;Color: TIntegerArray;Tol: Integer): Boolean;

So you would use something like:

  procedure FindTree;
var
x, y: Integer;
begin
if FindObjCustom(x, y, ['Tre', 'ree'], [1464664, 545654, 466657], 10) then
Mouse(x, y, 2, 2, true);
end;

Flight

2011-03-02 19:25:56

Unfortunately I've had some problems with that function, it seems to disregard the uptext as I've had it click bushes near a "Climb Wall" option. I guess if I really want it to be efficient I'll have to use a little reflection for object finding only.

PatDuffy

2011-03-02 19:35:10

I had the same problem you did, except I seemed to fix it for myself. While trying to cut regular trees in the small patch northwest of draynor bank, I discovered this function and it helped me tremendously. I previously had used FindObjCustom but for some reason it kept clicking on the trapdoor nearby, leading my characters to their deaths in the dungeon below.

I have a 3 color array for RegColor, and i prefer to use 3 different uptexts to make sure its really the tree. This function searches from the center outwards(in this case the center of the mainscreen) searching in boxes of specified pixel width(in this one the '40'). You can also add tolerance, as i used 30 here.


if FindObjEx(cx,cy,['hop','dow','ree'],[RegColor[i]],30,40,MSX1,MSY1,MSX2,MSY2)then
begin
case(Random(100)) of
0..40: begin
Mouse(cx,cy,3,3,false);
ChooseOption('hop');
Writeln('Chopping Tree');
Wait(1000+Random(500));
Fails := 0;
Break;
end;
41..80: begin
Mouse(cx,cy,2,2,true);
Writeln('Chopping Tree');
Wait(1000+Random(500));
Fails := 0;
Break;
end;
81..99: AntiBan;
end;

KingKong

2011-03-02 19:43:35

You could use tpa object finding.

Flight

2011-03-02 19:50:03

I think I would understand it more if I knew where you were getting "MSX1,MSY1,MSX2,MSY2". I thought these were the reflection values of your player's current X/Y, how could they be found via color?

Edit: I do have another theory now after thinking about it. Maybe a FindColorSpiral count from the center outwards (finding the closest object), and when that color is found I could use something like the 'SimilarColors' function in that small region to look for multiple colors, as trees have more quite an array of colors as opposed to solidly-colored objects. Either that or I could use "GetColorsBox" and look for unique colors used in trees only, and that would give me the colors I need to be searching for, probably with a very low (if any) tolerance.

NCDS

2011-03-02 19:57:37

From: Flight
"MSX1,MSY1,MSX2,MSY2"


That's SRL's values to represent the Coordinates of the RS main screen.

Flight

2011-03-02 20:14:10

Ha… well I wish I'd have known that before, here I've been getting values manually. :(