sickle
05-24-2012, 11:13 AM
I have 2 issues:
1. I have it set up to try finding UpText and use a left-clicking method, and if that fails try a right-clicking method. But when I run it, when the left-clicking fails (which happens often), the backup method of right clicking never happens)
2. If it fails enough times I have set it to logout, but it doesn't. Why???
Thanks in advance for your expert help.
function FindLadder: Boolean;
var
LadColors: TIntegerArray;
x,y,i,a,m,curCTS,Fails,xi,yi,l: Integer ;
TPA: TPointArray;
ATPA: T2DPointArray;
begin
Result:= False;
if not LoggedIn or IsMoving then
Exit;
curCTS := GetColorToleranceSpeed;
LadColors:=[2381940];
l:=High(LadColors);
for i := 0 to l do
begin
if (IsMoving) then
Exit;
ColorToleranceSpeed(2);
SetColorSpeed2Modifiers(0.05,0.17);
FindColorsSpiralTolerance(MSCX,MSCY,TPA,LadColors[i],MSX1,MSY1,MSX2,MSY2,6 +(i*2));
ColorToleranceSpeed(curCTS);
if Length(TPA) = 0 then Exit;
ATPA:= TPAtoATPAEx(TPA,6,6);
m := High(ATPA);
for a:=0 to m do
begin
if MiddleTPAEx(ATPA[a],x,y) then
begin
MMouse(x,y,6,6);
for Fails := 0 to 2 do
begin
if (IsUpTextMultiCustom(['down','limb-down'])) then
begin
Wait(500+Random(200));
Mouse(x,y,2,2,mouse_Left);
Result:=True;
Exit;
end else
if (IsUpTextMultiCustom(['limb','down','limb-down','Ladder','adder'])) then
begin
Wait (500+Random(200));
Mouse (x,y,2,2,mouse_left);
end else
begin
Mouse(x,y,2,2,mouse_right);
ChooseOption('limb');
end;
end;
if (Fails >=2) then
Result:=False;
Exit;
Logout;
end;
end;
end;
end;
1. I have it set up to try finding UpText and use a left-clicking method, and if that fails try a right-clicking method. But when I run it, when the left-clicking fails (which happens often), the backup method of right clicking never happens)
2. If it fails enough times I have set it to logout, but it doesn't. Why???
Thanks in advance for your expert help.
function FindLadder: Boolean;
var
LadColors: TIntegerArray;
x,y,i,a,m,curCTS,Fails,xi,yi,l: Integer ;
TPA: TPointArray;
ATPA: T2DPointArray;
begin
Result:= False;
if not LoggedIn or IsMoving then
Exit;
curCTS := GetColorToleranceSpeed;
LadColors:=[2381940];
l:=High(LadColors);
for i := 0 to l do
begin
if (IsMoving) then
Exit;
ColorToleranceSpeed(2);
SetColorSpeed2Modifiers(0.05,0.17);
FindColorsSpiralTolerance(MSCX,MSCY,TPA,LadColors[i],MSX1,MSY1,MSX2,MSY2,6 +(i*2));
ColorToleranceSpeed(curCTS);
if Length(TPA) = 0 then Exit;
ATPA:= TPAtoATPAEx(TPA,6,6);
m := High(ATPA);
for a:=0 to m do
begin
if MiddleTPAEx(ATPA[a],x,y) then
begin
MMouse(x,y,6,6);
for Fails := 0 to 2 do
begin
if (IsUpTextMultiCustom(['down','limb-down'])) then
begin
Wait(500+Random(200));
Mouse(x,y,2,2,mouse_Left);
Result:=True;
Exit;
end else
if (IsUpTextMultiCustom(['limb','down','limb-down','Ladder','adder'])) then
begin
Wait (500+Random(200));
Mouse (x,y,2,2,mouse_left);
end else
begin
Mouse(x,y,2,2,mouse_right);
ChooseOption('limb');
end;
end;
if (Fails >=2) then
Result:=False;
Exit;
Logout;
end;
end;
end;
end;