PDA

View Full Version : Question about ACA (sorta)



stopkiller
12-01-2014, 06:00 AM
So I have the skeleton of my mist rune making script up and running but its pretty dirty. One thing I wanted to ask is, I have my procedure for finding the alter and the exit portal set up at such

procedure clickwater();
var
x, y, i: integer;
begin
repeat
mainscreen.findObject(x, y, 6511456, 3, colorSetting(2, 0.90, 0.55), mainscreen.playerpoint, 50, 50, 10, ['alisman', 'ltar'], MOUSE_MOVE);
wait(randomRange(1000, 2000));
inc(i);
until (i >= 3);

fastClick(MOUSE_LEFT)

end;

Obviously this is not the most efficient way to do things. During the repeat until loop, how can I get it to move on to the next step if it successfully finds what its looking for? In TheMayor's tutorial he has it like this for opening a bank deposit box
repeat
mainscreen.findObject(x, y, 5270142, 5, colorSetting(2, 0.07, 0.15), mainscreen.playerPoint, 30, 50, 50, ['eposit', 'box'], MOUSE_LEFT);
wait(randomRange(1000, 2000));
inc(i);
until depositBox.isOpen() or (i >= 15);

what is the equivalent of "depositBox.isOpen()" for successfully finding the object i'm using ACA to look for?

tls
12-01-2014, 06:16 AM
FindObject is a boolean function. Use it instead of isOpen

stopkiller
12-01-2014, 09:15 AM
FindObject is a boolean function. Use it instead of isOpen

I'm not quite sure I understand forgive me I am but a noob

Use FindObject instead of isOpen, like, "depositbox.findObject"? Or like "mainscreen.findobject()" or "mainscreen.findobject() = True"?

EDIT*I fixed it using isMouseOverText

masterBB
12-01-2014, 09:18 AM
I'm not quite sure I understand forgive me I am but a noob

Use FindObject instead of isOpen, like, "depositbox.findObject"? Or like "mainscreen.findobject()" or "mainscreen.findobject() = True"?

while(not(mainscreen.findObject(x, y, 5270142, 5, colorSetting(2, 0.07, 0.15), mainscreen.playerPoint, 30, 50, 50, ['eposit', 'box'], MOUSE_LEFT))) do
begin
wait(randomRange(1000, 2000));
inc(i);
if(i >= 15) then
exit;
end;

fastler
12-01-2014, 03:39 PM
I'm not quite sure I understand forgive me I am but a noob

Use FindObject instead of isOpen, like, "depositbox.findObject"? Or like "mainscreen.findobject()" or "mainscreen.findobject() = True"?

EDIT*I fixed it using isMouseOverText

Refer to masterBB's post, I was also going to suggest something similar.
But to answer that question "mainscreen.findObject" returns true if it is successful and false if it isn't.
So you can place it directly into the "until" statement in place of isOpen()
But then it would perform a wait before even attempting findObject()
In this case a "while" loop, as suggested by masterBB, would be more fitting.
findObject() will do the job of finding an object by the colors additionally performing a mouse action (none,move,left,right,middle) if the uptext matches.