Element17
04-11-2012, 09:00 PM
Is there anyway to pick priority when choosing between to objects? I have object X, and Y. I want it to pick both up but I want to pick X first then Y. Then wait for X to reaper and pick it up then same thing for Y.
function XC: Integer;
var
arP: TPointArray;
arC: TIntegerArray;
tmpCTS, i, arL: Integer;
begin
tmpCTS := GetColorToleranceSpeed;
ColorToleranceSpeed(2);
SetColorSpeed2Modifiers(0.01, 0.32);
FindColorsSpiralTolerance(MSCX, MSCY, arP, 31861257524088, MSX1, MSY1, MSX2, MSY2, 11);
if (Length(arP) = 0) then
begin
//Writeln('Failed to find the color, no result.');
ColorToleranceSpeed(tmpCTS);
SetColorSpeed2Modifiers(0.2, 0.2);
Exit;
end;
arC := GetColors(arP);
ClearSameIntegers(arC);
arL := High(arC);
for i := 0 to arL do
begin
Result := arC[i];
//Writeln('AutoColor = ' + IntToStr(arC[i]));
Break;
end;
ColorToleranceSpeed(tmpCTS);
SetColorSpeed2Modifiers(0.2, 0.2);
if (i = arL + 1) then
//Writeln('AutoColor failed in finding the color.');
end;
Function TakeX: Boolean;
Var
X, Y, PlusOne, XCounter: Integer;
Begin
If Not LoggedIn then
Exit;
MarkTime(TooLong);
FindNormalRandoms;
PlusOne:= InvCount +1;
X:=MSCX;
Y:=MSCY;
If (FindObjCustom(X, Y, ['Take X', 'ake X', 'x'], [XC, XC], 7))Then
Begin
StatsGuise('We found X');
GetMousePos(X, Y);
Case Random(2) of
0: Mouse(X, Y, 5, 5, True);
1: Begin
Mouse(X, Y, 5, 5, False);
WaitOption('Take', 500);
End;
End;
Flag;
MarkTime(XCounter);
If (TimeFromMark(Toolong) > 45000) Then
FailSafe('Could not find X');
Repeat;
If (TimeFromMark(Toolong) > 45000) Then
FailSafe('Could not find X');
FindNormalRandoms;
StatsGuise('AntiBan and Waiting');
Antiban;
Wait(100);
If InvCount=PlusOne Then
Writeln('X Taken');
Until (InvCount=PlusOne) or (TimeFromMark(XCounter) > 5000)
End;
End;
function YC: Integer;
var
arP: TPointArray;
arC: TIntegerArray;
tmpCTS, i, arL: Integer;
begin
tmpCTS := GetColorToleranceSpeed;
ColorToleranceSpeed(2);
SetColorSpeed2Modifiers(0.03, 0.11);
FindColorsSpiralTolerance(MSCX, MSCY, arP, 237656545779841, MSX1, MSY1, MSX2, MSY2, 8);
if (Length(arP) = 0) then
begin
//Writeln('Failed to find the color, no result.');
ColorToleranceSpeed(tmpCTS);
SetColorSpeed2Modifiers(0.2, 0.2);
Exit;
end;
arC := GetColors(arP);
ClearSameIntegers(arC);
arL := High(arC);
for i := 0 to arL do
begin
Result := arC[i];
//Writeln('AutoColor = ' + IntToStr(arC[i]));
Break;
end;
ColorToleranceSpeed(tmpCTS);
SetColorSpeed2Modifiers(0.2, 0.2);
if (i = arL + 1) then
//Writeln('AutoColor failed in finding the color.');
end;
Function TakeY: Boolean;
Var
X, Y, PlusOne, YCounter: Integer;
Begin
If Not LoggedIn then
Exit;
MarkTime(TooLong);
FindNormalRandoms;
PlusOne:= InvCount +1;
X:=MSCX;
Y:=MSCY;
If (FindObjCustom(X, Y, ['Take Y', 'ake y', 'Y'], [YC, YC], 7))Then
Begin
StatsGuise('We found a Y');
GetMousePos(X, Y);
Case Random(2) of
0: Mouse(X, Y, 5, 5, True);
1: Begin
Mouse(X, Y, 5, 5, False);
WaitOption('Take', 500);
End;
End;
Flag;
MarkTime(YCounter);
If (TimeFromMark(Toolong) > 45000) Then
FailSafe('Could not find Y');
Repeat;
If (TimeFromMark(Toolong) > 45000) Then
FailSafe('Could not find Y');
FindNormalRandoms;
StatsGuise('AntiBan and Waiting');
Antiban;
Wait(100);
If InvCount=PlusOne Then
Writeln('Y Taken');
Until (InvCount=PlusOne) or (TimeFromMark(YCounter) > 5000)
End;
begin
SetupSRL;
ClearDebug;
TakeX;
TakeY;
end.
End;
All it does is take Y not X and Y or even X. Any reason for this?
I changed the name to X and Y as I hope not to give away what I am scripting for just yet. Would like it to be a surprise!
function XC: Integer;
var
arP: TPointArray;
arC: TIntegerArray;
tmpCTS, i, arL: Integer;
begin
tmpCTS := GetColorToleranceSpeed;
ColorToleranceSpeed(2);
SetColorSpeed2Modifiers(0.01, 0.32);
FindColorsSpiralTolerance(MSCX, MSCY, arP, 31861257524088, MSX1, MSY1, MSX2, MSY2, 11);
if (Length(arP) = 0) then
begin
//Writeln('Failed to find the color, no result.');
ColorToleranceSpeed(tmpCTS);
SetColorSpeed2Modifiers(0.2, 0.2);
Exit;
end;
arC := GetColors(arP);
ClearSameIntegers(arC);
arL := High(arC);
for i := 0 to arL do
begin
Result := arC[i];
//Writeln('AutoColor = ' + IntToStr(arC[i]));
Break;
end;
ColorToleranceSpeed(tmpCTS);
SetColorSpeed2Modifiers(0.2, 0.2);
if (i = arL + 1) then
//Writeln('AutoColor failed in finding the color.');
end;
Function TakeX: Boolean;
Var
X, Y, PlusOne, XCounter: Integer;
Begin
If Not LoggedIn then
Exit;
MarkTime(TooLong);
FindNormalRandoms;
PlusOne:= InvCount +1;
X:=MSCX;
Y:=MSCY;
If (FindObjCustom(X, Y, ['Take X', 'ake X', 'x'], [XC, XC], 7))Then
Begin
StatsGuise('We found X');
GetMousePos(X, Y);
Case Random(2) of
0: Mouse(X, Y, 5, 5, True);
1: Begin
Mouse(X, Y, 5, 5, False);
WaitOption('Take', 500);
End;
End;
Flag;
MarkTime(XCounter);
If (TimeFromMark(Toolong) > 45000) Then
FailSafe('Could not find X');
Repeat;
If (TimeFromMark(Toolong) > 45000) Then
FailSafe('Could not find X');
FindNormalRandoms;
StatsGuise('AntiBan and Waiting');
Antiban;
Wait(100);
If InvCount=PlusOne Then
Writeln('X Taken');
Until (InvCount=PlusOne) or (TimeFromMark(XCounter) > 5000)
End;
End;
function YC: Integer;
var
arP: TPointArray;
arC: TIntegerArray;
tmpCTS, i, arL: Integer;
begin
tmpCTS := GetColorToleranceSpeed;
ColorToleranceSpeed(2);
SetColorSpeed2Modifiers(0.03, 0.11);
FindColorsSpiralTolerance(MSCX, MSCY, arP, 237656545779841, MSX1, MSY1, MSX2, MSY2, 8);
if (Length(arP) = 0) then
begin
//Writeln('Failed to find the color, no result.');
ColorToleranceSpeed(tmpCTS);
SetColorSpeed2Modifiers(0.2, 0.2);
Exit;
end;
arC := GetColors(arP);
ClearSameIntegers(arC);
arL := High(arC);
for i := 0 to arL do
begin
Result := arC[i];
//Writeln('AutoColor = ' + IntToStr(arC[i]));
Break;
end;
ColorToleranceSpeed(tmpCTS);
SetColorSpeed2Modifiers(0.2, 0.2);
if (i = arL + 1) then
//Writeln('AutoColor failed in finding the color.');
end;
Function TakeY: Boolean;
Var
X, Y, PlusOne, YCounter: Integer;
Begin
If Not LoggedIn then
Exit;
MarkTime(TooLong);
FindNormalRandoms;
PlusOne:= InvCount +1;
X:=MSCX;
Y:=MSCY;
If (FindObjCustom(X, Y, ['Take Y', 'ake y', 'Y'], [YC, YC], 7))Then
Begin
StatsGuise('We found a Y');
GetMousePos(X, Y);
Case Random(2) of
0: Mouse(X, Y, 5, 5, True);
1: Begin
Mouse(X, Y, 5, 5, False);
WaitOption('Take', 500);
End;
End;
Flag;
MarkTime(YCounter);
If (TimeFromMark(Toolong) > 45000) Then
FailSafe('Could not find Y');
Repeat;
If (TimeFromMark(Toolong) > 45000) Then
FailSafe('Could not find Y');
FindNormalRandoms;
StatsGuise('AntiBan and Waiting');
Antiban;
Wait(100);
If InvCount=PlusOne Then
Writeln('Y Taken');
Until (InvCount=PlusOne) or (TimeFromMark(YCounter) > 5000)
End;
begin
SetupSRL;
ClearDebug;
TakeX;
TakeY;
end.
End;
All it does is take Y not X and Y or even X. Any reason for this?
I changed the name to X and Y as I hope not to give away what I am scripting for just yet. Would like it to be a surprise!