View Full Version : How would I click on this monster?
Ok, my queston is more complicated then it looks, pretty much I have any auto fighter that relies on finding the npc with 1 color. But, this also has the chance to fail so, How would I make it so if the bot finds 2 of the 3 colors within like a 50x40 area then it clicks in that area?
Example, click in the red box searching for the colors that are the red dots:
http://i45.tinypic.com/263xboj.jpg
footballjds
11-26-2012, 09:47 PM
Ok, my queston is more complicated then it looks, pretty much I have any auto fighter that relies on finding the npc with 1 color. But, this also has the chance to fail so, How would I make it so if the bot finds 2 of the 3 colors within like a 50x40 area then it clicks in that area?
Example, click in the red box searching for the colors that are the red dots:
http://i45.tinypic.com/263xboj.jpg
learn about TPA's and/or ATPA's (:
Tut section is GREAT
learn about TPA's and/or ATPA's (:
Tut section is GREAT
Looked at 2 TPA tut's they did not go into much detail about finding more then 1 color
footballjds
11-26-2012, 10:00 PM
Looked at 2 TPA tut's they did not go into much detail about finding more then 1 color
search for your two different colors and create two TPA's with the results. Then compare the two of them using ATPA's (:
search for your two different colors and create two TPA's with the results. Then compare the two of them using ATPA's (:
It's pretty hard for me to even get a remote understanding of TPA's when i can't even run the example without getting an error.
Runehack123
11-27-2012, 02:20 AM
Using CTS2/Simple TPA TuT:
http://villavu.com/forum/showthread.php?t=90767
With auto-colouring (or using ACA AutoColorAid) and ATPAs as mentioned above you can make object finding a lot more reliable.
As for common errors I recommend a look into the FAQ section:
http://villavu.com/forum/showthread.php?p=851555
Hope I helped in some way :(
cause
11-27-2012, 06:46 AM
Find the user "Runaway" in the members list and check the threads he has started, he has created a function which does exactly what you are looking for.
Find the user "Runaway" in the members list and check the threads he has started, he has created a function which does exactly what you are looking for.
Saw his thread. not going to learn a 250 line script, when in the end he says its not worth it because it can take up to 5000 ms to do. nty
Using CTS2/Simple TPA TuT:
http://villavu.com/forum/showthread.php?t=90767
With auto-colouring (or using ACA AutoColorAid) and ATPAs as mentioned above you can make object finding a lot more reliable.
As for common errors I recommend a look into the FAQ section:
http://villavu.com/forum/showthread.php?p=851555
Hope I helped in some way :(
Currently testing out "tpas"... working worse then finding 1 color and clicking it... always clicks something thats not the sekeletn 60% of the time. we as 1 color it did it 3% of the time.
footballjds
11-27-2012, 09:22 PM
rjj no need to double post. but try using ACA (:
rjj no need to double post. but try using ACA (:
I give up. No point.
What am i doing wrong here?
procedure ClickNPC;
var
X, Y,cx,cy: Integer;
begin // kill npc
WriteLn('Attacking skeleton...');
if FindColorTolerance(X, Y, NPC, tleft, tright, bleft, bright, tolerence) then
begin
GetMousePos(cx,cy);
MouseSpeed:=40;
mmouse(x, y,1,1);
Wait(20 + Random(50));
ClickMouse(X, Y, Mouse_Left);
if FindColorTolerance(x,y,65535,cx-10,cy+10,cx+10,cy-10,5) then
begin
ClickNPC;
end;
WriteLn('Attacked skeleton!');
CheckCombat;
end;
end;
Error: Exception: You passed wrong values to a finder function: ys > ye (116,96). at line 67
The following bitmaps were not freed: [0]
One your looking for a single color.
With TPAs you could group all colors of the same shade then search them by Size. Which is 100% better than what you have. Look for the TPA tuts everyone has been mentioning.
One your looking for a single color.
With TPAs you could group all colors of the same shade then search them by Size. Which is 100% better than what you have. Look for the TPA tuts everyone has been mentioning.
I did. And I made one. And it kept clicking the wrong thing.
footballjds
11-27-2012, 09:55 PM
I did. And I made one. And it kept clicking the wrong thing.
share your code. What did you use to obtain the color? Did you try using Auto color Aid?
share your code. What did you use to obtain the color? Did you try using Auto color Aid?
yea
program new;
{$i srl/srl.simba}
Procedure FindSkele;
var
tmpCTS,i,l,r,x,y,counter:integer;
SkeletonTPA:TPointArray;
begin
tmpCTS := GetToleranceSpeed;
SetColorToleranceSpeed(1);
SetToleranceSpeed2Modifiers(0.16, 1.10);
FindColorTolerance(x, y,1385045, MSX1, MSY1, MSX2, MSY2, 1);
SetColorToleranceSpeed(tmpCTS);
SetToleranceSpeed2Modifiers(0.02, 0.02);
l := High(SkeletonTPA)
marktime(counter);
for i:= 0 to l do
begin
r := random(l);
wait(randomrange(10,50));
mmouse(SkeletonTPA[r].x,SkeletonTPA[r].y,2,2);
if waituptext('Skele',20) then
Break;
if timefrommark(counter) > 3000 then
begin
writeln('failed to find skeleton...');
Terminatescript;
end;
end;
writeln('we found the skeleton.');
MouseSpeed:=40;
mmouse(x,y,1,1);
clickmouse2(mouse_left);
end;
begin
SetupSRL
FindSkele;
end.
I'm not going to spoonfeed you a function, so read this carefully, and if you don't understand a part of it ask.
First thing I do when I look at finding something on the screen is check the most common unique color of the object. For a skeleton I would say that its the helmet/shield colors. I split the TPA of the object by distance(usually no more than 5), then I get the count of those colors on the object and use that as my bounds for including a TPA or not. Then I get a random point in the largest TPA and that is my clicking point. I move the mouse to verify the object and then do the clicking action(left or menu).
If the object still isn't being found well, I will add the main color of the skeleton and get a shit-ton of samples from different clients and worlds, so that I get the exact color profile of the object. Also, use CTS 2 for now.
CRASH_OVERRIDE
12-01-2012, 11:32 PM
If yuo cant use TPAs then use Auto Color Aid2(ACA2)
A video by Yohojo on how to do so for beginners is here:
http://www.youtube.com/watch?v=98wVrr6GwyU
He goes into very high detail on how to use this from start to finish!.
Powered by vBulletin® Version 4.2.1 Copyright © 2024 vBulletin Solutions, Inc. All rights reserved.