can there be a function like this one? FindColoredAreaTolerance is great but is limited to searcharea.. any like it but with more flexable perameters???
im tring to find an area of color thats about 20 by 5 so it needs to be specified...
can there be a function like this one? FindColoredAreaTolerance is great but is limited to searcharea.. any like it but with more flexable perameters???
im tring to find an area of color thats about 20 by 5 so it needs to be specified...
FindColoredArea should work just fine for what you are trying to do.
It is not at all limited...
because you can specify the co-ordinates.
Last edited by Abu; 04-20-2012 at 06:41 AM.
Simply a GOD beast...
My Tutorials
yeah i thought about that one but it still uses area and thats not great for rectangles... i think findobjex has a custimized search function something like that but yeah...
what i am trying to do is detect weather the door is closed or open by grabbing the the top color of the doors when they are closed... it makes a long brown line...
Last edited by Abu; 04-22-2012 at 12:31 PM.
Simply a GOD beast...
My Tutorials
okay okay yeah this leads me to beleive that the cordinates arent static... which is a good thing....
so your saying even though the cooradinates are at the top left of the screen it still will retain the shape but also find it at bottom left?
Yes, yes it will.
Simply a GOD beast...
My Tutorials
my worry is that the door is not always going to be in the same place...
so having small coords. will not alway work...
uh.. yeah... uhm hmm....
here is my debug...
as you can see what i am looking for...
many ways but mainly just a simble boolean is all.........
You can use co-ordiantes which would create a box slightly bigger than the door. That way if you move left and right the door will still be within those co-ordinates. It's better than using the whole screen....
Simply a GOD beast...
My Tutorials
FindObjTPA(X, Y, {color}, {tol}, {CTS}, {ObjWidth}, {ObjHeight}, {mincount}, {uptext})
By using CTS 2 and ACA you can get it pretty accurate
I also made the code for you:
You must choose high values for the FindObjTpa because it can possibly find other objects otherwise that have different uptexts. This one with 100x5 px works greatSimba Code:procedure Test;
var
X, Y: integer;
begin
ColorToleranceSpeed(2);
SetColorSpeed2Modifiers(0.17, 1.15);
if FindObjTPA(X, Y, 2172974, 4, 2, 100, 5, 250, ['Open', 'Open door']) then
begin
ClickMouse2(1);
WriteLn('We have clicked on the door, because it has been closed');
end else
begin
WriteLn('The door is still open');
end;
end;![]()
Last edited by J J; 04-20-2012 at 07:58 PM.
true abu but what if im not to the left or right sometimes? it can hic-up at times... but hmm...
and findobjex it good but i dont want the mouse to spazz around the screen each time i do the door check lol...
like i said just a simple boolean... and abu is on the right track =]]
but man too bad objex didnt have to have up text and too bad it cannot just match that shape everytime...
You should try that code because it doesn't "spazz around the screen" at all. You just have to fill in the correct numbers to make it work properly.
Step 1: Use 'FindColorsSpiralTolerance' (preferably with CTS 2 + modifiers) to get a TPA of all of your "door colors".
Step 2: Use 'SplitTPAEx' to split that TPA into 20x5 TPAs.
Step 3: For each box, get the middle point of each TPA (middleTPA), move the mouse to that middle point, search for the door's uptext.
Step 4: If correct uptext is found for one of your TPAs, break the loop, click/right-click the door.
Easy peasey.
Edit:
Refer to this thread for all TPA-related methods.
Current projects:
[ AeroGuardians (GotR minigame), Motherlode Miner, Blast furnace ]
"I won't fall in your gravity. Open your eyes,
you're the Earth and I'm the sky..."
There are currently 1 users browsing this thread. (0 members and 1 guests)