SRL Archive - Help and Support

Help with a mage guild detector


rostaryms

2008-03-22 18:04:21

Hey guys. I have been making a yanille essence miner. It is good but it needs a mage guild detector. (a boolean, true if in the mage guild, false if not in the mage guild) I have tried many different methods and worked with a few people on trying to make one. But, I have not made or found a detection method that works 100% of the time (or close to 100%). If you guys have any ideas, suggestions, post here. Or you can offer to help make it with me.


Thanks a lot, rosta

ShowerThoughts

2008-03-22 18:55:07

post (or pm) a SS from when you get in the guild ;) then ill fix somthing for ya

mixster

2008-03-23 07:24:06

I'm not a member or a mage so I haven't been in the Mage guild before, but I'm guessing RSHQ has a few screenies so I'll have a quick look there and I'll see if there's anything obvious that will do it.
Edit: Well, it looks like you could probably get away with making a DTM of the outline of the building and then find it and compare it against the center of the minimap. If it is a certain distance away, then you're not in it. That's just a suggestion though and it makes the most sense to me.

ShowerThoughts

2008-03-23 07:44:46

pls give me a SS

n3ss3s

2008-03-23 09:51:10

Post a screenshot when you are inside the guild.

Do you need it to detect it even if you've like just came in from the door or more in the middle?

EDIT: Silly me, I can use the Rs Worldmap.

Coloured = How many "percent" of the 25 radius circle around you should be coloured with the guild colour. Like 197 / 360 for example etc…

Haven't tested, but should work, in theory:


Function InGuild(Coloured: Extended): Boolean;

Var
X, Y, Z, C, I: Integer;
Begin
X := MMCX;
Y := MMCY;
Z := FindLadderColor;
If Z <> 0 Then
Result := FindColorSpiralTolerance(X, Y, Z, MMX1, MMY1, MMX2, MMY2, 0);
If Not Result Then Exit;
If Distance(X, Y, MMCX, MMCY) < 45 Then
Begin
X := X - 3;
Y := Y - 3;
For C := 0 To 35 Do
Begin
I := GetColor(X + (C Mod 6), Y + (C Div 6));
If I <> Z Then
Begin
Z := I;
Break;
End;
End;
C := 0;
For I := 0 To 360 Do
Begin
X := MMCX + Round(25 * Cos(i / 180 * Pi));
Y := MMCY + Round(25 * Sin(i / 180 * Pi));
If GetColor(X, Y) = Z Then
C := C + 1;
End;
Result := C / 360 > Coloured;
End;
End;

R0b0t1

2008-03-23 11:50:19

Since Moe has already posted, I'll play Curly and Larry can show up later!


If you wanted to find if you were in some place, and which you do, and the floor of said area is slightly different from the colors around it, which it is, why not sample the floor area around the center of the minimap? I'd only do about one pixel though, might return true if you were backed against the wall of the guild.

http://www.zybez.net/locator.php (2 15' south; 4 42' east)

mixster

2008-03-23 14:33:08

There's an image if you wanted to improve the check n3ss3s/anyone else make one.

n3ss3s

2008-03-23 14:41:20

I think mine would work fine :rolleyes:

Someone go and test?

mixster

2008-03-23 15:31:08

After reading through it, I would of though you would use your favourite TPA's to make an area of the lighter grey colour then compare the average co-ords to the MMCX, MMCY, but that would work well too.

n3ss3s

2008-03-23 16:37:47

Trust me - if I would do it with TPAs more involved, I would just get the average distance of the points from mm and do a 360 loop, doing the same as now.

Negaal

2008-03-23 21:38:32

Result:=InRange(CountColorTolerance(…),min, max);

or

If there is some certain color in everywhere in mage guild, then get 20+ colors from different worlds, get maximum and minimum HSL and RGB ranges…and…see the tarajunky's autocolor algorythm(Think I spelled wrong).

R0b0t1

2008-03-23 22:01:58

Seriously, whats wrong with my way? Bet you its faster and easier to code than the other ones.

n3ss3s

2008-03-24 04:41:15

Your explanation is weird… You mean do a getcolor few pixels away from (MMCX, MMCY) and do SimilarColors?

R0b0t1

2008-03-26 17:46:55

Yes…

See? Three stooges action.


1). Do other checks to make sure you are at least in Yanille,
2). Sample the colors and see if they look right. (Might use TPA, if like 50 out of 100 pixels are the right color ect.)
3). Determine true or false.