SRL Archive - OSR Help

Need help with finding banker at GrEx...


jimthesoundman

2010-02-11 19:58:59

I'm writing a firemaking script for the Grand Exchange. Two main problems:

1) I'm having trouble with getting the character back close to the banker, as there are usually dozens of people crowded around. I have been trying to just use find bank symbol in the minimap, and that will usually work, but because the symbol drifts, sometimes I end up too far away, and the banker isn't visible in the main screen.

2) I've found a fairly unique color, that is in the hair of the bankers, but it is also found in fire, so if there is a fire burning the main screen that will confuse the script and it takes a long time to open the bank. So I've tried the hair color method and that sometimes fails and I've tried OpenBankNPC and that sometimes fails. I can make them both recursive on each other so that gives me about a 99% success rate, but it takes a long time to work (sometimes over a minute) so obviously I'd like something faster and better.

I was thinking that for problem one, maybe I ought to find the bank symbol, then find the grand exchange symbol that is right next to it and have the mouse click in the centerpoint between those two symbols. Anyone know an easy way to do that?

For the second problem, I'm stumped. Maybe using the black circle post in the center of the Gr Ex as a reference point and then only search in a certain radius from that point? How would I find the center of that black circle post?


Thanks in advance,

JIM

i luffs yeww

2010-02-11 22:31:39

For the first problem, you could make a TPA of the uh.. things on the minimap.. the lines.. They're pillars or something I think. And estimate based on that (and the bank/ge symbol, as well..). For the second one, edit FindBankNPC to make it search for a smaller area, or use a more accurate (but slower) CTS thingy. CTS(3) is the highest I think, and it'll result in the slowest finding, but most accurate..

Coh3n

2010-02-12 01:14:15

1. Just make a DTM of the bankers. I believe there are 3 in a line on the MM? Not sure, this may have changed. Then just use DTMRotated to find it.

2. You can try several colors (gray, white, blue, whatever other colors are on the bankers), then I would do length checks to get rid of some colors that the script would pick up. You said that when you use the hair color, it picks up the fire sometimes. Do something like this:

if (Length(aTPA[i]) < 30) then
Continue;
That will skip the atpa that has less than 30 points in it. You'll have to experiment with the 30 as it was just a random example. For a better visual of all this, you should use DebugTPA and/or DebugATPA. That way you can see the tpa/atpa, making it easier to understand and find bugs.

Good luck,
Coh3n

Naum

2010-02-12 16:43:12

This is something I used in one of my private scripts for walking to GE:

Function GetToGEBank : Boolean;
Var
I : Integer;
TPA : TPointArray;
ATPA : T2DPointArray;
TP : TPoint;
Begin
TPA := GetMiniMapDots('yellow');
ATPA := SplitTPA(TPA, 15);
SortATPASize(ATPA, True);
TP := MiddleTPA(ATPA[0]);
Result := MouseFlag(TP.x, TP.y, 5, 5, 0);
End;

Feel free to take any ideas and/or use it :).

For your second task, I would suggest using the white shirt collar or visible skin.
If you need any more regarding this matter, I'll show you some code (which I think I have lying on my HDD :eek:).