PDA

View Full Version : Reflect.Compass bug



kakadudl
02-01-2016, 11:55 AM
Hello fellow bot makers!

I was running my bot which uses the Reflect.Antiban.BoredHuman function. The function was called many times and it seems to have problem with Reflect.Compass.Make(Round(Deg)), as I got an error of: unknown? variable at line 179

Line 179 of AntiBan:

Reflect.Compass.Make(Round(Deg))

I've had problems with this function before AntiBan functions were added and it was giving me the same error.

Joopi
02-01-2016, 02:07 PM
So how exactly is this related to boredHuman?
edit: ok yeah boredHuman calls Make, i'll try to figure out what's up here.

the bank
02-01-2016, 02:19 PM
So how exactly is this related to boredHuman?

procedure TReflectionAntiban.BoredHuman;
var
I, X, Y: Integer;
Deg: Variant;
begin
Deg := Reflect.Compass.AngleDeg;
for I := 1 to (3 + Random(11)) do
begin
Reflect.Mouse.Move(Point(Random(MSX2),Random(MSY2) ), 0, 0);
if Reflect.Text.IsUptext('opti') then
begin
Reflect.Mouse.Click(Mouse_Right);
Reflect.Text.ChooseOption('Examine');
end;
case Random(6) of
0: Reflect.KeyBoard.SendArrowWait(((Random(2) * 2) + 1), 1000 + Random(200));
1: Reflect.KeyBoard.SendArrowWait(((Random(2) * 2)), 1000 + Random(200));
2: Reflect.KeyBoard.SendArrowWait(((Random(2) * 2) + 1), 200 + Random(200));
3: Reflect.KeyBoard.SendArrowWait(((Random(2) * 2)), 200 + Random(200));
4: Reflect.KeyBoard.SendArrowWait(((Random(2) * 2) + 1), 20 + Random(20));
5: Reflect.KeyBoard.SendArrowWait(((Random(2) * 2)), 20 + Random(20));
end;
end;
if Deg <> 0 then
Reflect.Compass.Make(Round(Deg))
else
Reflect.Compass.Make('N');
Reflect.KeyBoard.SendArrowWait(0, 750 + Random(500));
end;

Because it calls Reflect.Compass.Make() at the line the OP specified.

Turpinator
02-01-2016, 02:21 PM
procedure TReflectionAntiban.BoredHuman;
var
Deg: Variant;


Do we know why this is a variant? wouldnt an integer suffice?

Joopi
02-01-2016, 02:27 PM
Do we know why this is a variant? wouldnt an integer suffice?

Make takes a variant atleast.

the bank
02-01-2016, 02:33 PM
Do we know why this is a variant?

No. I have zero knowledge of this include but the thought being is demonstrated in that exact snippit.

I assume he uses a variant with Make so that you can pass either a char (ex from snippit: 'N') or an integer value (ex from snippit: Round(Deg)) without having to overload. However, there is absolutely no need to use a Variant in the boredHuman function as deg will only ever result to an extended.

KeepBotting
02-01-2016, 03:16 PM
Do we know why this is a variant? wouldnt an integer suffice?

Radians vs degrees?

Or extended type vs integer type

Turpinator
02-01-2016, 03:55 PM
Radians vs degrees?

Or extended type vs integer type

an extended will accept an integer and cast it without any need for special stuff.

var
e: extended;
function randomint(): integer;
begin
result := 4; // chosen by a fair dice roll
// guaranteed to be random
end
begin
e := randomint();
writeln(e);
end.

rkh3544
02-22-2016, 04:06 AM
did you figure this out? it's been happening on the script im using. i just commented it out for now but i'd like to know what's wrong w/ it.

kakadudl
03-11-2016, 07:38 PM
did you figure this out? it's been happening on the script im using. i just commented it out for now but i'd like to know what's wrong w/ it.

No it hasn't been repaired yet my scripts keep failing now and then because of that. It happens rarely tho.