SRL Archive - OSR Help

Pot of Flour DTM


Bad Boy JH

2010-05-27 21:18:20

I am having trouble making a cake mixer script, basically it takes the ingrediants (egg, pot of flour, cake tin, and Bucket of milk) and it mixes them, banks and repeats. now getting DTMs for the egg, was easy, the cake tin and bucket of milk was harder, as its got to distinguish from an uncooked cake and an empty bucket, but the difference is easy, large area, and I put the main point in there. The Pot of flour is much harder, the numbers cover most of the visible flour, and the only tolerance level, 35, which was high enough to detect the flour, was too high, and it also detected some water runes, and the dungeoneering ring.
I am using WithdrawItemEx, so the Index check makes it OK after the first time.
What shoud I do with the DTM?
Using Simba + Reflection

i luffs yeww

2010-05-27 22:07:52

Why not just use a bmp?

Blumblebee

2010-05-28 00:36:37

use color!


for i := 1 to 28 do
....
n := InvBox(I);
if FindColor(PotColor, n.x1, etc) then
if FindColor(FlourTopColor, n.x1, etc) then
begin
writeLn('pot of flour!');
result := I;
end;

Bad Boy JH

2010-05-28 03:10:37

Im looking for it in the bank, so I can withdraw.

Tim0suprem0

2010-05-28 03:51:20

Can you just do the black outline of the pot, with one point on the white flour to distinguish from normal pots?

Narcle

2010-05-28 04:07:31

From: Tim0suprem0
Can you just do the black outline of the pot, with one point on the white flour to distinguish from normal pots?


Except that the quantity (yellow text) might cover over the upper points in the bank.

Personally I'd do a mixed search with this. Find the dtm of the flour pot (using same for both) then do a color search to see if white is in it then you know if its full of flour or not. And you can always to a UpText check too.

Boreas

2010-05-28 11:18:43

The black outline looks different to me. Just use a regular black outline DTM and make sure you get enough points on the bottom curves. With flour has 3 steps that are 2 pixels wide. Without flour has 4 steps, that alternate from being 1 pixel wide and 2 pixels wide.

Black outline color count of box below text line may be different also, I didn't check. If BlackLists are still around with a full net setting, that would work also. So either way, assuming pot of water/other isn't there or also has a different outline, for pot of flour vs empty pot you don't need to look at colors, just the outline.

Edit: never mind second bit, Withdraw supports DTMs, so just use a detailed black outline DTM.

i luffs yeww

2010-05-28 16:48:32

^ :3 I absolutely love blacklists. ^^ I'm really glad you did stuff for it a few years ago. :D

Anyway. Yeah, I'd say a bmp or a simple color check. :) Or a DTM and a color check. Or a blacklist and color check. Or many other things. :)

nielskool

2010-05-28 18:30:30

Can you make a screenshot of it so i can try my program?
In the screenshot must be as much as possible wrong items and the pot of flour and the pot without flour.

//edit
this DTM works for me: 78DA634C6362609065644006FE16CA601A26CA980C54A3885F0D0063AD0266
2 points are enough to distinguish a pot with flour of a pot without flour

Coh3n

2010-05-29 19:53:16

Why not just find the DTM and look for the colour in a box around where it was found. You can have it check the whole bank section for multiple DTMs (it will pick up the empty pot also), then just look for the colour where it was found.


function isPotFilled(var x, y): Boolean;
var
dtmPot: Integer;
begin
if (not loggedIn) then
exit;

dtmPot := DTMFromString('');
if (findDTM(dtmPot, tX, tY, MBX1, MBY1, MBX2, MXY2)) then
if (findColorTolerance(x, y, flourColor, tX - 20, tY - 20, tX + 20, tY + 20, 10)) then
begin
writeln('Found flour!');
result := true;
end;
end;

Bad Boy JH

2010-05-29 21:49:44

A *small* (5x5) bmp does the trick, thanks for the advice guys…