Doubt the radial walk will get in here.
For RS getting : Client > Client Window > Find RS
(this is the main menu, not the tabs)
Doubt the radial walk will get in here.
For RS getting : Client > Client Window > Find RS
(this is the main menu, not the tabs)
Administrator's Warning:
You may contact me with any concerns you have.
Are you a victim of harassment? Please notify me or any other staff member.
| SRL Community Rules | SRL Live Help & Chat | Setting up Simba | F.A.Q's |
Thanks!a nub like me who is beginning to learn SCAR is gonna have an easier time now!
What is the 'Max Distance' variable for?
The Max Distance is the maximum amount 2 points can be from eachother before the script sees it as another object.
Administrator's Warning:
TPA splitting into ATPAs as far as I remember.
A TPA is an array of the x and y coordinates for every single pixel of matching colors for the search, in the search area. But we need to split these pixels into an array of boxes, otherwise moving the mouse to each of the pixels matching the color that was searched for, would be kinda time-consuming and bot-line, no? That's why we split them into boxes with only ONE point in each box instead of all the points.
The max distance variable is for you to enter what width and height those boxes should have. 15-30 is commonly used and works for most objects.
Feel free to ask if you didn't fully grasp something of what I just wrote.
Scripts: Varrock Smither! | Fight Caves Runner! | Kebab Buyer! | L.A.M.E. (Outdated)
Tutorials: SRL user-defined procedures | JaGex UID files | Printing your scripts
Applications: StartUp Notepad | SCAR Assistant
Misc: FREE Delphi 7 v2 | Official SRL Graphics
So you would want to use a higher number to be more safe with your object finding?
If your color matches a lot of the object (mark color), you should use a small number. If not, use a higher number.
............. - Small number
. . . -Larger number
. = matched color
....so this program helps you make a function to find and object in the main screen???
like i could get a few colors of some cabbage and it would make a function to find the cabbage color????or what ....its a little complex
Yeh thats pretty much what it comes down to
Get a few colors of your cabbage for example, make sure it doesn't find any (or at least not a lot) of other colors (by checking under the Client tab, pressing Mark Best Color after you've selected your colors). Then I suggest using the FindObjRecord tab to create the function that finds the object on the main screen .
Administrator's Warning:
(im beginer) So , for example i have took some colors of copper ore , and now i want so that my script finds the colors (that part is already done) and clicks on them. Wich part should be changer, or edited ?SCAR Code:program FindObject;
{.include SRL\SRL.scar}
var
x, y: Integer;
function FindObject(var fx, fy: Integer): Boolean;
var
arP, arAP: TPointArray;
arC, arUC: TIntegerArray;
ararP: T2DPointArray;
tmpCTS, i, j, arL, arL2: Integer;
P: TPoint;
H, S, L: Extended;
X, Y, Z: Extended;
begin
tmpCTS := GetColorToleranceSpeed;
ColorToleranceSpeed(1);
if not(FindColorsTolerance(arP, 6130899, MSX1, MSY1, MSX2, MSY2, 40)) then
begin
Writeln('Failed to find the color, no object found.');
ColorToleranceSpeed(tmpCTS);
Exit;
end;
arC := GetColors(arP);
arUC := arC;
ClearSameIntegers(arUC);
arL := High(arUC);
arL2 := High(arC);
for i := 0 to arL do
begin
ColorToHSL(arC[i], H, S, L);
if (H >= 6.45) and (H <= 6.84) and (S >= 46.81) and (S <= 74.87) and (L >= 50.57) and (L <= 68.65) then
begin
ColorToXYZ(arC[i], X, Y, Z);
if (X >= 28.30) and (X <= 50.03) and (Y >= 24.07) and (Y <= 44.62) and (Z >= 8.93) and (Z <= 22.51) then
begin
for j := 0 to arL2 do
begin
if (arUC[i] = arC[j]) then
begin
SetLength(arAP, Length(arAP) + 1);
arAP[High(arAP)] := arP[j];
end;
end;
end;
end;
end;
SortTPAFrom(arAP, Point(MSCX, MSCY));
ararP := SplitTPAEx(arAP, 10, 10);
arL := High(ararP);
for i := 0 to arL do
begin
if (Length(ararP[i]) < 10) then Continue;
P := MiddleTPA(ararP[i]);
MMouse(P.x, P.y, 5, 5);
Wait(100 + Random(100));
if (IsUpText('Take')) then
begin;
Result := True;
Break;
end;
end;
ColorToleranceSpeed(tmpCTS);
if (i = arL + 1) then
begin
Writeln('FindObject could not find object.');
Exit;
end;
GetMousePos(fx, fy);
end;
begin
SetupSRL;
FindObject(x, y);
end.
kk?
Well ... in the end you could do this :
SCAR Code:begin
SetupSRL;
FindObject(x, y);
Mouse(x, y, 0, 0, True);
end.
that will click on the found object, but... I made this function in SRL which does this, premade. I made a couple of TAutoColorInfo's (which stores the date you made in scar) of rocks and I use these for a rock finder.
For more info, http://www.villavu.com/forum/showthr...=32668?t=35403
Administrator's Warning:
Thanks ... I will check http://www.srl-forums.com/forum/auto...3.html?t=35403 now .... rly thx x100 man
kk?
i Will try make a autoing script
Love this thing!
Just so you know, just a thought, remove the unnecessary begins and ends in the find object procedures.
Only thing I could find..
Writing an SRL Member Application | [Updated] Pascal Scripting Statements
My GitHub
Progress Report:13:46 <@BenLand100> <SourceCode> @BenLand100: what you have just said shows you have serious physchological problems 13:46 <@BenLand100> HE GETS IT! 13:46 <@BenLand100> HE FINALLY GETS IT!!!!1
IMO it is more readable But I suggest using the TAutoColorInfo's feature anyway since it is more advanced, more bugs have been removed... its just better supported
Administrator's Warning:
Sorry for the bump, but I saw that the FindObject function could be optimized a little bit, so I did.
SCAR Code:function FindObject(var fx, fy: Integer): Boolean;
var
arP, arAP: TPointArray;
arC, arUC: TIntegerArray;
ararP: T2DPointArray;
tmpCTS, i, j, arL, arL2, c: Integer;
P: TPoint;
H, S, L: Extended;
X, Y, Z: Extended;
begin
tmpCTS := GetColorToleranceSpeed;
ColorToleranceSpeed(1);
if not(FindColorsTolerance(arP, 16316406, MSX1, MSY1, MSX2, MSY2, 14)) then
begin
Writeln('Failed to find the color, no object found.');
ColorToleranceSpeed(tmpCTS);
Exit;
end;
arC := GetColors(arP);
arUC := arC;
ClearSameIntegers(arUC);
arL := High(arUC);
arL2 := High(arC);
SetLength(arAP, (arL+1)*(arL2+1));
for i := 0 to arL do
begin
ColorToHSL(arC[i], H, S, L);
if (H >= 0.00) and (H <= 58.35) and (S >= 0.00) and (S <= 28.59) and (L >= 93.71) and (L <= 100.02) then
begin
ColorToXYZ(arC[i], X, Y, Z);
if (X >= 81.64) and (X <= 95.07) and (Y >= 86.07) and (Y <= 100.02) and (Z >= 95.49) and (Z <= 108.90) then
begin
for j := 0 to arL2 do
begin
if (arUC[i] = arC[j]) then
begin
arAP[c] := arP[j];
Inc(c);
end;
end;
end;
end;
end;
SetLength(arAP, c);
SortTPAFrom(arAP, Point(MSCX, MSCY));
ararP := SplitTPAEx(arAP, 10, 10);
arL := High(ararP);
for i := 0 to arL do
begin
if (Length(ararP[i]) < 10) then Continue;
P := MiddleTPA(ararP[i]);
MMouse(P.x, P.y, 5, 5);
Wait(100 + Random(100));
if (IsUpText('Take')) then
begin;
Result := True;
Break;
end;
end;
ColorToleranceSpeed(tmpCTS);
if (i = arL + 1) then
begin
Writeln('FindObject could not find object.');
Exit;
end;
So that you only edit the length of arAP twice, rather than each time you add a new index.
Nice, saturn.
Might aswell remove the unneeded begins/ends?
Scripts: Varrock Smither! | Fight Caves Runner! | Kebab Buyer! | L.A.M.E. (Outdated)
Tutorials: SRL user-defined procedures | JaGex UID files | Printing your scripts
Applications: StartUp Notepad | SCAR Assistant
Misc: FREE Delphi 7 v2 | Official SRL Graphics
Yeah, I was going to, but I figured nielsie/sumilion did it for a reason. Maybe for code cleanliness?
Scripts: Varrock Smither! | Fight Caves Runner! | Kebab Buyer! | L.A.M.E. (Outdated)
Tutorials: SRL user-defined procedures | JaGex UID files | Printing your scripts
Applications: StartUp Notepad | SCAR Assistant
Misc: FREE Delphi 7 v2 | Official SRL Graphics
May I ask you where did you get HSL and XYZ formula? Or did you find it?
I like this heheh
hope you gyys wont mind i am going to post this on scion if you have any objections to this just say so and i will remove it, i have gave full credits to use guys
There are currently 1 users browsing this thread. (0 members and 1 guests)