SRL Archive - SRL Development and Help

Select one banker from a row? [Will fix my pathfind + increase efficiency]


rickhunley

2015-05-20 00:01:34

Hi,

When at Al Kharid bank is there a way to select the banker on the far right hand side. My script seems to keep choosing the left hand side. Having general banking issues :(

Thanks

cosmasjdz

2015-05-20 02:17:35

From: rickhunley
Hi,

When at Al Kharid bank is there a way to select the banker on the far right hand side. My script seems to keep choosing the left hand side. Having general banking issues :(

Thanks


If camera static then just use shortfrommidpoint()to short tpas to any dot from the right like point(500,250); If not static then you need rotate that dot according to camera angles and then short from it. Else if your location varies you can try to sort dots from minimap to get the right most banker then transfer pointtomainscreen() and search there. It all depends on the situation. Anther option is to look for relative object. Find unique object, and filter bankers to the closes/farest from that object.

I assume you use sps walking, it doesnt rotate camera, so it tends to arrange tpas from top left corner and it always becomes left banker. Probably you just need to short tpa like sortfrommidpoint() and choose right mainscreen point. Thats all

rickhunley

2015-05-20 04:28:03

Sorry, I'm not very familiar with code and couldn't find that short function. Is there some documentation you could refer me to please? Thanks :)

cosmasjdz

2015-05-20 06:22:23

Example from one of my scripts:


FindColorsSpiralTolerance(x, y, TPA, 10673123, mainScreen.getBounds(), 2, colorSetting(2, 0.26, 2.06));
ATPA := TPA.toATPA(20, 20);
ATPA.filterBetween(0, 3);
ATPA.sortFromMidPoint(mainscreen.playerPoint); // Sorts atpa from the closest to the farest one from the given point //(mainscreen.playerpoint), in your case you should change it to the point which should always be right on the screen so like
// point(500,250) would do fine if camera view is static.
if length(ATPA)<1 then exit;
smartImage.debugATPA(ATPA);
Statusas('Banking trying to catch bank from roof top');
for i := 0 to high(atpa) do
begin
mousebox(ATPA[i].getbouds(),mouse_left);
end;

Posting you actual banking procedure might help also. Hopefully you done use something like openbank() if you do then you need to change that function abit, just to insert sorting in a correct place.