I'm making an Astral Script, and it can't find the Altar..
I'm using Mat's OBJFinder by Color Tolerance.. :O
It keeps not being able to find it.. is there a way I can add multiple color choices?
I'm making an Astral Script, and it can't find the Altar..
I'm using Mat's OBJFinder by Color Tolerance.. :O
It keeps not being able to find it.. is there a way I can add multiple color choices?
"What can't hurt you, try it. What can kill you, do it!"
Scripts Completed: 3
Amount Released : 2
FindObjCustom(); should work. It allows you to find objects using multiple colors and multiple uptexts.
Or if you know how to use it, FindObjTPA();
Use ACA? cant be that hard to get a color
Color I used for astral altar: 8551552 tolerance:15
For runecrafting altars I've found it good to use a DTM, might want to use FindDTMRotated.
Currently: Working on Defending&Attacking in my Castle-Wars ScriptProject Rebuild: 90M/170M
is it not finding that colour at all, or just finding so much of that colour it doesn't know which is the alter?
Put this before your finder function so that it searches from the center out. That should speed it up if speed is the issue.
x := MSCX
y := MSCY
Been using this code for my upcoming astral script
Simba Code:function AltarColor: Integer;
var
arP: TPointArray;
arC: TIntegerArray;
tmpCTS, i, arL: Integer;
begin
tmpCTS := GetColorToleranceSpeed;
ColorToleranceSpeed(2);
SetColorSpeed2Modifiers(0.00, 0.25);
if not (FindColorsTolerance(arP, 8818061, MSX1, MSY1, MSX2, MSY2, 2)) then
begin
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];
Break;
end;
ColorToleranceSpeed(tmpCTS);
SetColorSpeed2Modifiers(0.2, 0.2);
end;
Function FindObjEx_F(ColorA, ColorB, Tol, Bounds, sX, sY: Integer; UpText: TStringArray; Var X, Y: Integer): Boolean;
var
B: TBox;
TPA: TPointArray;
L,i,CTS: Integer;
ATPA,ATPA2: T2DPointArray;
begin
CTS := GetColorToleranceSpeed;
ColorToleranceSpeed(2);
FindColorsSpiralTolerance(sX, sY, TPA, ColorA, MSX1, MSY1, MSX2, MSY2, Tol);
if Length(TPA) < 1 then
begin
ColorToleranceSpeed(CTS);
Exit;
end;
ATPA := TPAtoATPAEx(TPA, Bounds, Bounds);
L := High(ATPA);
SetArrayLength(ATPA2, L+1);
for i := 0 to L do
begin
B := GetTPABounds(ATPA[i]);
with B do
begin
FindColorsSpiralTolerance(sX, sY, ATPA2[i], ColorB, B.X1-Bounds, B.Y1-Bounds, B.X2+Bounds, B.Y2+Bounds, Tol);
ColorToleranceSpeed(CTS);
if Length(ATPA2[i]) > 0 then
begin
MiddleTPAEx(ATPA2[i], X, Y);
MMouse(X, Y, 5, 5);
if WaitUpTextMulti(UpText, 150) then
begin
Result := True;
GetMousePos(X, Y);
Exit;
end;
end;
end;
end;
end;
function FindAltar: Boolean;
var
x, y, i: Integer;
label
Start;
begin
Gametab(tab_Inv);
Start:
if FindObjEx_F(6514535, 10133921, 15, 10, MSCX+50, MSCY, ['Craft','rune','Altar'], X, Y) then
begin
HumanMMouse(x, y, 10, 10);
ClickMouse2(true);
Wait(RandomRange(600, 800));
Result := true;
if did not DidRedClick then
goto Start;
end else if FindObjTPA(x, y, AltarColor, 15, 2, 105, 105, 3, ['raft', 'Craft']) then
begin
HumanMMouse(x, y, 10, 10);
ClickMouse2(true);
Wait(RandomRange(600, 800));
Result := true;
if did not DidRedClick then
goto Start;
end else
begin
Inc(i);
if i > 3 then
begin
Writeln('Failed to find altar');
Exit;
end else
goto Start;
end;
end;
If your using my altar finding then it was very bad :P ACA with a FindObjTPA.
DTM's would be quite good as Pat said.
Mat
^^
Oh that was from you. I found a post where flight quoted part of that code. Just wondering why you think its bad, ive been using it past few days and it pretty much finds the altar every time in one click
There are currently 1 users browsing this thread. (0 members and 1 guests)