Log in

View Full Version : Help please



Xx pk xX
05-02-2007, 05:14 PM
Hi, I have a few questions.
I am making my first (noobish) script. Please say me how i can make a best human finding and clicking procedure.
Here is my procedure:


...
repeat
if (FindColorTolerance(x, y, HumanColour, MSX1, MSY1, MSX2, MSY2, 10))
then
begin
Mouse(x, y, 1, 1, false);
ClickOption('Trade', 1);
Flag;
wait(500 + random(200));
...

But manytimes when it find colour, it will click near human, so it can t see human :
http://img163.imageshack.us/img163/7944/humanxx5.jpg

How can i make a better procedure whitch when find human, it will click on him (always on him, not near him)? I need something, what is not lagging :P .

And another question:
How can i make procedure, with witch i will can click on symbol in MM, but it will click to building, not near building(or something what will only find me building and click inside building). Here is example what i want:

http://img444.imageshack.us/img444/2293/tanntb5.jpg

Red color - this is where i want to click
blue color- this is where i don t want to click (because it will click near building, so it will can not find human)

here is procedure whitch i am using:


...
procedure ToTanner;
begin
if(GetSymbolColor(x,y,'tanner')<>0)then
begin
Writeln('Found tanner shop')
Mouse(x,y,5,5,True)
Flag;
End
else
begin
if(FindMMColorTol(x,y,21593,10))then
begin
Mouse(x,y,5,5,True)
Flag;
end;
end;
end;
...

I will ask later for more questions, i want lear it :P .
Thank You for ansvears.

alach11
05-02-2007, 11:04 PM
For the finding a person I would do this:
if(findobj3(xx,yy,'Tan',1586243,5))then
begin
Mouse(xx,yy,2,2,False);
Flag;
chooseoption(x,y,'Trade');

Replace the color after 'Tan' with the tanners color, 5 is the tolerance.

Xx pk xX
05-03-2007, 02:38 PM
Ok, thank You
It looks great, but there is something wrong :(
If i will run script it will write me this:

Line 55: [Error] (14401:13): Unknown identifier 'xx' in script....
So i deleted xx and yy and i wrote only x and y there.

But it finds person, movemouse on him, but it is not trading with him. It only move mouse on him and do nothing. Why?

Thank You for help

Fearlesssss
05-04-2007, 04:34 PM
Xx pk xX, You have to put this in your script like Alach11 said:


if(findobj3(xx,yy,'Tan',1586243,5))then
begin
Mouse(xx,yy,2,2,False); //Dont remove xx, yy!! Just put this in your script
Flag; // like Alach said!!!
chooseoption(x,y,'Trade');

But now put in the variables this:


var //this was alreaddy there:p
x, y:integer; //this too i think
xx, yy:integer; //This is what you have to put in!

If your having other probs with this you can ask me;)