SRL Archive - OSR Help

+1 to whoever helps me with this :s


Sin

2011-12-31 15:55:27

As most of you know, I'm making a JadinkoBurner for SIMBA.
I need help as when you cut the roots, there are two different types of roots that can come up.
Straight Root :

Curly Root :


In the script, we ONLY want the curly roots.
How would I differentiate from the Curly/Straight roots :s

Brandon

2011-12-31 16:08:59

DTM:=DTMFromString('mQwAAAHicY2ZgYOBhZGDgBmIJIPZkYmCIB+IQIG6U4mHodrZjWBjgxaABVGcExYxIGAgAqn0EtQ==');

Bahaha.. Worst Idea I know.. but it's really really hard to do :S Try rotating the screen until it finds a dtm lol.. only thing I can think of :S I tried TPA's on this.. it finds the first one too -_-

Dynamite

2011-12-31 16:13:39

Double TPA within a box at the bottom, if there is 2 red parts within a certain distance then it is a curly root, else it is a straight root.
I am off out to get drunk, if you still can't figure it out by tomorrow, I will help you.

-Boom

Sin

2011-12-31 16:13:59

Urgh….
I'm not that good with DTM's… (No experience at all, don't know how to do them…)
This would be EXTREMELY inefficient but I could always drop anything in theinventory that has "Straight" in it's name…


From: Dynamite
Double TPA within a box at the bottom, if there is 2 red parts within a certain distance then it is a curly root, else it is a straight root.
I am off out to get drunk, if you still can't figure it out by tomorrow, I will help you.

-Boom


EDIT" I don't understand what you mean :o

HT BaaFly

2011-12-31 16:23:09

what if you hover over the object? is it the same name for both?

Emaziz

2011-12-31 16:30:09

From the look of it the curly root has more redish colour than the straight root. I'd experiment with counting the amount of redish coloured pixels on each root and see if you detect a significant difference between them which can be used to distinguish them.

EDIT: By counting the amount of redish coloured pixels I mean storing the data in a TPA and checking the length of that TPA, in case it wasn't obvious :)

Sin

2011-12-31 16:32:29

From: HT BaaFly
what if you hover over the object? is it the same name for both?

Yes.

From: Emaziz
From the look of it the curly root has more redish colour than the straight root. I'd experiment with counting the amount of redish coloured pixels on each root and see if you detect a significant difference between them which can be used to distinguish them.

They have the same colors on them :s
It's just the picture I took.

DemiseScythe

2011-12-31 16:40:18



Instead of rotating the camera before you make DTM, you can decide standard camera angle, then make DTM to tell them apart.

I've never been there but let me go there and show you inscreen test.


There is purple on curly roots which is not in the straight ones. Also a DTM can tell the diff since there is green under purple on curly but green under green on straight.

Try counting amount of the purple color in them. Straightones show less purple than curly ones

Sin

2011-12-31 16:42:25

From: DemiseScythe


Instead of rotating the camera before you make DTM, you can decide standard camera angle, then make DTM to tell them apart.

I've never been there but let me go there and show you inscreen test.


Got Skype or MSN?
You're like my DTM idol :P
Show me how to use them please :)
Skype: Aftermath1017
MSN: [email]hax@rsbuddy.com[/email]

Troll

2011-12-31 16:43:58

From: Emaziz
From the look of it the curly root has more redish colour than the straight root. I'd experiment with counting the amount of redish coloured pixels on each root and see if you detect a significant difference between them which can be used to distinguish them.

EDIT: By counting the amount of redish coloured pixels I mean storing the data in a TPA and checking the length of that TPA, in case it wasn't obvious :)


That is what i would do, its like in a lesser demon fighter i am making it would find imps as well so i checked for the amount of red of the TPA but that would mean using an array of TPA's so you might want to look over a tutorial or two :)

Shuttleu

2011-12-31 16:48:14

do the roots go straight down?

if they do then you can get the top one, and check if it is a green pixel a certain didtance down

~shut

DemiseScythe

2011-12-31 16:53:53

DTM doesnt work good due to distance issues, farther away roots are smaller and would not work fine with the DTM, you need different method.

the roots in the back are smaller than usual while the ones in the front are larger.

Sin

2011-12-31 16:55:53

From: Shuttleu
do the roots go straight down?

if they do then you can get the top one, and check if it is a green pixel a certain didtance down

~shut

You can do that??

From: Troll
That is what i would do, its like in a lesser demon fighter i am making it would find imps as well so i checked for the amount of red of the TPA but that would mean using an array of TPA's so you might want to look over a tutorial or two :)

Hmm this seems like a good idea. I'll try this out… Will probably fail but hey, i gained some knowledge about TPA's :P

Emaziz

2011-12-31 16:57:07

From: S1N
Yes.


They have the same colors on them :s
It's just the picture I took.


They have the same colors, yes, but the curly one has more red pixels than the straight one. Thus, if you count the red pixels on the curly one and the straight one you should notice a difference.

Let's say I do multiple counts and notice that the straight vine contains between 1000-1500 red pixels and the curly one contains between 2000-2500 pixels. Now I can easily count the amount of red pixels on a random vine and figure out whether it's curly or not.

DemiseScythe

2011-12-31 17:00:31

From: Emaziz
They have the same colors, yes, but the curly one has more red pixels than the straight one. Thus, if you count the red pixels on the curly one and the straight one you should notice a difference.

Let's say I do multiple counts and notice that the straight vine contains between 1000-1500 red pixels and the curly one contains between 2000-2500 pixels. Now I can easily count the amount of red pixels on a random vine and figure out whether it's curly or not.


Far away vine = smaller vine = less red pixels even if its curly.

Closer straight vine = larger vine = more red pixels.

Best method would be to find roots with TPA and hover through them until top text says curly

Sin

2011-12-31 17:09:09

From: DemiseScythe
Far away vine = smaller vine = less red pixels even if its curly.

Closer straight vine = larger vine = more red pixels.

Best method would be to find roots with TPA and hover through them until top text says curly


There's no point, the uptexts for both of them are "Jade Root".

Shuttleu

2011-12-31 17:09:12

From: S1N
You can do that??


Hmm this seems like a good idea. I'll try this out… Will probably fail but hey, i gained some knowledge about TPA's :P


sure, find a point where is is green and store it in x and y, then do a GetColor at x and y+{insert amount here}

then do a SimilarColor

so something like this
function FindCurley(Location: Point): Boolean;
var
Points: TPointArray;
i, TempColor1, TempColor1: Integer;
begin
if FindColors(Points, 12345, MSX1, MSY1, MSX2, MSY2) then
begin
for i:=0 to High (Points) do
begin
TempColor1:= GetColor(Points[i].x, Points[i].y);
TempColor2:= GetColor(Points[i].x, Points[i].y+35);
if SimilarColors(TempColor1, TempColor2, 2) then
Continue;
Result:= True;
Location:= Point[i];
end;
end;
end;

~shut

Emaziz

2011-12-31 17:10:37

From: DemiseScythe
Far away vine = smaller vine = less red pixels even if its curly.

Closer straight vine = larger vine = more red pixels.

Best method would be to find roots with TPA and hover through them until top text says curly


Find the ratio between red and green pixels. *ba dum tish*

Edit: If the names on the vines are "Curly vine" and "Straight vine" in the up-text, that is of course the easiest way

Brandon

2011-12-31 17:12:23

I've just done a count colour on every bitmap you guys posted.. the guy talking about distance is right.. I've counted colours on the second picture and it's only 86 pixels more red than the straight root.. whereas in the OP's post, its over 700 pixels more on the curly than the straight..


program new;
{$I SRL/SRL.Scar}
{$I srl/srl/misc/debug.scar}

Function FoundCurly: Boolean;
var
TPA: TPointArray;
Count, CTS, Col: Integer;
begin
Col:= 2700200;
CTS:= GetColorToleranceSpeed;
SetColorToleranceSpeed(2);
SetColorspeed2Modifiers(0.04, 1.43);
if FindColorsSpiralTolerance(MSCX, MSCY, TPA, Col, MSX1, MSY1, MSX2, MSY2, 22) then
begin
Count:= CountColorsTolerance(Col, MSX1, MSY1, MSX2, MSY2, 22);
writeln(Count);
DebugTPA(TPA, '');
end;
SetColorToleranceSpeed(CTS);
SetColorSpeed2Modifiers(0.2, 0.2);
end;


begin
FoundCurly;
end.

Emaziz

2011-12-31 17:20:06

From: ggzz
I've just done a count colour on every bitmap you guys posted.. the guy talking about distance is right.. I've counted colours on the second picture and it's only 86 pixels more red than the straight root.. whereas in the OP's post, its over 700 pixels more on the curly than the straight..


program new;
{$I SRL/SRL.Scar}
{$I srl/srl/misc/debug.scar}

Function FoundCurly: Boolean;
var
TPA: TPointArray;
Count, CTS, Col: Integer;
begin
Col:= 2700200;
CTS:= GetColorToleranceSpeed;
SetColorToleranceSpeed(2);
SetColorspeed2Modifiers(0.04, 1.43);
if FindColorsSpiralTolerance(MSCX, MSCY, TPA, Col, MSX1, MSY1, MSX2, MSY2, 22) then
begin
Count:= CountColorsTolerance(Col, MSX1, MSY1, MSX2, MSY2, 22);
writeln(Count);
DebugTPA(TPA, '');
end;
SetColorToleranceSpeed(CTS);
SetColorSpeed2Modifiers(0.2, 0.2);
end;


begin
FoundCurly;
end.


Check the ratio :)
Edit: Heck, I'll do it myself ;P

Sin

2011-12-31 17:20:19

From: ggzz
I've just done a count colour on every bitmap you guys posted.. the guy talking about distance is right.. I've counted colours on the second picture and it's only 86 pixels more red than the straight root.. whereas in the OP's post, its over 700 pixels more on the curly than the straight..


program new;
{$I SRL/SRL.Scar}
{$I srl/srl/misc/debug.scar}

Function FoundCurly: Boolean;
var
TPA: TPointArray;
Count, CTS, Col: Integer;
begin
Col:= 2700200;
CTS:= GetColorToleranceSpeed;
SetColorToleranceSpeed(2);
SetColorspeed2Modifiers(0.04, 1.43);
if FindColorsSpiralTolerance(MSCX, MSCY, TPA, Col, MSX1, MSY1, MSX2, MSY2, 22) then
begin
Count:= CountColorsTolerance(Col, MSX1, MSY1, MSX2, MSY2, 22);
writeln(Count);
DebugTPA(TPA, '');
end;
SetColorToleranceSpeed(CTS);
SetColorSpeed2Modifiers(0.2, 0.2);
end;


begin
FoundCurly;
end.

Mmk, I tried this out and I got an error:
[Error] (57:13): Unknown identifier 'CountColorsTolerance' at line 56
Compiling failed.
Line 56 is : Count:= CountColorsTolerance(Col, MSX1, MSY1, MSX2, MSY2, 22);

Brandon

2011-12-31 17:24:30

Hahah oops.. take out the S in that line.. Should just be colortolerance.. not Colors.

@ Emaziz.. I shall await this lol. I'll also try it myself but i'd love to see your solution to the ratio.

Sin

2011-12-31 17:33:16

From: ggzz
Hahah oops.. take out the S in that line.. Should just be colortolerance.. not Colors.

@ Emaziz.. I shall await this lol. I'll also try it myself but i'd love to see your solution to the ratio.

I tried it out and nothing really seems to be happening.
It still clicks on the Straight roots also.
Here's my code so far:

procedure ChopRoots;
var
x, y, g,h:Integer;
begin
SetAngle(True);
{repeat
if FindObjCustom(x, y, ['Chop'], [9107358], 0) Then
MMouse(x, y, 2, 2);
writeLn('Finding First Form of Jade Root');
until(IsUpText('Chop'));}

//My method of finding the roots^^^

FoundCurly;
Mouse(x, y, 1, 1, True);
repeat
if IsMoving then
wait(7000 + random(200));
until(Not IsMoving);

if FindObjCustom(g, h, ['lect', 'root', 't-r'], [789517], 2) Then
writeLn('Finding Second form of Jade Root');
MMouse(g, h, 1, 1);
Mouse(g,h, 1, 1, True);
repeat
wait(100);
until(FindBlackChatMessage('four'));
end;
This is JUST for the Chopping roots.

I need to add a Timeout in case the roots switch up, so dont bug me about that :P

Emaziz

2011-12-31 18:52:22

For some reason color detection is messed up on my dual-screen computer… Can't check the ratio. However I think it's a good idea you should at least check out. Having experience with detection systems like that is useful.

Sin

2011-12-31 23:19:15

From: Emaziz
For some reason color detection is messed up on my dual-screen computer… Can't check the ratio. However I think it's a good idea you should at least check out. Having experience with detection systems like that is useful.


Urgh, I think i'm making this too complicated…
I'll just drop all Straight Roots I get and burn the rest.
Inefficient, I know, but I AM a novice =/