PDA

View Full Version : Default Player function.



Wilio
08-29-2007, 06:56 PM
Here is a simple function I made(My first official function actually).
Result is true if the player is Default(bald, brown shirt, green pants)


{************************************************* ******************************
Function created by: Wilio.
Version: 1.6.1
Description: is he bald? wear a brown shirt and green pants?
************************************************** *****************************}
function DefaultPlayer: Boolean;
var
x,y,x1,y1,dist:Integer;
matched: Boolean;
begin
//Open equip screen
wait(450 + random(200));
Mouse(676,184,6,6,true);
wait(1200 + random(400))
Mouse(602, 428,6,6,true);
wait(1200 + random(400))
Mouse(98, 86,6,6,true);
wait(400 + random(100));
Mouse(105, 178,6,6,true);
wait(400 + random(100));
Mouse(109, 211,6,6,true);
wait(1200 + random(400))
//Then check color
if(findcolortolerance(x,y,6984648,179,72,356,301,4 )) //head
and (findcolortolerance(x1,y1,2245649,179,72,356,301,4 )) //pants
then
begin
writeln('colors found');
dist:= y1 - y;
if(dist >= 90) then
begin
writeln('distance matched');
matched := true;
end
else
begin
writeln('distance not matched');
matched := false;
end;
end
if(matched = true)
and(findcolortolerance(x,y,2647153,179,72,356,301, 4))
then
begin
result:= true
writeln ('Default player detected');
end
end;

Bourdou!
08-29-2007, 07:25 PM
Well, cant this just detect any brown, bald, and green in the screen? If it does, you should make sure it finds each color within a certain distance from another one, but I can't really tell :P

Wilio
08-29-2007, 07:31 PM
No worry. i have set the box on the player only.

Infantry001
08-29-2007, 08:31 PM
Good job. Now try to make it return the coords of any person with the default character onscreen ;)

Dan Cardin
08-29-2007, 08:33 PM
not very effective unless its used in a tut runner, other wise it wont work if theyre wearing armor, and if they have default in the runner then theres no way to change it, so not to be mean or anything its not a great function. What would make it better would be to make them take off all their armor and then check, but then there comes the problem of if they have a full inventory so the function once again starts being not great, but it would definately be a lot better if it took off all the armor first. Then it could be used as for if someone didnt want their script to auto with a default person.

sorry bout my long post but i wasnt really paying attention to the length when i was typing

Wilio
08-29-2007, 09:27 PM
You're right, that's why I edited the function.

{************************************************* ******************************
Function created by: Wilio.
Version: 1.5
Description: is he bald? wear a brown shirt and green pants?
************************************************** *****************************}
function DefaultPlayer: Boolean;
var
x,y,x1,y1,dist:Integer;
matched: Boolean;
begin
wait(450 + random(200));
MMouse(676,184,6,6);
wait(400 + random(100));
clickmouse(676,184,true);
wait(1200 + random(400))
MMouse(602, 428,6,6);
wait(400 + random(100));
clickmouse(602,428,true);
wait(1200 + random(400))
MMouse(98, 86,6,6);
wait(400 + random(100));
clickmouse(98,86,true);
MMouse(105, 178,6,6);
wait(400 + random(100));
clickmouse(105,178,true);
MMouse(109, 211,6,6);
wait(400 + random(211));
clickmouse(109,211,true);
wait(1200 + random(400))
//Then check color
if(findcolortolerance(x,y,6984648,179,72,356,301,4 )) //head
and (findcolortolerance(x1,y1,2245649,179,72,356,301,4 )) //pants
then
begin
writeln('colors found');
dist:= y1 - y;
if(dist >= 92) then
begin
writeln('distance matched');
matched := true;
end
else
begin
writeln('distance not matched');
matched := false;
end;
end
if(matched = true)
and(findcolortolerance(x,y,2647153,179,72,356,301, 4))
then
begin
result:= true
writeln ('Default player detected');
end
end;
this time it will go in equipment, remove the head, body, and legs. then it will check the distance between bald head and pants. if it's true. it will check the color of the shirt. Again if it's true, Result will be true.

Santa_Clause
08-29-2007, 10:01 PM
Don't use ClickMouse.

Use Mouse: (x, y, 5, 5, True);

TravisV10
08-29-2007, 10:03 PM
Don't use ClickMouse.

Use Mouse: (x, y, 5, 5, True);

Yes, clickmouse is obsolete. Mouse moves the mouse and clicks for you.

~Travis

Wilio
08-29-2007, 10:15 PM
it's fixed =D.

Infantry001
08-29-2007, 10:22 PM
But what if the person is not wearing armor? then, you look like a macro :D

Dan Cardin
08-29-2007, 10:35 PM
-.- just check for a different color at that point (i made myself a armor taking off function not released)

EDIT: and u can use gametab to get to the right tab, and what i would do is allow it to click anywhere inside the places for pants chest and head for example(if u dont want the extra vars for a different way)findcolortolerance(x,y,42352{thats a random color},{ur coords for the outside of the clickable area for each armor}, 300);