SRL Archive - General Botting Help

TPA/ATPA sorting error


Sk1nyNerd

2014-01-30 00:47:10

i keep getting this error on the line of my HueMods and i dont understand why? am i missing something?

Exception in Script: Expression expected at line 142, column 15

function FindTree: Boolean;
var
TPA, TempTPA: TPointArray;
ATPA: Array of TPointArray;
i, x, y, MinPoints, CTS: Integer;
Colors, Tolerances: TIntegerArray;
HueMods, SatMods: TExtendedArray;

begin

Result:= False;

if (TimeFromMark(FindTreeTime) > 60000) then
begin
writeln('Unable to find any trees...');
LogOut;
TerminateScript;
end;

Colors := [5014947, 4359279];
Tolerances := [15, 20];
HueMods := [.02, .02];
SatMods := [.57, .31];
MinPoints := 15;

CTS:= GetToleranceSpeed;
ColorToleranceSpeed(2);

for i:= 0 to High(Colors) do
begin
SetToleranceSpeed2Modifiers(Huemods[i], SatMods[i]);
FindColorsTolerance(TempTPA, Colors[i], MSX1, MSY1, MSX2, MSY2, Tolerances[i]);
AppendTPA(TPA, TempTPA);
end;

ColorToleranceSpeed(CTS);
SetColorSpeed2Modifiers(0.2, 0.2);

if (High(TPA)> 0) then
begin

ATPA:= SplitTPA(TPA,10);
SortATPASize(ATPA,True);

for i:= 0 to High(ATPA) do
begin
if (High(ATPA[i]) < MinPoints) then
Break;
end;

if (i = 0) then
Exit;

SetArrayLength(ATPA,i);
SortATPAFromFirstPoint(ATPA,Point(MSCX,MSCY));

for i:= Low(ATPA) to Min(High(ATPA),3) do
begin
MiddleTPAEX(ATPA[i],x,y);
MMouse(randomrange(x-5,x+5),randomrange(y-5,y+5),0,0);
if WaitUpTextMulti(['hop','own'],randomrange(150,600)) then
begin
if (IsUpTextMultiCustom(['hop','own'])) then
begin
HumanWait;
HumanClick;
if (DidRedClick) then
Result:= True;
Exit;
end;
end;
end;
end;

end;

riwu

2014-01-30 01:47:08

You need to add a 0 in front of the . for floats.

Also note that some functions like ColorToleranceSpeed() has been renamed to SetColorToleranceSpeed()

Sk1nyNerd

2014-01-30 10:37:22

From: riwu
You need to add a 0 in front of the . for floats.

Also note that some functions like ColorToleranceSpeed() has been renamed to SetColorToleranceSpeed()


doh! haha thanks. and thanks for the renaming

Sk1nyNerd

2014-01-30 19:56:23

rather then making a new thread ill just post another problem ive encountered here. Im trying to use the MouseItem option, havent used it before, and im getting this error at my MouseItem function. Another easy fix? lol

Exception in Script: Expected variable of type "Int32", got "False..True(4294967295)" at line 252, column 18 at line 252, column 35

procedure DropInv;
var
i, a, b: integer;
DropSequence: TIntegerArray;
InvSlot: TBox;

begin
writeln('droping');

if (DropLogs = True) then
begin
case random(10) of
0..3: DropSequence := [1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,
22,23,24,25,26,27,28]; //row

4..10: DropSequence := [1,5,9,13,17,21,25,2,6,10,14,18,22,26,3,7,11,15,19,23,
27,4,8,12,16,20,24,28]; //column
end;

for i:= 0 to 27 do
begin
InvSlot := InvBox(DropSequence[i]);
writeln(inttostr(DropSequence[i]));

if FindDTM(LogDTM, a, b, InvSlot.x1, InvSlot.y1, InvSlot.x2, InvSlot.y2) then
begin
writeln('derp');
//MMouse(randomrange(a-5, a+5),randomrange(b-5, b+5),0,0);
MouseItem(DropSequence[i],False);
//ClickMouse2(mouse_right);
WaitOption('rop',randomrange(150,600)); //avg 375
ChooseOption('rop');
end;
end;

end else
BurnLogs;

end;

riwu

2014-01-30 20:44:00

The 2nd parameter for MouseItem() is a byte. Use MOUSE_MOVE, MOUSE_LEFT, MOUSE_RIGHT constants.

Sk1nyNerd

2014-01-30 21:38:29

From: riwu
The 2nd parameter for MouseItem() is a byte. Use MOUSE_MOVE, MOUSE_LEFT, MOUSE_RIGHT constants.


…. do i even script? lol thanks man