I'd rather not use reflection, but thanks hoodz I didn't know that one exist!
Not sure if u did on purpose for antileech mayor, but maxWait should be maxTime at line 5. Other than that, I love you baby. Thanks for the help!
Why does this repeatedly click the furnace? :\
procedure ClickBar;
var
x, y, SteelBarDTM: Integer;
begin
SteelBarDTM := DTMFromString('mggAAAHicY2NgYMhlYmBIA+IcIC4F4hIgzgRiDkYGBi4gZgJiNiDmAWJ+IJ7Y3s7g7+XBUFGQD2ZP7e5isLGwYOAHmoUNM+LAEAAAZigLCw==');
GameTab(24);
if(ActivatedItem = -1) then
if(FindDTM(SteelBarDTM, x, y, MIX1, MIY1, MIX2, MIY2)) then
begin
MMouse(x, y, 3, 3);
Wait(RandomRange(250, 450));
ClickMouse2(Mouse_Left);
Wait(RandomRange(350, 650));
WriteLn('y');
Exit;
end;
end;
procedure FindFurnace;
var
OCTS, H, L, x, y: Integer;
OHueMod, OSatMod: Extended;
TPointsFurnace: TPointArray;
ATPA: T2DPointArray;
begin
OCTS := GetColorToleranceSpeed;
GetColorSpeed2Modifiers(OHueMod, OSatMod);
SetColorToleranceSpeed(2);
SetColorSpeed2Modifiers(0.53, 0.23);
FindColorsTolerance(TPointsFurnace, 3421240, MSX1, MSY1, MSX2, MSY2, 9);
ATPA := TPAtoATPA(TPointsFurnace, 30);
H := High(ATPA);
for L := 0 to H do
begin
if(Length(ATPA[L]) > 400 ) then
begin
if not(IsMoving) then
begin
MiddleTPAEx(ATPA[L], x, y);
MMouse(x, y, 4, 4);
Wait(RandomRange(250, 300));
ClickMouse2(Mouse_Left);
Flag;
Wait(RandomRange(800, 1200));
if(DidRedClick) then //if we clicked the furnace, then let's select option 'make all'
begin
MMouse(249, 401, 3, 3);
Wait(RandomRange(300, 500));
ClickMouse2(mouse_right);
Wait(RandomRange(235, 546));
ChooseOptionMulti(['Make All', 'ake All', 'll']);
repeat
Wait(300);
AntiBan;
FindNormalRandoms;
until(FindBlackChatMessageMulti(['out of steel', 'run out of', 't of']) or SmeltingAnimation(10000));
end;
end else
Flag;
end;
end;
SetColorToleranceSpeed(OCTS);
SetColorSpeed2Modifiers(OHueMod, OSatMod);
end;
Edit, I tried remaking it. And it works now, this is what I have (thought I'd share for the others who might need it!).
procedure ClickFurnace;
var
ATPA: T2DPointArray;
FurnaceTPA: TPointArray;
x, y, I, H, tmpCTS: Integer;
tmpHue, tmpSat: Extended;
FurnaceBox: TBox;
begin
tmpCTS := GetColorToleranceSpeed();
GetColorSpeed2Modifiers(tmpHue, tmpSat);
SetColorToleranceSpeed(2);
SetColorSpeed2Modifiers(0.00, 0.36);
if FindColorsSpiralTolerance(MSCX, MSCY, FurnaceTPA, 4144963, MSX1, MSY1, MSX2, MSY2, 4) then
begin
SetColorToleranceSpeed(tmpCTS); // reset here and not at bottom, else we cant find IfUpText
SetColorSpeed2Modifiers(tmpHue, tmpSat); // reset here and not at bottom, else we cant find IfUpText
WriteLn('found furnace');
ATPA := SplitTPAEx(FurnaceTPA, 50, 50);
SortATPASize(ATPA, true);
FilterTPAsBetween(ATPA, 1, 1200);
SMART_DebugATPA(true, atpa);
for I := 0 to High(ATPA) do
repeat
WriteLn('moving mouse');
MiddleTPAEx(ATPA[I], x, y);
MMouse(x, y, 3, 3);
Wait(RandomRange(100, 200));
if (IsUpText('melt')) then
begin
WriteLn('y');
ClickMouse2(mouse_left);
//Wait(RandomRange(200, 350)); // deactivated, else it won't detect redclick
if (DidRedClick) then
begin
WriteLn('clicked');
Exit;
end;
end;
until(DidRedClick);
end;
end;